mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 22:51:39 +00:00
xibless-ified MainMenu.
--HG-- branch : xibless rename : cocoa/base/AppDelegate.h => cocoa/base/AppDelegateBase.h rename : cocoa/base/AppDelegate.m => cocoa/base/AppDelegateBase.m
This commit is contained in:
@@ -7,6 +7,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Sparkle/SUUpdater.h>
|
||||
#import "PyDupeGuru.h"
|
||||
#import "ResultWindow.h"
|
||||
#import "DetailsPanel.h"
|
||||
@@ -17,9 +18,10 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
@interface AppDelegateBase : NSObject
|
||||
{
|
||||
IBOutlet NSMenu *recentResultsMenu;
|
||||
IBOutlet NSMenu *actionsMenu;
|
||||
IBOutlet NSMenu *columnsMenu;
|
||||
NSMenu *recentResultsMenu;
|
||||
NSMenu *actionsMenu;
|
||||
NSMenu *columnsMenu;
|
||||
SUUpdater *updater;
|
||||
|
||||
PyDupeGuru *model;
|
||||
ResultWindowBase *_resultWindow;
|
||||
@@ -31,6 +33,11 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
HSRecentFiles *_recentResults;
|
||||
}
|
||||
|
||||
@property (readwrite, retain) NSMenu *recentResultsMenu;
|
||||
@property (readwrite, retain) NSMenu *actionsMenu;
|
||||
@property (readwrite, retain) NSMenu *columnsMenu;
|
||||
@property (readwrite, retain) SUUpdater *updater;
|
||||
|
||||
/* Virtual */
|
||||
- (PyDupeGuru *)model;
|
||||
- (ResultWindowBase *)createResultWindow;
|
||||
@@ -39,11 +46,11 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (NSString *)homepageURL;
|
||||
|
||||
/* Public */
|
||||
- (void)finalizeInit;
|
||||
- (ResultWindowBase *)resultWindow;
|
||||
- (DirectoryPanel *)directoryPanel;
|
||||
- (DetailsPanel *)detailsPanel;
|
||||
- (HSRecentFiles *)recentResults;
|
||||
- (NSMenu *)columnsMenu;
|
||||
|
||||
/* Delegate */
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
|
||||
@@ -53,15 +60,15 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (void)recentFileClicked:(NSString *)path;
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)loadResults:(id)sender;
|
||||
- (IBAction)openWebsite:(id)sender;
|
||||
- (IBAction)openHelp:(id)sender;
|
||||
- (IBAction)showAboutBox:(id)sender;
|
||||
- (IBAction)showDirectoryWindow:(id)sender;
|
||||
- (IBAction)showPreferencesPanel:(id)sender;
|
||||
- (IBAction)showResultWindow:(id)sender;
|
||||
- (IBAction)showIgnoreList:(id)sender;
|
||||
- (IBAction)startScanning:(id)sender;
|
||||
- (void)loadResults;
|
||||
- (void)openWebsite;
|
||||
- (void)openHelp;
|
||||
- (void)showAboutBox;
|
||||
- (void)showDirectoryWindow;
|
||||
- (void)showPreferencesPanel;
|
||||
- (void)showResultWindow;
|
||||
- (void)showIgnoreList;
|
||||
- (void)startScanning;
|
||||
|
||||
/* model --> view */
|
||||
- (void)showMessage:(NSString *)msg;
|
||||
@@ -6,7 +6,7 @@ which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/bsd_license
|
||||
*/
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "AppDelegateBase.h"
|
||||
#import "ProgressController.h"
|
||||
#import "HSFairwareReminder.h"
|
||||
#import "HSPyUtil.h"
|
||||
@@ -14,19 +14,33 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
#import "Dialogs.h"
|
||||
#import "ValueTransformers.h"
|
||||
#import "PreferencesPanel_UI.h"
|
||||
#import <Sparkle/SUUpdater.h>
|
||||
|
||||
@implementation AppDelegateBase
|
||||
|
||||
@synthesize recentResultsMenu;
|
||||
@synthesize actionsMenu;
|
||||
@synthesize columnsMenu;
|
||||
@synthesize updater;
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
HSVTAdd *vt = [[[HSVTAdd alloc] initWithValue:4] autorelease];
|
||||
[NSValueTransformer setValueTransformer:vt forName:@"vtRowHeightOffset"];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
model = [[PyDupeGuru alloc] init];
|
||||
[model bindCallback:createCallback(@"DupeGuruView", self)];
|
||||
[self setUpdater:[SUUpdater sharedUpdater]];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)finalizeInit
|
||||
{
|
||||
// We can only finalize initialization once the main menu has been created, which cannot happen
|
||||
// before AppDelegate is created.
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
/* Because the pref pane is lazily loaded, we have to manually do the update check if the
|
||||
preference is set.
|
||||
@@ -93,10 +107,8 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
return _recentResults;
|
||||
}
|
||||
|
||||
- (NSMenu *)columnsMenu { return columnsMenu; }
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)loadResults:(id)sender
|
||||
- (void)loadResults
|
||||
{
|
||||
NSOpenPanel *op = [NSOpenPanel openPanel];
|
||||
[op setCanChooseFiles:YES];
|
||||
@@ -112,12 +124,12 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)openWebsite:(id)sender
|
||||
- (void)openWebsite
|
||||
{
|
||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[self homepageURL]]];
|
||||
}
|
||||
|
||||
- (IBAction)openHelp:(id)sender
|
||||
- (void)openHelp
|
||||
{
|
||||
NSBundle *b = [NSBundle mainBundle];
|
||||
NSString *p = [b pathForResource:@"index" ofType:@"html" inDirectory:@"help"];
|
||||
@@ -125,40 +137,40 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[[NSWorkspace sharedWorkspace] openURL:u];
|
||||
}
|
||||
|
||||
- (IBAction)showAboutBox:(id)sender
|
||||
- (void)showAboutBox
|
||||
{
|
||||
if (_aboutBox == nil) {
|
||||
_aboutBox = [[HSAboutBox alloc] initWithApp:model];
|
||||
}
|
||||
[[_aboutBox window] makeKeyAndOrderFront:sender];
|
||||
[[_aboutBox window] makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
- (IBAction)showDirectoryWindow:(id)sender
|
||||
- (void)showDirectoryWindow
|
||||
{
|
||||
[[[self directoryPanel] window] makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
- (IBAction)showPreferencesPanel:(id)sender
|
||||
- (void)showPreferencesPanel
|
||||
{
|
||||
if (_preferencesPanel == nil) {
|
||||
_preferencesPanel = [[NSWindowController alloc] initWithWindow:createPreferencesPanel_UI(nil)];
|
||||
}
|
||||
[_preferencesPanel showWindow:sender];
|
||||
[_preferencesPanel showWindow:nil];
|
||||
}
|
||||
|
||||
- (IBAction)showResultWindow:(id)sender
|
||||
- (void)showResultWindow
|
||||
{
|
||||
[[[self resultWindow] window] makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
- (IBAction)showIgnoreList:(id)sender
|
||||
- (void)showIgnoreList
|
||||
{
|
||||
[model showIgnoreList];
|
||||
}
|
||||
|
||||
- (IBAction)startScanning:(id)sender
|
||||
- (void)startScanning
|
||||
{
|
||||
[[self resultWindow] startDuplicateScan:sender];
|
||||
[[self resultWindow] startDuplicateScan:nil];
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
while ([m numberOfItems] > 0) {
|
||||
[m removeItemAtIndex:0];
|
||||
}
|
||||
NSMenuItem *mi = [m addItemWithTitle:TR(@"Load from file...") action:@selector(loadResults:) keyEquivalent:@""];
|
||||
NSMenuItem *mi = [m addItemWithTitle:TR(@"Load from file...") action:@selector(loadResults) keyEquivalent:@""];
|
||||
[mi setTarget:_app];
|
||||
[m addItem:[NSMenuItem separatorItem]];
|
||||
[[_app recentResults] fillMenu:m];
|
||||
@@ -124,7 +124,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[[loadRecentButtonPopUp cell] performClickWithFrame:[sender frame] inView:[sender superview]];
|
||||
}
|
||||
else {
|
||||
[_app loadResults:nil];
|
||||
[_app loadResults];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
AppDelegateBase *app;
|
||||
PyDupeGuru *model;
|
||||
NSMenu *columnsMenu;
|
||||
ResultTable *table;
|
||||
StatsLabel *statsLabel;
|
||||
ProblemDialog *problemDialog;
|
||||
|
||||
@@ -30,7 +30,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
model = [app model];
|
||||
[self setWindow:createResultWindow_UI(self)];
|
||||
[[self window] setTitle:fmt(@"%@ Results", [model appName])];
|
||||
columnsMenu = [app columnsMenu];
|
||||
/* Put a cute iTunes-like bottom bar */
|
||||
[[self window] setContentBorderThickness:28 forEdge:NSMinYEdge];
|
||||
table = [[ResultTable alloc] initWithPyRef:[model resultTable] view:matches];
|
||||
@@ -73,13 +72,13 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
NSArray *pair = [menuItems objectAtIndex:i];
|
||||
NSString *display = [pair objectAtIndex:0];
|
||||
BOOL marked = n2b([pair objectAtIndex:1]);
|
||||
NSMenuItem *mi = [columnsMenu addItemWithTitle:display action:@selector(toggleColumn:) keyEquivalent:@""];
|
||||
NSMenuItem *mi = [[app columnsMenu] addItemWithTitle:display action:@selector(toggleColumn:) keyEquivalent:@""];
|
||||
[mi setTarget:self];
|
||||
[mi setState:marked ? NSOnState : NSOffState];
|
||||
[mi setTag:i];
|
||||
}
|
||||
[columnsMenu addItem:[NSMenuItem separatorItem]];
|
||||
NSMenuItem *mi = [columnsMenu addItemWithTitle:TR(@"Reset to Default")
|
||||
[[app columnsMenu] addItem:[NSMenuItem separatorItem]];
|
||||
NSMenuItem *mi = [[app columnsMenu] addItemWithTitle:TR(@"Reset to Default")
|
||||
action:@selector(resetColumnsToDefault:) keyEquivalent:@""];
|
||||
[mi setTarget:self];
|
||||
}
|
||||
|
||||
@@ -124,3 +124,56 @@
|
||||
"Folders" = "Folders";
|
||||
"Font size:" = "Font size:";
|
||||
|
||||
/* Main Menu */
|
||||
"Bring All to Front" = "Bring All to Front";
|
||||
"Window" = "Window";
|
||||
"Minimize" = "Minimize";
|
||||
"About dupeGuru" = "About dupeGuru";
|
||||
"Help" = "Help";
|
||||
"dupeGuru Help" = "dupeGuru Help";
|
||||
"Hide dupeGuru" = "Hide dupeGuru";
|
||||
"Quit dupeGuru" = "Quit dupeGuru";
|
||||
"Hide Others" = "Hide Others";
|
||||
"Show All" = "Show All";
|
||||
"Zoom" = "Zoom";
|
||||
"Details Panel" = "Details Panel";
|
||||
"Preferences..." = "Preferences...";
|
||||
"Folder Selection Window" = "Folder Selection Window";
|
||||
"Actions" = "Actions";
|
||||
"Send Marked to Trash..." = "Send Marked to Trash...";
|
||||
"Move Marked to..." = "Move Marked to...";
|
||||
"Copy Marked to..." = "Copy Marked to...";
|
||||
"Make Selected Reference" = "Make Selected Reference";
|
||||
"Remove Marked from Results" = "Remove Marked from Results";
|
||||
"Remove Selected from Results" = "Remove Selected from Results";
|
||||
"Columns" = "Columns";
|
||||
"Open Selected with Default Application" = "Open Selected with Default Application";
|
||||
"Reveal Selected in Finder" = "Reveal Selected in Finder";
|
||||
"Add Selected to Ignore List" = "Add Selected to Ignore List";
|
||||
"Close Window" = "Close Window";
|
||||
"Start Duplicate Scan" = "Start Duplicate Scan";
|
||||
"Rename Selected" = "Rename Selected";
|
||||
"Export Results to XHTML" = "Export Results to XHTML";
|
||||
"Check for update..." = "Check for update...";
|
||||
"Mode" = "Mode";
|
||||
"Show Dupes Only" = "Show Dupes Only";
|
||||
"Show Delta Values" = "Show Delta Values";
|
||||
"Edit" = "Edit";
|
||||
"Cut" = "Cut";
|
||||
"Copy" = "Copy";
|
||||
"Paste" = "Paste";
|
||||
"Mark All" = "Mark All";
|
||||
"Mark None" = "Mark None";
|
||||
"Invert Marking" = "Invert Marking";
|
||||
"Mark Selected" = "Mark Selected";
|
||||
"dupeGuru Website" = "dupeGuru Website";
|
||||
"Invoke Custom Command" = "Invoke Custom Command";
|
||||
"File" = "File";
|
||||
"Load Results..." = "Load Results...";
|
||||
"Save Results..." = "Save Results...";
|
||||
"Load Recent Results" = "Load Recent Results";
|
||||
"Results Window" = "Results Window";
|
||||
"Re-Prioritize Results" = "Re-Prioritize Results";
|
||||
"Quick Look" = "Quick Look";
|
||||
"Ignore List" = "Ignore List";
|
||||
"Filter Results..." = "Filter Results...";
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "5"; */
|
||||
"5.title" = "Bring All to Front";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Window"; ObjectID = "19"; */
|
||||
"19.title" = "Window";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "23"; */
|
||||
"23.title" = "Minimize";
|
||||
|
||||
/* Class = "NSMenu"; title = "Window"; ObjectID = "24"; */
|
||||
"24.title" = "Window";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "About dupeGuru"; ObjectID = "58"; */
|
||||
"58.title" = "About dupeGuru";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Help"; ObjectID = "103"; */
|
||||
"103.title" = "Help";
|
||||
|
||||
/* Class = "NSMenu"; title = "Help"; ObjectID = "106"; */
|
||||
"106.title" = "Help";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "dupeGuru Help"; ObjectID = "111"; */
|
||||
"111.title" = "dupeGuru Help";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Hide dupeGuru"; ObjectID = "134"; */
|
||||
"134.title" = "Hide dupeGuru";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Quit dupeGuru"; ObjectID = "136"; */
|
||||
"136.title" = "Quit dupeGuru";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */
|
||||
"145.title" = "Hide Others";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */
|
||||
"150.title" = "Show All";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "197"; */
|
||||
"197.title" = "Zoom";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Details Panel"; ObjectID = "398"; */
|
||||
"398.title" = "Details Panel";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Preferences..."; ObjectID = "541"; */
|
||||
"541.title" = "Preferences...";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Folder Selection Window"; ObjectID = "579"; */
|
||||
"579.title" = "Folder Selection Window";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Actions"; ObjectID = "597"; */
|
||||
"597.title" = "Actions";
|
||||
|
||||
/* Class = "NSMenu"; title = "Actions"; ObjectID = "598"; */
|
||||
"598.title" = "Actions";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Send Marked to Trash..."; ObjectID = "599"; */
|
||||
"599.title" = "Send Marked to Trash...";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Move Marked to..."; ObjectID = "600"; */
|
||||
"600.title" = "Move Marked to...";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Copy Marked to..."; ObjectID = "601"; */
|
||||
"601.title" = "Copy Marked to...";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Make Selected Reference"; ObjectID = "602"; */
|
||||
"602.title" = "Make Selected Reference";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Remove Marked from Results"; ObjectID = "603"; */
|
||||
"603.title" = "Remove Marked from Results";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Remove Selected from Results"; ObjectID = "605"; */
|
||||
"605.title" = "Remove Selected from Results";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Columns"; ObjectID = "618"; */
|
||||
"618.title" = "Columns";
|
||||
|
||||
/* Class = "NSMenu"; title = "Columns"; ObjectID = "619"; */
|
||||
"619.title" = "Columns";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Open Selected with Default Application"; ObjectID = "708"; */
|
||||
"708.title" = "Open Selected with Default Application";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Reveal Selected in Finder"; ObjectID = "710"; */
|
||||
"710.title" = "Reveal Selected in Finder";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Add Selected to Ignore List"; ObjectID = "922"; */
|
||||
"922.title" = "Add Selected to Ignore List";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Close Window"; ObjectID = "924"; */
|
||||
"924.title" = "Close Window";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Start Duplicate Scan"; ObjectID = "926"; */
|
||||
"926.title" = "Start Duplicate Scan";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Rename Selected"; ObjectID = "933"; */
|
||||
"933.title" = "Rename Selected";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Export Results to XHTML"; ObjectID = "947"; */
|
||||
"947.title" = "Export Results to XHTML";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Check for update..."; ObjectID = "950"; */
|
||||
"950.title" = "Check for update...";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Mode"; ObjectID = "959"; */
|
||||
"959.title" = "Mode";
|
||||
|
||||
/* Class = "NSMenu"; title = "Mode"; ObjectID = "960"; */
|
||||
"960.title" = "Mode";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Show Dupes Only"; ObjectID = "961"; */
|
||||
"961.title" = "Show Dupes Only";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Show Delta Values"; ObjectID = "962"; */
|
||||
"962.title" = "Show Delta Values";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Edit"; ObjectID = "965"; */
|
||||
"965.title" = "Edit";
|
||||
|
||||
/* Class = "NSMenu"; title = "Edit"; ObjectID = "966"; */
|
||||
"966.title" = "Edit";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Cut"; ObjectID = "985"; */
|
||||
"985.title" = "Cut";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Copy"; ObjectID = "986"; */
|
||||
"986.title" = "Copy";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Paste"; ObjectID = "991"; */
|
||||
"991.title" = "Paste";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Mark All"; ObjectID = "1011"; */
|
||||
"1011.title" = "Mark All";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Mark None"; ObjectID = "1012"; */
|
||||
"1012.title" = "Mark None";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Invert Marking"; ObjectID = "1013"; */
|
||||
"1013.title" = "Invert Marking";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Mark Selected"; ObjectID = "1014"; */
|
||||
"1014.title" = "Mark Selected";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "dupeGuru Website"; ObjectID = "1023"; */
|
||||
"1023.title" = "dupeGuru Website";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Invoke Custom Command"; ObjectID = "1177"; */
|
||||
"1177.title" = "Invoke Custom Command";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "File"; ObjectID = "1203"; */
|
||||
"1203.title" = "File";
|
||||
|
||||
/* Class = "NSMenu"; title = "File"; ObjectID = "1204"; */
|
||||
"1204.title" = "File";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Load Results..."; ObjectID = "1205"; */
|
||||
"1205.title" = "Load Results...";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Save Results..."; ObjectID = "1206"; */
|
||||
"1206.title" = "Save Results...";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Load Recent Results"; ObjectID = "1239"; */
|
||||
"1239.title" = "Load Recent Results";
|
||||
|
||||
/* Class = "NSMenu"; title = "Load Recent Results"; ObjectID = "1240"; */
|
||||
"1240.title" = "Load Recent Results";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Results Window"; ObjectID = "1272"; */
|
||||
"1272.title" = "Results Window";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Re-Prioritize Results"; ObjectID = "1276"; */
|
||||
"1276.title" = "Re-Prioritize Results";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Quicklook"; ObjectID = "1280"; */
|
||||
"1280.title" = "Quick Look";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Ignore List"; ObjectID = "1283"; */
|
||||
"1283.title" = "Ignore List";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Filter Results..."; ObjectID = "1288"; */
|
||||
"1288.title" = "Filter Results...";
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,8 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
#import <Python.h>
|
||||
#import <wchar.h>
|
||||
#import <locale.h>
|
||||
#import "AppDelegate.h"
|
||||
#import "MainMenu_UI.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -34,8 +36,14 @@ int main(int argc, char *argv[])
|
||||
PyThreadState_Swap(NULL);
|
||||
PyEval_ReleaseLock();
|
||||
}
|
||||
int result = NSApplicationMain(argc, (const char **) argv);
|
||||
Py_Finalize();
|
||||
|
||||
[NSApplication sharedApplication];
|
||||
AppDelegate *appDelegate = [[AppDelegate alloc] init];
|
||||
[NSApp setDelegate:appDelegate];
|
||||
[NSApp setMainMenu:createMainMenu_UI(appDelegate)];
|
||||
[appDelegate finalizeInit];
|
||||
[pool release];
|
||||
return result;
|
||||
[NSApp run];
|
||||
Py_Finalize();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ scanButton.keyEquivalent = '\\r'
|
||||
addButton.action = Action(owner, 'popupAddDirectoryMenu:')
|
||||
removeButton.action = Action(owner, 'removeSelectedDirectory')
|
||||
loadResultsButton.action = Action(owner, 'popupLoadRecentMenu:')
|
||||
scanButton.action = Action(None, 'startScanning:')
|
||||
scanButton.action = Action(None, 'startScanning')
|
||||
|
||||
directoryOutline.font = Font(FontFamily.System, FontSize.SmallSystem)
|
||||
col = directoryOutline.addColumn('name', "Name", 100)
|
||||
|
||||
75
cocoa/base/ui/main_menu.py
Normal file
75
cocoa/base/ui/main_menu.py
Normal file
@@ -0,0 +1,75 @@
|
||||
ownerclass = 'AppDelegateBase'
|
||||
ownerimport = 'AppDelegateBase.h'
|
||||
|
||||
result = Menu("")
|
||||
appMenu = result.addMenu("dupeGuru")
|
||||
fileMenu = result.addMenu("File")
|
||||
editMenu = result.addMenu("Edit")
|
||||
actionMenu = result.addMenu("Actions")
|
||||
owner.actionsMenu = actionMenu
|
||||
owner.columnsMenu = result.addMenu("Columns")
|
||||
modeMenu = result.addMenu("Mode")
|
||||
windowMenu = result.addMenu("Window")
|
||||
helpMenu = result.addMenu("Help")
|
||||
|
||||
appMenu.addItem("About dupeGuru", Action(owner, 'showAboutBox'))
|
||||
appMenu.addItem("Check for update...", Action(owner.updater, 'checkForUpdates:'))
|
||||
appMenu.addSeparator()
|
||||
NSApp.servicesMenu = appMenu.addMenu("Services")
|
||||
appMenu.addSeparator()
|
||||
appMenu.addItem("Hide dupeGuru", Action(NSApp, 'hide:'), 'cmd+h')
|
||||
appMenu.addItem("Hide Others", Action(NSApp, 'hideOtherApplications:'), 'cmd+alt+h')
|
||||
appMenu.addItem("Show All", Action(NSApp, 'unhideAllApplications:'))
|
||||
appMenu.addSeparator()
|
||||
appMenu.addItem("Quit dupeGuru", Action(NSApp, 'terminate:'), 'cmd+q')
|
||||
|
||||
fileMenu.addItem("Load Results...", Action(None, 'loadResults'), 'cmd+o')
|
||||
owner.recentResultsMenu = fileMenu.addMenu("Load Recent Results")
|
||||
fileMenu.addItem("Save Results...", Action(None, 'saveResults:'), 'cmd+s')
|
||||
fileMenu.addItem("Export Results to XHTML", Action(None, 'exportToXHTML:'), 'cmd+shift+e')
|
||||
|
||||
editMenu.addItem("Mark All", Action(None, 'markAll:'), 'cmd+a')
|
||||
editMenu.addItem("Mark None", Action(None, 'markNone:'), 'cmd+shift+a')
|
||||
editMenu.addItem("Invert Marking", Action(None, 'markInvert:'), 'cmd+alt+a')
|
||||
editMenu.addItem("Mark Selected", Action(None, 'markSelected:'), 'ctrl+cmd+a')
|
||||
editMenu.addSeparator()
|
||||
editMenu.addItem("Cut", Action(None, 'cut:'), 'cmd+x')
|
||||
editMenu.addItem("Copy", Action(None, 'copy:'), 'cmd+c')
|
||||
editMenu.addItem("Paste", Action(None, 'paste:'), 'cmd+v')
|
||||
editMenu.addSeparator()
|
||||
editMenu.addItem("Filter Results...", Action(None, 'focusOnFilterField:'), 'cmd+alt+f')
|
||||
|
||||
actionMenu.addItem("Start Duplicate Scan", Action(owner, 'startScanning'), 'cmd+d')
|
||||
actionMenu.addSeparator()
|
||||
actionMenu.addItem("Send Marked to Trash...", Action(None, 'trashMarked:'), 'cmd+t')
|
||||
actionMenu.addItem("Move Marked to...", Action(None, 'moveMarked:'), 'cmd+m')
|
||||
actionMenu.addItem("Copy Marked to...", Action(None, 'copyMarked:'), 'cmd+alt+m')
|
||||
actionMenu.addItem("Remove Marked from Results", Action(None, 'removeMarked:'), 'cmd+r')
|
||||
actionMenu.addItem("Re-Prioritize Results", Action(None, 'reprioritizeResults:'))
|
||||
actionMenu.addSeparator()
|
||||
actionMenu.addItem("Remove Selected from Results", Action(None, 'removeSelected:'), 'cmd+backspace')
|
||||
actionMenu.addItem("Add Selected to Ignore List", Action(None, 'ignoreSelected:'), 'cmd+g')
|
||||
actionMenu.addItem("Make Selected Reference", Action(None, 'switchSelected:'), 'cmd+arrowup')
|
||||
actionMenu.addSeparator()
|
||||
actionMenu.addItem("Open Selected with Default Application", Action(None, 'openSelected:'), 'cmd+return')
|
||||
actionMenu.addItem("Reveal Selected in Finder", Action(None, 'revealSelected:'), 'cmd+alt+return')
|
||||
actionMenu.addItem("Invoke Custom Command", Action(None, 'invokeCustomCommand:'), 'cmd+shift+c')
|
||||
actionMenu.addItem("Rename Selected", Action(None, 'renameSelected:'))
|
||||
|
||||
modeMenu.addItem("Show Dupes Only", Action(None, 'togglePowerMarker:'), 'cmd+1')
|
||||
modeMenu.addItem("Show Delta Values", Action(None, 'toggleDelta:'), 'cmd+2')
|
||||
|
||||
windowMenu.addItem("Results Window", Action(owner, 'showResultWindow:'))
|
||||
windowMenu.addItem("Folder Selection Window", Action(owner, 'showDirectoryWindow'))
|
||||
windowMenu.addItem("Ignore List", Action(owner, 'showIgnoreList'))
|
||||
windowMenu.addItem("Details Panel", Action(owner, 'toggleDetailsPanel'), 'cmd+i')
|
||||
windowMenu.addItem("Quick Look", Action(owner, 'toggleQuicklookPanel'), 'cmd+l')
|
||||
windowMenu.addSeparator()
|
||||
windowMenu.addItem("Minimize", Action(None, 'performMinimize:'))
|
||||
windowMenu.addItem("Zoom", Action(None, 'performZoom:'))
|
||||
windowMenu.addItem("Close Window", Action(None, 'performClose:'), 'cmd+w')
|
||||
windowMenu.addSeparator()
|
||||
windowMenu.addItem("Bring All to Front", Action(None, 'arrangeInFront:'))
|
||||
|
||||
helpMenu.addItem("dupeGuru Help", Action(owner, 'openHelp'), 'cmd+?')
|
||||
helpMenu.addItem("dupeGuru Website", Action(owner, 'openWebsite'))
|
||||
@@ -50,7 +50,7 @@ optionsToolItem.view = optionsSegments
|
||||
# Popuplate menus
|
||||
actionPopup.menu.addItem("Send Marked to Trash...", action=Action(owner, 'trashMarked:'))
|
||||
actionPopup.menu.addItem("Move Marked to...", action=Action(owner, 'moveMarked:'))
|
||||
actionPopup.menu.addItem("Copy Marked to...", action=Action(owner, 'moveMarked:'))
|
||||
actionPopup.menu.addItem("Copy Marked to...", action=Action(owner, 'copyMarked:'))
|
||||
actionPopup.menu.addItem("Remove Marked from Results", action=Action(owner, 'removeMarked:'))
|
||||
actionPopup.menu.addSeparator()
|
||||
for menu in (actionPopup.menu, contextMenu):
|
||||
|
||||
Reference in New Issue
Block a user