- Timestamp:
- Sep 8, 2006, 1:14:31 AM (16 years ago)
- Location:
- trunk/macosx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.h
r847 r852 79 79 * fSeedFilterButton, * fDownloadFilterButton; 80 80 IBOutlet NSSearchField * fSearchFilterField; 81 IBOutlet NSMenuItem * fNextFilterItem, * fPrevFilterItem; 81 82 82 83 IBOutlet NSMenuItem * fNextInfoTabItem, * fPrevInfoTabItem; … … 148 149 - (void) applyFilter: (id) sender; 149 150 - (void) setFilter: (id) sender; 151 - (void) switchFilter: (id) sender; 150 152 151 153 - (void) toggleSpeedLimit: (id) sender; -
trunk/macosx/Controller.m
r850 r852 149 149 [fWindow setContentMinSize: contentMinSize]; 150 150 151 //set info keyboard shortcuts 152 unichar ch = NSRightArrowFunctionKey; 153 [fNextInfoTabItem setKeyEquivalent: [NSString stringWithCharacters: & ch length: 1]]; 154 ch = NSLeftArrowFunctionKey; 155 [fPrevInfoTabItem setKeyEquivalent: [NSString stringWithCharacters: & ch length: 1]]; 151 //set info and filter keyboard shortcuts 152 unichar rightChar = NSRightArrowFunctionKey, leftChar = NSLeftArrowFunctionKey; 153 [fNextInfoTabItem setKeyEquivalent: [NSString stringWithCharacters: & rightChar length: 1]]; 154 [fPrevInfoTabItem setKeyEquivalent: [NSString stringWithCharacters: & leftChar length: 1]]; 155 156 [fNextFilterItem setKeyEquivalent: [NSString stringWithCharacters: & rightChar length: 1]]; 157 [fNextFilterItem setKeyEquivalentModifierMask: NSCommandKeyMask + NSAlternateKeyMask]; 158 [fPrevFilterItem setKeyEquivalent: [NSString stringWithCharacters: & leftChar length: 1]]; 159 [fPrevFilterItem setKeyEquivalentModifierMask: NSCommandKeyMask + NSAlternateKeyMask]; 156 160 157 161 //set up filter bar … … 1246 1250 } 1247 1251 1252 - (void) switchFilter: (id) sender 1253 { 1254 NSButton * button; 1255 if ([fFilterType isEqualToString: @"None"]) 1256 button = sender == fNextFilterItem ? fDownloadFilterButton : fPauseFilterButton; 1257 else if ([fFilterType isEqualToString: @"Download"]) 1258 button = sender == fNextFilterItem ? fSeedFilterButton : fNoFilterButton; 1259 else if ([fFilterType isEqualToString: @"Seed"]) 1260 button = sender == fNextFilterItem ? fPauseFilterButton : fDownloadFilterButton; 1261 else if ([fFilterType isEqualToString: @"Pause"]) 1262 button = sender == fNextFilterItem ? fNoFilterButton : fSeedFilterButton; 1263 else 1264 button = fNoFilterButton; 1265 1266 [self setFilter: button]; 1267 } 1268 1248 1269 - (void) toggleSpeedLimit: (id) sender 1249 1270 { … … 2005 2026 2006 2027 //only enable some items if it is in a context menu or the window is useable 2007 BOOL canUse Menu= [fWindow isKeyWindow] || [[[menuItem menu] title] isEqualToString: @"Context"];2028 BOOL canUseTable = [fWindow isKeyWindow] || [[[menuItem menu] title] isEqualToString: @"Context"]; 2008 2029 2009 2030 //enable open items 2010 2031 if (action == @selector(openShowSheet:)) 2011 2032 return [fWindow attachedSheet] == nil; 2033 2034 //enable sort and advanced bar items 2035 if (action == @selector(setSort:) || action == @selector(toggleAdvancedBar:) || action == @selector(toggleSmallView:)) 2036 return [fWindow isVisible]; 2012 2037 2013 2038 //enable show info … … 2032 2057 [menuItem setTitle: title]; 2033 2058 2034 return canUseMenu;2059 return [fWindow isVisible]; 2035 2060 } 2036 2061 … … 2042 2067 [menuItem setTitle: title]; 2043 2068 2044 return canUseMenu; 2045 } 2069 return [fWindow isVisible]; 2070 } 2071 2072 //enable prev/next filter button 2073 if (action == @selector(switchFilter:)) 2074 return [fWindow isVisible]; 2046 2075 2047 2076 //enable reveal in finder 2048 2077 if (action == @selector(revealFile:)) 2049 return canUse Menu&& [fTableView numberOfSelectedRows] > 0;2078 return canUseTable && [fTableView numberOfSelectedRows] > 0; 2050 2079 2051 2080 //enable remove items … … 2090 2119 } 2091 2120 2092 return canUse Menu&& canDelete && [fTableView numberOfSelectedRows] > 0;2121 return canUseTable && canDelete && [fTableView numberOfSelectedRows] > 0; 2093 2122 } 2094 2123 … … 2132 2161 if (action == @selector(stopSelectedTorrents:)) 2133 2162 { 2134 if (!canUse Menu)2163 if (!canUseTable) 2135 2164 return NO; 2136 2165 … … 2151 2180 if (action == @selector(resumeSelectedTorrents:)) 2152 2181 { 2153 if (!canUse Menu)2182 if (!canUseTable) 2154 2183 return NO; 2155 2184 … … 2167 2196 } 2168 2197 2169 //enable sort and advanced bar items2170 if (action == @selector(setSort:) || action == @selector(toggleAdvancedBar:)2171 || action == @selector(toggleSmallView:))2172 return canUseMenu;2173 2174 2198 //enable copy torrent file item 2175 2199 if (action == @selector(copyTorrentFile:)) 2176 return canUse Menu&& [fTableView numberOfSelectedRows] > 0;2200 return canUseTable && [fTableView numberOfSelectedRows] > 0; 2177 2201 2178 2202 return YES; -
trunk/macosx/English.lproj/MainMenu.nib/classes.nib
r807 r852 31 31 stopAllTorrents = id; 32 32 stopSelectedTorrents = id; 33 switchFilter = id; 33 34 toggleAdvancedBar = id; 34 35 toggleFilterBar = id; … … 51 52 fNameSortActionItem = NSMenuItem; 52 53 fNameSortItem = NSMenuItem; 54 fNextFilterItem = NSMenuItem; 53 55 fNextInfoTabItem = NSMenuItem; 54 56 fNoFilterButton = BarButton; … … 57 59 fOrderSortItem = NSMenuItem; 58 60 fPauseFilterButton = BarButton; 61 fPrevFilterItem = NSMenuItem; 59 62 fPrevInfoTabItem = NSMenuItem; 60 63 fProgressSortActionItem = NSMenuItem; -
trunk/macosx/English.lproj/MainMenu.nib/info.nib
r834 r852 32 32 <key>IBOpenObjects</key> 33 33 <array> 34 <integer>21</integer> 34 35 <integer>29</integer> 35 <integer>21</integer>36 36 </array> 37 37 <key>IBSystem Version</key>
Note: See TracChangeset
for help on using the changeset viewer.