2006-01-12 17:43:21 +00:00
|
|
|
/******************************************************************************
|
2006-05-29 21:21:23 +00:00
|
|
|
* $Id$
|
|
|
|
*
|
2006-03-23 12:39:39 +00:00
|
|
|
* Copyright (c) 2005-2006 Transmission authors and contributors
|
2006-01-12 17:43:21 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2006-01-12 18:20:48 +00:00
|
|
|
#ifndef CONTROLLER_H
|
|
|
|
#define CONTROLLER_H
|
|
|
|
|
2006-01-20 01:13:21 +00:00
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import <transmission.h>
|
|
|
|
#import "PrefsController.h"
|
2006-05-25 12:22:19 +00:00
|
|
|
#import "InfoWindowController.h"
|
2006-01-20 01:51:07 +00:00
|
|
|
#import "Badger.h"
|
2006-06-06 18:05:57 +00:00
|
|
|
#import "SmoothAquaView.h"
|
2006-07-15 18:05:59 +00:00
|
|
|
#import "FilterBarView.h"
|
2006-07-15 16:22:42 +00:00
|
|
|
#import "BarButton.h"
|
2006-01-12 17:43:21 +00:00
|
|
|
|
2006-01-12 18:29:20 +00:00
|
|
|
@class TorrentTableView;
|
|
|
|
|
2006-01-12 18:40:47 +00:00
|
|
|
@interface Controller : NSObject
|
2006-01-12 17:43:21 +00:00
|
|
|
{
|
2006-03-23 12:39:39 +00:00
|
|
|
tr_handle_t * fLib;
|
2006-04-05 13:52:00 +00:00
|
|
|
int fCompleted;
|
2006-07-13 00:11:41 +00:00
|
|
|
|
|
|
|
NSMutableArray * fTorrents, * fFilteredTorrents;
|
2006-05-25 12:22:19 +00:00
|
|
|
|
2006-06-06 18:05:57 +00:00
|
|
|
PrefsController * fPrefsController;
|
|
|
|
NSUserDefaults * fDefaults;
|
2006-05-25 12:22:19 +00:00
|
|
|
InfoWindowController * fInfoController;
|
2006-01-12 18:57:23 +00:00
|
|
|
|
|
|
|
IBOutlet NSWindow * fWindow;
|
2006-02-07 05:02:45 +00:00
|
|
|
IBOutlet NSScrollView * fScrollView;
|
2006-01-12 18:57:23 +00:00
|
|
|
IBOutlet TorrentTableView * fTableView;
|
2006-06-06 18:05:57 +00:00
|
|
|
NSToolbar * fToolbar;
|
|
|
|
|
2006-07-05 22:36:27 +00:00
|
|
|
IBOutlet NSMenuItem * fAdvancedBarItem, * fSmallViewItem,
|
|
|
|
* fSpeedLimitItem, * fSpeedLimitDockItem;
|
2006-07-01 00:29:26 +00:00
|
|
|
IBOutlet NSButton * fActionButton, * fSpeedLimitButton;
|
2006-06-06 18:05:57 +00:00
|
|
|
|
|
|
|
IBOutlet SmoothAquaView * fStatusBar;
|
|
|
|
BOOL fStatusBarVisible;
|
2006-07-05 22:36:27 +00:00
|
|
|
IBOutlet NSTextField * fTotalDLField, * fTotalULField, * fTotalTorrentsField;
|
2006-05-25 12:22:19 +00:00
|
|
|
|
2006-07-15 16:33:39 +00:00
|
|
|
NSString * fSortType;
|
2006-06-25 18:33:52 +00:00
|
|
|
IBOutlet NSMenuItem * fNameSortItem, * fStateSortItem, * fProgressSortItem,
|
2006-07-15 16:33:39 +00:00
|
|
|
* fDateSortItem, * fOrderSortItem;
|
2006-07-15 16:22:42 +00:00
|
|
|
|
2006-07-15 18:05:59 +00:00
|
|
|
IBOutlet FilterBarView * fFilterBar;
|
2006-07-15 16:22:42 +00:00
|
|
|
BOOL fFilterBarVisible;
|
2006-07-15 16:33:39 +00:00
|
|
|
NSString * fFilterType;
|
2006-07-15 16:22:42 +00:00
|
|
|
IBOutlet BarButton * fNoFilterButton, * fPauseFilterButton,
|
|
|
|
* fSeedFilterButton, * fDownloadFilterButton;
|
2006-06-06 18:05:57 +00:00
|
|
|
|
|
|
|
IBOutlet NSMenuItem * fNextInfoTabItem, * fPrevInfoTabItem;
|
|
|
|
|
|
|
|
IBOutlet NSMenu * fUploadMenu, * fDownloadMenu;
|
|
|
|
IBOutlet NSMenuItem * fUploadLimitItem, * fUploadNoLimitItem,
|
|
|
|
* fDownloadLimitItem, * fDownloadNoLimitItem,
|
|
|
|
* fRatioSetItem, * fRatioNotSetItem;
|
2006-01-12 18:57:23 +00:00
|
|
|
|
|
|
|
io_connect_t fRootPort;
|
|
|
|
NSTimer * fTimer;
|
|
|
|
|
2006-07-07 01:03:52 +00:00
|
|
|
NSTimer * fAutoImportTimer;
|
2006-07-13 11:30:38 +00:00
|
|
|
NSMutableArray * fAutoImportedNames;
|
2006-07-07 01:03:52 +00:00
|
|
|
|
2006-07-15 23:13:21 +00:00
|
|
|
BOOL fUpdateInProgress;
|
2006-06-06 18:05:57 +00:00
|
|
|
Badger * fBadger;
|
2006-01-12 17:43:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) openShowSheet: (id) sender;
|
2006-07-15 23:13:21 +00:00
|
|
|
- (void) openSheetClosed: (NSOpenPanel *) s returnCode: (int) code contextInfo: (void *) info;
|
2006-01-12 18:57:23 +00:00
|
|
|
|
2006-07-15 23:13:21 +00:00
|
|
|
- (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode contextInfo: (void *) contextInfo;
|
2006-05-25 12:22:19 +00:00
|
|
|
|
|
|
|
- (NSArray *) torrentsAtIndexes: (NSIndexSet *) indexSet;
|
|
|
|
- (void) torrentNumberChanged;
|
|
|
|
|
2006-07-08 20:49:54 +00:00
|
|
|
- (void) resumeSelectedTorrents: (id) sender;
|
2006-01-12 18:57:23 +00:00
|
|
|
- (void) resumeAllTorrents: (id) sender;
|
2006-07-08 20:49:54 +00:00
|
|
|
- (void) resumeTorrents: (NSArray *) torrents;
|
|
|
|
- (void) stopSelectedTorrents: (id) sender;
|
2006-04-07 13:09:19 +00:00
|
|
|
- (void) stopAllTorrents: (id) sender;
|
2006-07-08 20:49:54 +00:00
|
|
|
- (void) stopTorrents: (NSArray *) torrents;
|
2006-01-12 18:57:23 +00:00
|
|
|
|
2006-07-08 21:03:00 +00:00
|
|
|
- (void) removeTorrents: (NSArray *) torrents
|
2006-06-15 02:07:50 +00:00
|
|
|
deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteData;
|
2006-05-25 12:22:19 +00:00
|
|
|
- (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode
|
|
|
|
contextInfo: (NSDictionary *) dict;
|
2006-07-08 21:03:00 +00:00
|
|
|
- (void) confirmRemoveTorrents: (NSArray *) torrents
|
2006-06-15 02:07:50 +00:00
|
|
|
deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent;
|
|
|
|
- (void) removeNoDelete: (id) sender;
|
2006-07-08 21:03:00 +00:00
|
|
|
- (void) removeDeleteData: (id) sender;
|
|
|
|
- (void) removeDeleteTorrent: (id) sender;
|
|
|
|
- (void) removeDeleteDataAndTorrent: (id) sender;
|
2006-05-25 12:22:19 +00:00
|
|
|
|
2006-06-10 23:06:30 +00:00
|
|
|
- (void) copyTorrentFile: (id) sender;
|
2006-06-11 00:16:31 +00:00
|
|
|
- (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents;
|
|
|
|
- (void) saveTorrentCopySheetClosed: (NSSavePanel *) panel returnCode: (int) code
|
2006-07-13 00:58:17 +00:00
|
|
|
contextInfo: (NSMutableArray *) torrents;
|
2006-06-10 23:06:30 +00:00
|
|
|
|
2006-06-06 18:05:57 +00:00
|
|
|
- (void) revealFile: (id) sender;
|
|
|
|
|
|
|
|
- (void) showPreferenceWindow: (id) sender;
|
2006-01-12 17:43:21 +00:00
|
|
|
|
2006-06-06 18:05:57 +00:00
|
|
|
- (void) showInfo: (id) sender;
|
|
|
|
- (void) setInfoTab: (id) sender;
|
|
|
|
|
|
|
|
- (void) updateUI: (NSTimer *) timer;
|
2006-02-08 19:05:42 +00:00
|
|
|
- (void) updateTorrentHistory;
|
2006-05-25 12:22:19 +00:00
|
|
|
|
|
|
|
- (void) sortTorrents;
|
2006-07-16 06:20:15 +00:00
|
|
|
- (void) sortTorrentsIgnoreSelected;
|
2006-05-25 12:22:19 +00:00
|
|
|
- (void) setSort: (id) sender;
|
2006-07-13 00:11:41 +00:00
|
|
|
- (void) applyFilter;
|
|
|
|
- (void) setFilter: (id) sender;
|
2006-05-25 12:22:19 +00:00
|
|
|
|
2006-06-30 23:43:43 +00:00
|
|
|
- (void) toggleSpeedLimit: (id) sender;
|
|
|
|
|
2006-06-06 18:05:57 +00:00
|
|
|
- (void) setLimitGlobalEnabled: (id) sender;
|
|
|
|
- (void) setQuickLimitGlobal: (id) sender;
|
|
|
|
- (void) limitGlobalChange: (NSNotification *) notification;
|
|
|
|
|
|
|
|
- (void) setRatioGlobalEnabled: (id) sender;
|
|
|
|
- (void) setQuickRatioGlobal: (id) sender;
|
|
|
|
- (void) ratioGlobalChange: (NSNotification *) notification;
|
|
|
|
|
2006-06-23 22:32:01 +00:00
|
|
|
- (void) checkWaitingForStopped: (NSNotification *) notification;
|
2006-07-09 14:43:00 +00:00
|
|
|
- (void) checkToStartWaiting: (Torrent *) finishedTorrent;
|
2006-06-23 22:32:01 +00:00
|
|
|
- (void) torrentStartSettingChange: (NSNotification *) notification;
|
|
|
|
- (void) globalStartSettingChange: (NSNotification *) notification;
|
|
|
|
|
2006-07-08 13:32:36 +00:00
|
|
|
- (void) torrentStoppedForRatio: (NSNotification *) notification;
|
|
|
|
|
2006-06-23 22:32:01 +00:00
|
|
|
- (void) attemptToStartAuto: (Torrent *) torrent;
|
2006-07-01 22:06:31 +00:00
|
|
|
- (void) attemptToStartMultipleAuto: (NSArray *) torrents;
|
2006-06-23 18:08:55 +00:00
|
|
|
|
2006-07-04 18:42:12 +00:00
|
|
|
- (void) reloadInspectorSettings: (NSNotification *) notification;
|
2006-06-23 15:06:27 +00:00
|
|
|
|
2006-07-07 01:03:52 +00:00
|
|
|
- (void) checkAutoImportDirectory: (NSTimer *) t;
|
|
|
|
- (void) autoImportChange: (NSNotification *) notification;
|
|
|
|
|
2006-07-15 23:13:21 +00:00
|
|
|
- (void) sleepCallBack: (natural_t) messageType argument: (void *) messageArgument;
|
2006-01-12 18:29:20 +00:00
|
|
|
|
2006-07-05 22:36:27 +00:00
|
|
|
- (void) toggleSmallView: (id) sender;
|
|
|
|
|
2006-05-01 00:15:18 +00:00
|
|
|
- (void) toggleStatusBar: (id) sender;
|
2006-06-06 18:05:57 +00:00
|
|
|
- (void) showStatusBar: (BOOL) show animate: (BOOL) animate;
|
2006-07-15 16:22:42 +00:00
|
|
|
- (void) toggleFilterBar: (id) sender;
|
|
|
|
- (void) showFilterBar: (BOOL) show animate: (BOOL) animate;
|
|
|
|
|
2006-07-01 18:02:36 +00:00
|
|
|
- (void) toggleAdvancedBar: (id) sender;
|
2006-01-12 18:57:23 +00:00
|
|
|
|
|
|
|
- (void) showMainWindow: (id) sender;
|
|
|
|
- (void) linkHomepage: (id) sender;
|
|
|
|
- (void) linkForums: (id) sender;
|
2006-06-19 23:07:28 +00:00
|
|
|
|
2006-06-06 18:05:57 +00:00
|
|
|
- (void) checkUpdate: (id) sender;
|
|
|
|
- (void) prepareForUpdate: (NSNotification *) notification;
|
2006-01-29 22:01:08 +00:00
|
|
|
|
2006-01-12 17:43:21 +00:00
|
|
|
@end
|
2006-01-12 18:20:48 +00:00
|
|
|
|
|
|
|
#endif
|