From 549e3e1f3be7a514b01136994f93f4f20f947c9a Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 13 Sep 2011 16:31:25 -0400 Subject: [PATCH] [#138] Began implementing the Cocoa interface of the prioritization dialog. --- cocoa/base/PrioritizeDialog.h | 31 + cocoa/base/PrioritizeDialog.m | 45 ++ cocoa/base/PyPrioritizeDialog.h | 19 + cocoa/base/ResultWindow.h | 1 + cocoa/base/ResultWindow.m | 7 + cocoa/base/en.lproj/MainMenu.xib | 46 +- cocoa/base/en.lproj/PrioritizeDialog.xib | 741 ++++++++++++++++++++ cocoa/se/dupeguru.xcodeproj/project.pbxproj | 34 + core/app_cocoa_inter.py | 28 +- core/gui/prioritize_dialog.py | 1 + 10 files changed, 943 insertions(+), 10 deletions(-) create mode 100644 cocoa/base/PrioritizeDialog.h create mode 100644 cocoa/base/PrioritizeDialog.m create mode 100644 cocoa/base/PyPrioritizeDialog.h create mode 100644 cocoa/base/en.lproj/PrioritizeDialog.xib diff --git a/cocoa/base/PrioritizeDialog.h b/cocoa/base/PrioritizeDialog.h new file mode 100644 index 00000000..a6a28add --- /dev/null +++ b/cocoa/base/PrioritizeDialog.h @@ -0,0 +1,31 @@ +/* +Copyright 2011 Hardcoded Software (http://www.hardcoded.net) + +This software is licensed under the "BSD" License as described in the "LICENSE" file, +which should be included with this package. The terms are also available at +http://www.hardcoded.net/licenses/bsd_license +*/ + +#import +#import "HSWindowController.h" +#import "PyApp.h" +#import "PyPrioritizeDialog.h" +#import "HSPopUpList.h" +#import "HSSelectableList.h" + +@interface PrioritizeDialog : HSWindowController +{ + IBOutlet NSPopUpButton *categoryPopUpView; + IBOutlet NSTableView *criteriaTableView; + IBOutlet NSTableView *prioritizationTableView; + + HSPopUpList *categoryPopUp; + HSSelectableList *criteriaList; + HSSelectableList *prioritizationList; +} +- (id)initWithPy:(PyApp *)aPy; +- (PyPrioritizeDialog *)py; + +- (IBAction)addSelected:(id)sender; +- (IBAction)removeSelected:(id)sender; +@end; \ No newline at end of file diff --git a/cocoa/base/PrioritizeDialog.m b/cocoa/base/PrioritizeDialog.m new file mode 100644 index 00000000..b6658c2f --- /dev/null +++ b/cocoa/base/PrioritizeDialog.m @@ -0,0 +1,45 @@ +/* +Copyright 2011 Hardcoded Software (http://www.hardcoded.net) + +This software is licensed under the "BSD" License as described in the "LICENSE" file, +which should be included with this package. The terms are also available at +http://www.hardcoded.net/licenses/bsd_license +*/ + +#import "PrioritizeDialog.h" + +@implementation PrioritizeDialog +- (id)initWithPy:(PyApp *)aPy +{ + self = [super initWithNibName:@"PrioritizeDialog" pyClassName:@"PyPrioritizeDialog" pyParent:aPy]; + [self window]; + categoryPopUp = [[HSPopUpList alloc] initWithPy:[[self py] categoryList] view:categoryPopUpView]; + criteriaList = [[HSSelectableList alloc] initWithPy:[[self py] criteriaList] view:criteriaTableView]; + prioritizationList = [[HSSelectableList alloc] initWithPy:[[self py] prioritizationList] view:prioritizationTableView]; + [self connect]; + return self; +} + +- (void)dealloc +{ + [self disconnect]; + [categoryPopUp release]; + [criteriaList release]; + [super dealloc]; +} + +- (PyPrioritizeDialog *)py +{ + return (PyPrioritizeDialog *)py; +} + +- (IBAction)addSelected:(id)sender +{ + [[self py] addSelected]; +} + +- (IBAction)removeSelected:(id)sender +{ + [[self py] removeSelected]; +} +@end \ No newline at end of file diff --git a/cocoa/base/PyPrioritizeDialog.h b/cocoa/base/PyPrioritizeDialog.h new file mode 100644 index 00000000..e51130e6 --- /dev/null +++ b/cocoa/base/PyPrioritizeDialog.h @@ -0,0 +1,19 @@ +/* +Copyright 2011 Hardcoded Software (http://www.hardcoded.net) + +This software is licensed under the "BSD" License as described in the "LICENSE" file, +which should be included with this package. The terms are also available at +http://www.hardcoded.net/licenses/bsd_license +*/ + +#import +#import "PyGUI.h" +#import "PySelectableList.h" + +@interface PyPrioritizeDialog : PyGUI +- (PySelectableList *)categoryList; +- (PySelectableList *)criteriaList; +- (PySelectableList *)prioritizationList; +- (void)addSelected; +- (void)removeSelected; +@end \ No newline at end of file diff --git a/cocoa/base/ResultWindow.h b/cocoa/base/ResultWindow.h index 14f0bf75..a1ec7bca 100644 --- a/cocoa/base/ResultWindow.h +++ b/cocoa/base/ResultWindow.h @@ -67,6 +67,7 @@ http://www.hardcoded.net/licenses/bsd_license - (IBAction)removeMarked:(id)sender; - (IBAction)removeSelected:(id)sender; - (IBAction)renameSelected:(id)sender; +- (IBAction)reprioritizeResults:(id)sender; - (IBAction)resetColumnsToDefault:(id)sender; - (IBAction)revealSelected:(id)sender; - (IBAction)saveResults:(id)sender; diff --git a/cocoa/base/ResultWindow.m b/cocoa/base/ResultWindow.m index d99ac17a..1a06c37c 100644 --- a/cocoa/base/ResultWindow.m +++ b/cocoa/base/ResultWindow.m @@ -12,6 +12,7 @@ http://www.hardcoded.net/licenses/bsd_license #import "Utils.h" #import "AppDelegate.h" #import "Consts.h" +#import "PrioritizeDialog.h" @implementation ResultWindowBase - (id)initWithParentApp:(AppDelegateBase *)aApp; @@ -338,6 +339,12 @@ http://www.hardcoded.net/licenses/bsd_license [matches editColumn:col row:row withEvent:[NSApp currentEvent] select:YES]; } +- (IBAction)reprioritizeResults:(id)sender +{ + PrioritizeDialog *dlg = [[PrioritizeDialog alloc] initWithPy:py]; + [dlg showWindow:nil]; +} + - (IBAction)resetColumnsToDefault:(id)sender { // Virtual diff --git a/cocoa/base/en.lproj/MainMenu.xib b/cocoa/base/en.lproj/MainMenu.xib index d1c0be9d..a504582e 100644 --- a/cocoa/base/en.lproj/MainMenu.xib +++ b/cocoa/base/en.lproj/MainMenu.xib @@ -380,6 +380,14 @@ + + + Re-Prioritize Results + + 2147483647 + + + YES @@ -932,14 +940,6 @@ 1256 - - - removeMarked: - - - - 1257 - removeSelected: @@ -1052,6 +1052,22 @@ 1275 + + + reprioritizeResults: + + + + 1278 + + + + removeMarked: + + + + 1279 + @@ -1290,6 +1306,7 @@ + @@ -1553,6 +1570,11 @@ + + 1276 + + + @@ -1577,6 +1599,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1637,7 +1660,7 @@ - 1275 + 1279 @@ -1826,6 +1849,7 @@ id id id + id id id id @@ -1913,6 +1937,10 @@ renameSelected: id + + reprioritizeResults: + id + resetColumnsToDefault: id diff --git a/cocoa/base/en.lproj/PrioritizeDialog.xib b/cocoa/base/en.lproj/PrioritizeDialog.xib new file mode 100644 index 00000000..14095a0e --- /dev/null +++ b/cocoa/base/en.lproj/PrioritizeDialog.xib @@ -0,0 +1,741 @@ + + + + 1060 + 11B26 + 1617 + 1138 + 566.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1617 + + + NSPopUpButton + NSScroller + NSButton + NSMenu + NSScrollView + NSTextFieldCell + NSButtonCell + NSTableView + NSCustomObject + NSView + NSWindowTemplate + NSPopUpButtonCell + NSTableColumn + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + PrioritizeDialog + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{196, 240}, {570, 302}} + 1618477056 + Re-Prioritize duplicates + NSWindow + + + + + 256 + + + + 268 + {{17, 258}, {216, 26}} + + + + _NS:179 + YES + + -2076049856 + 2048 + + LucidaGrande + 13 + 1044 + + _NS:179 + + 109199615 + 129 + + + 400 + 75 + + YES + + OtherViews + + + + -1 + 1 + YES + YES + 2 + + + + + 268 + + + + 2304 + + + + 256 + {208, 233} + + + + _NS:1197 + YES + + + -2147483392 + {{224, 0}, {16, 17}} + _NS:1202 + + + + 205 + 40 + 1000 + + 75628096 + 2048 + + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337772096 + 2560 + Text Cell + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + 3 + YES + YES + + + + 3 + 2 + + 3 + MQA + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + 306184192 + + + 4 + 15 + 0 + NO + 0 + 1 + + + {{1, 1}, {208, 233}} + + + + _NS:1195 + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + + _NS:1214 + + _doScroller: + 0.9925373134328358 + + + + -2147483392 + {{1, 119}, {223, 15}} + + + + _NS:1216 + 1 + + _doScroller: + 0.99581589958159 + + + {{20, 20}, {210, 235}} + + + + _NS:1193 + 133682 + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 268 + + + + 2304 + + + + 256 + {248, 233} + + + + _NS:1197 + YES + + + -2147483392 + {{224, 0}, {16, 17}} + _NS:1202 + + + + 245 + 40 + 1000 + + 75628096 + 2048 + + + + 3 + MC4zMzMzMzI5ODU2AA + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + 3 + 2 + + + 17 + 306184192 + + + 4 + 15 + 0 + NO + 0 + 1 + + + {{1, 1}, {248, 233}} + + + + _NS:1195 + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + + _NS:1214 + + _doScroller: + 0.9925373134328358 + + + + -2147483392 + {{1, 119}, {223, 15}} + + + _NS:1216 + 1 + + _doScroller: + 0.99581589958159 + + + {{300, 20}, {250, 235}} + + + + _NS:1193 + 133682 + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 268 + {{232, 162}, {66, 32}} + + + + _NS:161 + YES + + 67239424 + 134217728 + --> + + _NS:161 + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{232, 133}, {66, 32}} + + + + _NS:161 + YES + + 67239424 + 134217728 + <-- + + _NS:161 + + -2038284033 + 129 + + + 200 + 25 + + + + {570, 302} + + + + + {{0, 0}, {1920, 1058}} + {10000000000000, 10000000000000} + YES + + + + + + + categoryPopUpView + + + + 10 + + + + criteriaTableView + + + + 20 + + + + prioritizationTableView + + + + 33 + + + + addSelected: + + + + 34 + + + + removeSelected: + + + + 35 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + + + + + + + + 3 + + + + + + + + 4 + + + + + + + + 5 + + + + + + 11 + + + + + + + + + + 12 + + + + + 14 + + + + + 15 + + + + + + + + 16 + + + + + + + + 19 + + + + + 21 + + + + + + + + 22 + + + + + 23 + + + + + + + + 24 + + + + + 25 + + + + + + + + + + 26 + + + + + + + + 27 + + + + + 28 + + + + + 29 + + + + + + + + 30 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{357, 418}, {480, 270}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 35 + + + + + HSWindowController + NSWindowController + + IBProjectSource + ./Classes/HSWindowController.h + + + + PrioritizeDialog + HSWindowController + + id + id + + + + addSelected: + id + + + removeSelected: + id + + + + NSPopUpButton + NSTableView + NSTableView + + + + categoryPopUpView + NSPopUpButton + + + criteriaTableView + NSTableView + + + prioritizationTableView + NSTableView + + + + IBProjectSource + ./Classes/PrioritizeDialog.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/cocoa/se/dupeguru.xcodeproj/project.pbxproj b/cocoa/se/dupeguru.xcodeproj/project.pbxproj index 3eeef800..04e0df9e 100644 --- a/cocoa/se/dupeguru.xcodeproj/project.pbxproj +++ b/cocoa/se/dupeguru.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ CE381C9609914ACE003581CE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE381C9409914ACE003581CE /* AppDelegate.m */; }; CE381C9C09914ADF003581CE /* ResultWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE381C9A09914ADF003581CE /* ResultWindow.m */; }; CE381D0509915304003581CE /* dg_cocoa.plugin in Resources */ = {isa = PBXBuildFile; fileRef = CE381CF509915304003581CE /* dg_cocoa.plugin */; }; + CE41672D141FE1E5004F3F0B /* HSSelectableList.m in Sources */ = {isa = PBXBuildFile; fileRef = CE41672B141FE1E5004F3F0B /* HSSelectableList.m */; }; CE4526F212E5F55F00005A15 /* core.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE4526F012E5F55F00005A15 /* core.strings */; }; CE45579B0AE3BC2B005A9546 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE45579A0AE3BC2B005A9546 /* Sparkle.framework */; }; CE4557B40AE3BC50005A9546 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE45579A0AE3BC2B005A9546 /* Sparkle.framework */; }; @@ -44,6 +45,9 @@ CE8113EB12E5CE9A00A36C80 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE8113E912E5CE9A00A36C80 /* Localizable.strings */; }; CE8C53BC117324CE0011B41F /* HSTable.m in Sources */ = {isa = PBXBuildFile; fileRef = CE8C53BB117324CE0011B41F /* HSTable.m */; }; CE91F216113BC22D0010360B /* StatsLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE91F214113BC22D0010360B /* StatsLabel.m */; }; + CE9777CD141F8C2500C13FB5 /* PrioritizeDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9777CC141F8C2500C13FB5 /* PrioritizeDialog.m */; }; + CE9777D1141F8CB400C13FB5 /* PrioritizeDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE9777CF141F8CB400C13FB5 /* PrioritizeDialog.xib */; }; + CE9777D5141F9D7600C13FB5 /* HSPopUpList.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9777D4141F9D7600C13FB5 /* HSPopUpList.m */; }; CEBE4D74111F0EE1009AAC6D /* HSWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */; }; CEE7EA130FE675C80004E467 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE7EA120FE675C80004E467 /* DetailsPanel.m */; }; CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEEB135109C837A2004D2330 /* dupeguru.icns */; }; @@ -109,6 +113,9 @@ CE381C9A09914ADF003581CE /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = ResultWindow.m; sourceTree = SOURCE_ROOT; }; CE381C9B09914ADF003581CE /* ResultWindow.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = ResultWindow.h; sourceTree = SOURCE_ROOT; }; CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; path = dg_cocoa.plugin; sourceTree = SOURCE_ROOT; }; + CE41672A141FE1E5004F3F0B /* HSSelectableList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSSelectableList.h; sourceTree = ""; }; + CE41672B141FE1E5004F3F0B /* HSSelectableList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSSelectableList.m; sourceTree = ""; }; + CE41672C141FE1E5004F3F0B /* HSTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSTable.h; sourceTree = ""; }; CE4526F112E5F55F00005A15 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = ../base/en.lproj/core.strings; sourceTree = SOURCE_ROOT; }; CE4526F312E5F57000005A15 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = ../base/fr.lproj/core.strings; sourceTree = SOURCE_ROOT; }; CE45579A0AE3BC2B005A9546 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = /Library/Frameworks/Sparkle.framework; sourceTree = ""; }; @@ -167,6 +174,12 @@ CE91F210113BC22D0010360B /* PyStatsLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyStatsLabel.h; path = ../base/PyStatsLabel.h; sourceTree = SOURCE_ROOT; }; CE91F213113BC22D0010360B /* StatsLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatsLabel.h; path = ../base/StatsLabel.h; sourceTree = SOURCE_ROOT; }; CE91F214113BC22D0010360B /* StatsLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatsLabel.m; path = ../base/StatsLabel.m; sourceTree = SOURCE_ROOT; }; + CE9777CB141F8C2500C13FB5 /* PrioritizeDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrioritizeDialog.h; path = ../base/PrioritizeDialog.h; sourceTree = ""; }; + CE9777CC141F8C2500C13FB5 /* PrioritizeDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PrioritizeDialog.m; path = ../base/PrioritizeDialog.m; sourceTree = ""; }; + CE9777D0141F8CB400C13FB5 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = ../base/en.lproj/PrioritizeDialog.xib; sourceTree = ""; }; + CE9777D2141F9D6500C13FB5 /* PySelectableList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PySelectableList.h; sourceTree = ""; }; + CE9777D3141F9D7600C13FB5 /* HSPopUpList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSPopUpList.h; sourceTree = ""; }; + CE9777D4141F9D7600C13FB5 /* HSPopUpList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSPopUpList.m; sourceTree = ""; }; CEBE4D72111F0EE1009AAC6D /* HSWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSWindowController.h; sourceTree = ""; }; CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSWindowController.m; sourceTree = ""; }; CECFFF1C13CDF8D0003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = ../base/de.lproj/DetailsPanel.xib; sourceTree = SOURCE_ROOT; }; @@ -334,7 +347,12 @@ CE76FDDE111EE42F006618EA /* HSOutline.m */, CE76FDC8111EE38E006618EA /* HSGUIController.h */, CE76FDC9111EE38E006618EA /* HSGUIController.m */, + CE41672C141FE1E5004F3F0B /* HSTable.h */, CE8C53BB117324CE0011B41F /* HSTable.m */, + CE9777D3141F9D7600C13FB5 /* HSPopUpList.h */, + CE9777D4141F9D7600C13FB5 /* HSPopUpList.m */, + CE41672A141FE1E5004F3F0B /* HSSelectableList.h */, + CE41672B141FE1E5004F3F0B /* HSSelectableList.m */, ); name = controllers; path = ../../cocoalib/controllers; @@ -346,6 +364,7 @@ CE76FDCD111EE38E006618EA /* PyGUI.h */, CE76FDCE111EE38E006618EA /* PyOutline.h */, CE8C53B61173248F0011B41F /* PyTable.h */, + CE9777D2141F9D6500C13FB5 /* PySelectableList.h */, ); name = proxies; path = ../../cocoalib/proxies; @@ -361,6 +380,7 @@ CE81134A12E5CE4D00A36C80 /* ResultWindow.xib */, CE81135612E5CE6D00A36C80 /* Preferences.xib */, CE665B3113225AF8003F5CFB /* ExtraFairwareReminder.xib */, + CE9777CF141F8CB400C13FB5 /* PrioritizeDialog.xib */, ); name = xib; sourceTree = ""; @@ -433,6 +453,8 @@ CE647E551173024A006D28BA /* ProblemDialog.m */, CE647E561173024A006D28BA /* PyProblemDialog.h */, CE665B2F13225ADD003F5CFB /* PyExtraFairwareReminder.h */, + CE9777CB141F8C2500C13FB5 /* PrioritizeDialog.h */, + CE9777CC141F8C2500C13FB5 /* PrioritizeDialog.m */, ); name = dgbase; sourceTree = ""; @@ -514,6 +536,7 @@ CE665B3313225AF8003F5CFB /* ExtraFairwareReminder.xib in Resources */, CE31819D13D85D9B00B6D649 /* about.xib in Resources */, CE31819E13D85D9B00B6D649 /* ErrorReportWindow.xib in Resources */, + CE9777D1141F8CB400C13FB5 /* PrioritizeDialog.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -553,6 +576,9 @@ CE27D3C412CCA43800859E67 /* HSAboutBox.m in Sources */, CEF0ACCE12DF3C2000B32F7E /* HSRecentFiles.m in Sources */, CE665B3013225ADD003F5CFB /* ExtraFairwareReminder.m in Sources */, + CE9777CD141F8C2500C13FB5 /* PrioritizeDialog.m in Sources */, + CE9777D5141F9D7600C13FB5 /* HSPopUpList.m in Sources */, + CE41672D141FE1E5004F3F0B /* HSSelectableList.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -692,6 +718,14 @@ name = Localizable.strings; sourceTree = SOURCE_ROOT; }; + CE9777CF141F8CB400C13FB5 /* PrioritizeDialog.xib */ = { + isa = PBXVariantGroup; + children = ( + CE9777D0141F8CB400C13FB5 /* en */, + ); + name = PrioritizeDialog.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/core/app_cocoa_inter.py b/core/app_cocoa_inter.py index daaf4e67..55009477 100644 --- a/core/app_cocoa_inter.py +++ b/core/app_cocoa_inter.py @@ -8,7 +8,8 @@ # Common interface for all editions' dg_cocoa unit. -from hscommon.cocoa.inter import signature, PyTable, PyOutline, PyGUIObject, PyFairware +from hscommon.cocoa.inter import (signature, PyTable, PyOutline, PyGUIObject, PyFairware, + PySelectableList) from .gui.details_panel import DetailsPanel from .gui.directory_tree import DirectoryTree @@ -17,6 +18,7 @@ from .gui.problem_table import ProblemTable from .gui.result_table import ResultTable from .gui.stats_label import StatsLabel from .gui.extra_fairware_reminder import ExtraFairwareReminder +from .gui.prioritize_dialog import PrioritizeDialog class PyDupeGuruBase(PyFairware): #---Directories @@ -264,3 +266,27 @@ class PyExtraFairwareReminder(PyGUIObject): def set_button_text(self, text): self.cocoa.setButtonText_(text) + +class PyPrioritizeDialog(PyGUIObject): + py_class = PrioritizeDialog + + def categoryList(self): + if not hasattr(self, '_categoryList'): + self._categoryList = PySelectableList.alloc().initWithPy_(self.py.category_list) + return self._categoryList + + def criteriaList(self): + if not hasattr(self, '_criteriaList'): + self._criteriaList = PySelectableList.alloc().initWithPy_(self.py.criteria_list) + return self._criteriaList + + def prioritizationList(self): + if not hasattr(self, '_prioritizationList'): + self._prioritizationList = PySelectableList.alloc().initWithPy_(self.py.prioritization_list) + return self._prioritizationList + + def addSelected(self): + self.py.add_selected() + + def removeSelected(self): + self.py.remove_selected() diff --git a/core/gui/prioritize_dialog.py b/core/gui/prioritize_dialog.py index d6ef88bd..24e441d0 100644 --- a/core/gui/prioritize_dialog.py +++ b/core/gui/prioritize_dialog.py @@ -50,6 +50,7 @@ class PrioritizeDialog: self.criteria_list = GUISelectableList() self.prioritizations = [] self.prioritization_list = PrioritizationList(self) + self.category_list.select(0) #--- Private def _sort_key(self, dupe):