diff --git a/build.py b/build.py
index b1c63eb..ca57710 100644
--- a/build.py
+++ b/build.py
@@ -82,7 +82,6 @@ def build_xibless(dest='cocoa/autogen'):
FNPAIRS = [
('problem_dialog.py', 'ProblemDialog_UI'),
('directory_panel.py', 'DirectoryPanel_UI'),
- ('prioritize_dialog.py', 'PrioritizeDialog_UI'),
]
for srcname, dstname in FNPAIRS:
xibless.generate(
diff --git a/cocoa/Base.lproj/PrioritizeDialog.xib b/cocoa/Base.lproj/PrioritizeDialog.xib
new file mode 100644
index 0000000..bae2e33
--- /dev/null
+++ b/cocoa/Base.lproj/PrioritizeDialog.xib
@@ -0,0 +1,204 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Add criteria to the right box and click OK to send the dupes that correspond the best to these criteria to their respective group's reference position. Read the help file for more information.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cocoa/PrioritizeDialog.h b/cocoa/PrioritizeDialog.h
index 35f030c..e09e631 100644
--- a/cocoa/PrioritizeDialog.h
+++ b/cocoa/PrioritizeDialog.h
@@ -1,5 +1,5 @@
/*
-Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
+Copyright 2017 Virgil Dupras
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
@@ -15,9 +15,9 @@ http://www.gnu.org/licenses/gpl-3.0.html
@interface PrioritizeDialog : NSWindowController
{
- NSPopUpButton *categoryPopUpView;
- NSTableView *criteriaTableView;
- NSTableView *prioritizationTableView;
+ IBOutlet NSPopUpButton *categoryPopUpView;
+ IBOutlet NSTableView *criteriaTableView;
+ IBOutlet NSTableView *prioritizationTableView;
PyPrioritizeDialog *model;
HSPopUpList *categoryPopUp;
@@ -32,6 +32,8 @@ http://www.gnu.org/licenses/gpl-3.0.html
- (id)initWithApp:(PyDupeGuru *)aApp;
- (PyPrioritizeDialog *)model;
-- (void)ok;
-- (void)cancel;
+- (IBAction)addSelected:(id)sender;
+- (IBAction)removeSelected:(id)sender;
+- (IBAction)ok:(id)sender;
+- (IBAction)cancel:(id)sender;
@end;
\ No newline at end of file
diff --git a/cocoa/PrioritizeDialog.m b/cocoa/PrioritizeDialog.m
index 9741951..e4d873c 100644
--- a/cocoa/PrioritizeDialog.m
+++ b/cocoa/PrioritizeDialog.m
@@ -1,5 +1,5 @@
/*
-Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
+Copyright 2017 Virgil Dupras
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
@@ -7,7 +7,6 @@ http://www.gnu.org/licenses/gpl-3.0.html
*/
#import "PrioritizeDialog.h"
-#import "PrioritizeDialog_UI.h"
#import "HSPyUtil.h"
@implementation PrioritizeDialog
@@ -19,8 +18,8 @@ http://www.gnu.org/licenses/gpl-3.0.html
- (id)initWithApp:(PyDupeGuru *)aApp
{
self = [super initWithWindowNibName:@"PrioritizeDialog"];
+ [self window];
model = [[PyPrioritizeDialog alloc] initWithApp:[aApp pyRef]];
- [self setWindow:createPrioritizeDialog_UI(self)];
categoryPopUp = [[HSPopUpList alloc] initWithPyRef:[[self model] categoryList] popupView:categoryPopUpView];
criteriaList = [[HSSelectableList alloc] initWithPyRef:[[self model] criteriaList] tableView:criteriaTableView];
prioritizationList = [[PrioritizeList alloc] initWithPyRef:[[self model] prioritizationList] tableView:prioritizationTableView];
@@ -42,13 +41,23 @@ http://www.gnu.org/licenses/gpl-3.0.html
return (PyPrioritizeDialog *)model;
}
-- (void)ok
+- (IBAction)addSelected:(id)sender
+{
+ [[self model] addSelected];
+}
+
+- (IBAction)removeSelected:(id)sender
+{
+ [[self model] removeSelected];
+}
+
+- (IBAction)ok:(id)sender
{
[NSApp stopModal];
[self close];
}
-- (void)cancel
+- (IBAction)cancel:(id)sender
{
[NSApp abortModal];
[self close];
diff --git a/cocoa/ui/prioritize_dialog.py b/cocoa/ui/prioritize_dialog.py
deleted file mode 100644
index 6927113..0000000
--- a/cocoa/ui/prioritize_dialog.py
+++ /dev/null
@@ -1,65 +0,0 @@
-ownerclass = 'PrioritizeDialog'
-ownerimport = 'PrioritizeDialog.h'
-
-result = Window(610, 400, "Re-Prioritize duplicates")
-promptLabel = Label(result, "Add criteria to the right box and click OK to send the dupes that "
- "correspond the best to these criteria to their respective group's reference position. Read "
- "the help file for more information.")
-split = SplitView(result, 2, vertical=True)
-categoryPopup = Popup(split.subviews[0])
-criteriaTable = ListView(split.subviews[0])
-prioritizationTable = ListView(split.subviews[1])
-addButton = Button(split.subviews[1], NLSTR("-->"))
-removeButton = Button(split.subviews[1], NLSTR("<--"))
-okButton = Button(result, "Ok")
-cancelButton = Button(result, "Cancel")
-
-owner.categoryPopUpView = categoryPopup
-owner.criteriaTableView = criteriaTable
-owner.prioritizationTableView = prioritizationTable
-
-result.canMinimize = False
-result.canClose = False
-result.minSize = Size(result.width, result.height)
-addButton.action = Action(owner.model, 'addSelected')
-removeButton.action = Action(owner.model, 'removeSelected')
-okButton.action = Action(owner, 'ok')
-cancelButton.action = Action(owner, 'cancel')
-okButton.keyEquivalent = '\\r'
-cancelButton.keyEquivalent = '\\e'
-
-# For layouts to correctly work, subviews need to have the dimensions they'll approximately have
-# at runtime.
-split.subviews[0].width = 260
-split.subviews[0].height = 260
-split.subviews[1].width = 340
-split.subviews[1].height = 260
-promptLabel.height *= 3 # 3 lines
-
-leftLayout = VLayout([categoryPopup, criteriaTable], filler=criteriaTable)
-middleLayout = VLayout([addButton, removeButton], width=41)
-buttonLayout = HLayout([None, cancelButton, okButton])
-
-#pack split subview 0
-leftLayout.fillAll()
-
-#pack split subview 1
-prioritizationTable.fillAll()
-prioritizationTable.width -= 48
-prioritizationTable.moveTo(Pack.Right)
-middleLayout.moveNextTo(prioritizationTable, Pack.Left, align=Pack.Middle)
-
-# Main layout
-promptLabel.packToCorner(Pack.UpperLeft)
-promptLabel.fill(Pack.Right)
-split.moveNextTo(promptLabel, Pack.Below)
-buttonLayout.moveNextTo(split, Pack.Below)
-buttonLayout.fill(Pack.Right)
-split.fill(Pack.LowerRight)
-
-promptLabel.setAnchor(Pack.UpperLeft, growX=True)
-prioritizationTable.setAnchor(Pack.UpperLeft, growX=True, growY=True)
-categoryPopup.setAnchor(Pack.UpperLeft, growX=True)
-criteriaTable.setAnchor(Pack.UpperLeft, growX=True, growY=True)
-split.setAnchor(Pack.UpperLeft, growX=True, growY=True)
-buttonLayout.setAnchor(Pack.Below)
diff --git a/dupeGuru.xcodeproj/project.pbxproj b/dupeGuru.xcodeproj/project.pbxproj
index ff2f95c..2f757a6 100644
--- a/dupeGuru.xcodeproj/project.pbxproj
+++ b/dupeGuru.xcodeproj/project.pbxproj
@@ -58,7 +58,6 @@
CE9721461E74E41D00A598C9 /* PreferencesPanelMusic_UI.m in Sources */ = {isa = PBXBuildFile; fileRef = CE97210A1E74E41C00A598C9 /* PreferencesPanelMusic_UI.m */; };
CE9721471E74E41D00A598C9 /* PreferencesPanelPicture_UI.m in Sources */ = {isa = PBXBuildFile; fileRef = CE97210C1E74E41C00A598C9 /* PreferencesPanelPicture_UI.m */; };
CE9721481E74E41D00A598C9 /* PreferencesPanelStandard_UI.m in Sources */ = {isa = PBXBuildFile; fileRef = CE97210E1E74E41C00A598C9 /* PreferencesPanelStandard_UI.m */; };
- CE9721491E74E41D00A598C9 /* PrioritizeDialog_UI.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9721101E74E41C00A598C9 /* PrioritizeDialog_UI.m */; };
CE97214A1E74E41D00A598C9 /* ProblemDialog_UI.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9721121E74E41D00A598C9 /* ProblemDialog_UI.m */; };
CE97214C1E74E41D00A598C9 /* PyBaseApp.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9721161E74E41D00A598C9 /* PyBaseApp.m */; };
CE97214D1E74E41D00A598C9 /* PyColumns.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9721181E74E41D00A598C9 /* PyColumns.m */; };
@@ -84,6 +83,7 @@
CEF093DE1E9474F700CD0BF3 /* DeletionOptions.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEF093DC1E9474F700CD0BF3 /* DeletionOptions.xib */; };
CEF093FF1E94795600CD0BF3 /* DetailsPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEF093FD1E94795600CD0BF3 /* DetailsPanel.xib */; };
CEF094201E947AF700CD0BF3 /* DetailsPanelPicture.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEF0941E1E947AF700CD0BF3 /* DetailsPanelPicture.xib */; };
+ CEF094411E947CAB00CD0BF3 /* PrioritizeDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEF0943F1E947CAB00CD0BF3 /* PrioritizeDialog.xib */; };
CEFC8A251E74F23000965F37 /* dg_cocoa.py in Resources */ = {isa = PBXBuildFile; fileRef = CEFC8A231E74F23000965F37 /* dg_cocoa.py */; };
CEFC8A261E74F23000965F37 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEFC8A241E74F23000965F37 /* dupeguru.icns */; };
CEFC8A281E74F28100965F37 /* help in Resources */ = {isa = PBXBuildFile; fileRef = CEFC8A271E74F28100965F37 /* help */; };
@@ -305,8 +305,6 @@
CE97210C1E74E41C00A598C9 /* PreferencesPanelPicture_UI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PreferencesPanelPicture_UI.m; path = cocoa/autogen/PreferencesPanelPicture_UI.m; sourceTree = ""; };
CE97210D1E74E41C00A598C9 /* PreferencesPanelStandard_UI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PreferencesPanelStandard_UI.h; path = cocoa/autogen/PreferencesPanelStandard_UI.h; sourceTree = ""; };
CE97210E1E74E41C00A598C9 /* PreferencesPanelStandard_UI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PreferencesPanelStandard_UI.m; path = cocoa/autogen/PreferencesPanelStandard_UI.m; sourceTree = ""; };
- CE97210F1E74E41C00A598C9 /* PrioritizeDialog_UI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrioritizeDialog_UI.h; path = cocoa/autogen/PrioritizeDialog_UI.h; sourceTree = ""; };
- CE9721101E74E41C00A598C9 /* PrioritizeDialog_UI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PrioritizeDialog_UI.m; path = cocoa/autogen/PrioritizeDialog_UI.m; sourceTree = ""; };
CE9721111E74E41D00A598C9 /* ProblemDialog_UI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProblemDialog_UI.h; path = cocoa/autogen/ProblemDialog_UI.h; sourceTree = ""; };
CE9721121E74E41D00A598C9 /* ProblemDialog_UI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ProblemDialog_UI.m; path = cocoa/autogen/ProblemDialog_UI.m; sourceTree = ""; };
CE9721151E74E41D00A598C9 /* PyBaseApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyBaseApp.h; path = cocoa/autogen/PyBaseApp.h; sourceTree = ""; };
@@ -413,6 +411,22 @@
CEF0943A1E947B1000CD0BF3 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = cocoa/uk.lproj/DetailsPanelPicture.strings; sourceTree = ""; };
CEF0943C1E947B1100CD0BF3 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "cocoa/zh-Hans.lproj/DetailsPanelPicture.strings"; sourceTree = ""; };
CEF0943E1E947B1200CD0BF3 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = cocoa/vi.lproj/DetailsPanelPicture.strings; sourceTree = ""; };
+ CEF094401E947CAB00CD0BF3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = cocoa/Base.lproj/PrioritizeDialog.xib; sourceTree = ""; };
+ CEF094431E947CEA00CD0BF3 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = cocoa/fr.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF094451E947CEB00CD0BF3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = cocoa/de.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF094471E947CEC00CD0BF3 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cocoa/cs.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF094491E947CEE00CD0BF3 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = cocoa/es.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF0944B1E947CEF00CD0BF3 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = cocoa/el.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF0944D1E947CF000CD0BF3 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = cocoa/it.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF0944F1E947CF200CD0BF3 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = cocoa/nl.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF094511E947CF400CD0BF3 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = cocoa/pl.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF094531E947CF500CD0BF3 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = cocoa/ko.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF094551E947CF700CD0BF3 /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = cocoa/hy.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF094571E947CF800CD0BF3 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "cocoa/pt-BR.lproj/PrioritizeDialog.strings"; sourceTree = ""; };
+ CEF094591E947CFA00CD0BF3 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = cocoa/ru.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF0945B1E947CFB00CD0BF3 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = cocoa/uk.lproj/PrioritizeDialog.strings; sourceTree = ""; };
+ CEF0945D1E947CFD00CD0BF3 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "cocoa/zh-Hans.lproj/PrioritizeDialog.strings"; sourceTree = ""; };
+ CEF0945F1E947CFE00CD0BF3 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = cocoa/vi.lproj/PrioritizeDialog.strings; sourceTree = ""; };
CEFC8A231E74F23000965F37 /* dg_cocoa.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = dg_cocoa.py; path = cocoa/dg_cocoa.py; sourceTree = ""; };
CEFC8A241E74F23000965F37 /* dupeguru.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = dupeguru.icns; path = cocoa/dupeguru.icns; sourceTree = ""; };
CEFC8A271E74F28100965F37 /* help */ = {isa = PBXFileReference; lastKnownFileType = folder; name = help; path = build/help; sourceTree = ""; };
@@ -439,6 +453,7 @@
CEF093DC1E9474F700CD0BF3 /* DeletionOptions.xib */,
CEF093FD1E94795600CD0BF3 /* DetailsPanel.xib */,
CEF0941E1E947AF700CD0BF3 /* DetailsPanelPicture.xib */,
+ CEF0943F1E947CAB00CD0BF3 /* PrioritizeDialog.xib */,
);
name = xib;
sourceTree = "";
@@ -582,8 +597,6 @@
CE97210C1E74E41C00A598C9 /* PreferencesPanelPicture_UI.m */,
CE97210D1E74E41C00A598C9 /* PreferencesPanelStandard_UI.h */,
CE97210E1E74E41C00A598C9 /* PreferencesPanelStandard_UI.m */,
- CE97210F1E74E41C00A598C9 /* PrioritizeDialog_UI.h */,
- CE9721101E74E41C00A598C9 /* PrioritizeDialog_UI.m */,
CE9721111E74E41D00A598C9 /* ProblemDialog_UI.h */,
CE9721121E74E41D00A598C9 /* ProblemDialog_UI.m */,
CE9721151E74E41D00A598C9 /* PyBaseApp.h */,
@@ -741,6 +754,7 @@
CE05598E1E76217C008EB4F8 /* Localizable.strings in Resources */,
CE65D0ED1E7783C40092126E /* ErrorReportWindow.xib in Resources */,
CE549CDC1E933C7600C75A05 /* ResultWindow.xib in Resources */,
+ CEF094411E947CAB00CD0BF3 /* PrioritizeDialog.xib in Resources */,
CEFC8A251E74F23000965F37 /* dg_cocoa.py in Resources */,
CEF093DE1E9474F700CD0BF3 /* DeletionOptions.xib in Resources */,
CE7CA6061E76337700874874 /* about.xib in Resources */,
@@ -774,7 +788,6 @@
CE9721501E74E41D00A598C9 /* PyDirectoryOutline.m in Sources */,
CE9720F31E74E40300A598C9 /* ResultTable.m in Sources */,
CE6F7DE91E74E9E4004C0518 /* HSPyUtil.m in Sources */,
- CE9721491E74E41D00A598C9 /* PrioritizeDialog_UI.m in Sources */,
CE9720EA1E74E40300A598C9 /* DetailsPanel.m in Sources */,
CE9721571E74E41D00A598C9 /* PyProblemDialog.m in Sources */,
CE97215D1E74E41D00A598C9 /* PyTextField.m in Sources */,
@@ -1084,6 +1097,29 @@
name = DetailsPanelPicture.xib;
sourceTree = "";
};
+ CEF0943F1E947CAB00CD0BF3 /* PrioritizeDialog.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ CEF094401E947CAB00CD0BF3 /* Base */,
+ CEF094431E947CEA00CD0BF3 /* fr */,
+ CEF094451E947CEB00CD0BF3 /* de */,
+ CEF094471E947CEC00CD0BF3 /* cs */,
+ CEF094491E947CEE00CD0BF3 /* es */,
+ CEF0944B1E947CEF00CD0BF3 /* el */,
+ CEF0944D1E947CF000CD0BF3 /* it */,
+ CEF0944F1E947CF200CD0BF3 /* nl */,
+ CEF094511E947CF400CD0BF3 /* pl */,
+ CEF094531E947CF500CD0BF3 /* ko */,
+ CEF094551E947CF700CD0BF3 /* hy */,
+ CEF094571E947CF800CD0BF3 /* pt-BR */,
+ CEF094591E947CFA00CD0BF3 /* ru */,
+ CEF0945B1E947CFB00CD0BF3 /* uk */,
+ CEF0945D1E947CFD00CD0BF3 /* zh-Hans */,
+ CEF0945F1E947CFE00CD0BF3 /* vi */,
+ );
+ name = PrioritizeDialog.xib;
+ sourceTree = "";
+ };
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */