From 171c9cefed792f5c6442039df4d241ebf31dbb39 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 4 Apr 2017 21:45:59 -0400 Subject: [PATCH] Un-xibless-ified ProblemDialog --- cocoa/Base.lproj/ProblemDialog.xib | 94 ++++++++++++++++++++++++++++++ cocoa/ProblemDialog.h | 5 +- cocoa/ProblemDialog.m | 12 ++-- cocoa/ui/problem_dialog.py | 35 ----------- dupeGuru.xcodeproj/project.pbxproj | 48 +++++++++++++-- 5 files changed, 147 insertions(+), 47 deletions(-) create mode 100644 cocoa/Base.lproj/ProblemDialog.xib delete mode 100644 cocoa/ui/problem_dialog.py diff --git a/cocoa/Base.lproj/ProblemDialog.xib b/cocoa/Base.lproj/ProblemDialog.xib new file mode 100644 index 0000000..50fde08 --- /dev/null +++ b/cocoa/Base.lproj/ProblemDialog.xib @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + There were problems processing some (or all) of the files. The cause of these problems are described in the table below. Those files were not removed from your results. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocoa/ProblemDialog.h b/cocoa/ProblemDialog.h index 309f278..c523075 100644 --- a/cocoa/ProblemDialog.h +++ b/cocoa/ProblemDialog.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 @@ -14,7 +14,7 @@ http://www.gnu.org/licenses/gpl-3.0.html { PyProblemDialog *model; HSTable *problemTable; - NSTableView *problemTableView; + IBOutlet NSTableView *problemTableView; } @property (readwrite, retain) PyProblemDialog *model; @@ -23,4 +23,5 @@ http://www.gnu.org/licenses/gpl-3.0.html - (id)initWithPyRef:(PyObject *)aPyRef; - (void)initializeColumns; +- (IBAction)revealSelected:(id)sender; @end \ No newline at end of file diff --git a/cocoa/ProblemDialog.m b/cocoa/ProblemDialog.m index 2619aa7..697086a 100644 --- a/cocoa/ProblemDialog.m +++ b/cocoa/ProblemDialog.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 "ProblemDialog.h" -#import "ProblemDialog_UI.h" #import "Utils.h" @implementation ProblemDialog @@ -17,9 +16,9 @@ http://www.gnu.org/licenses/gpl-3.0.html - (id)initWithPyRef:(PyObject *)aPyRef { - self = [super initWithWindow:nil]; + self = [super initWithWindowNibName:@"ProblemDialog"]; + [self window]; self.model = [[PyProblemDialog alloc] initWithModel:aPyRef]; - [self setWindow:createProblemDialog_UI(self)]; problemTable = [[HSTable alloc] initWithPyRef:[self.model problemTable] tableView:problemTableView]; [self initializeColumns]; return self; @@ -41,4 +40,9 @@ http://www.gnu.org/licenses/gpl-3.0.html [[problemTable columns] initializeColumns:defs]; [[problemTable columns] setColumnsAsReadOnly]; } + +- (IBAction)revealSelected:(id)sender +{ + [model revealSelected]; +} @end \ No newline at end of file diff --git a/cocoa/ui/problem_dialog.py b/cocoa/ui/problem_dialog.py deleted file mode 100644 index cd3430b..0000000 --- a/cocoa/ui/problem_dialog.py +++ /dev/null @@ -1,35 +0,0 @@ -ownerclass = 'ProblemDialog' -ownerimport = 'ProblemDialog.h' - -result = Window(480, 310, "Problems!") -messageLabel = Label(result, "There were problems processing some (or all) of the files. The cause " - "of these problems are described in the table below. Those files were not removed from your " - "results.") -problemTable = TableView(result) -revealButton = Button(result, "Reveal") -closeButton = Button(result, "Close") - -owner.problemTableView = problemTable - -result.canMinimize = False -result.minSize = Size(300, 300) -closeButton.keyEquivalent = '\\r' -revealButton.action = Action(owner.model, 'revealSelected') -closeButton.action = Action(result, 'performClose:') - -messageLabel.height *= 3 # 3 lines -revealButton.width = 150 -closeButton.width = 98 - -messageLabel.packToCorner(Pack.UpperLeft) -messageLabel.fill(Pack.Right) -problemTable.packRelativeTo(messageLabel, Pack.Below) -problemTable.fill(Pack.Right) -revealButton.packRelativeTo(problemTable, Pack.Below) -closeButton.packRelativeTo(problemTable, Pack.Below, align=Pack.Right) -problemTable.fill(Pack.Below) - -messageLabel.setAnchor(Pack.UpperLeft, growX=True) -problemTable.setAnchor(Pack.UpperLeft, growX=True, growY=True) -revealButton.setAnchor(Pack.LowerLeft) -closeButton.setAnchor(Pack.LowerRight) diff --git a/dupeGuru.xcodeproj/project.pbxproj b/dupeGuru.xcodeproj/project.pbxproj index 2f757a6..0af632a 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 */; }; - 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 */; }; CE97214E1E74E41D00A598C9 /* PyDeletionOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE97211A1E74E41D00A598C9 /* PyDeletionOptions.m */; }; @@ -84,6 +83,7 @@ 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 */; }; + CEF094621E94828600CD0BF3 /* ProblemDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEF094601E94828600CD0BF3 /* ProblemDialog.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 = ""; }; - 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 = ""; }; CE9721161E74E41D00A598C9 /* PyBaseApp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PyBaseApp.m; path = cocoa/autogen/PyBaseApp.m; sourceTree = ""; }; CE9721171E74E41D00A598C9 /* PyColumns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyColumns.h; path = cocoa/autogen/PyColumns.h; sourceTree = ""; }; @@ -427,6 +425,22 @@ 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 = ""; }; + CEF094611E94828600CD0BF3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = cocoa/Base.lproj/ProblemDialog.xib; sourceTree = ""; }; + CEF094641E94829800CD0BF3 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = cocoa/fr.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF094661E94829900CD0BF3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = cocoa/de.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF094681E94829C00CD0BF3 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cocoa/cs.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF0946A1E94829E00CD0BF3 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = cocoa/es.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF0946C1E9482A000CD0BF3 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = cocoa/el.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF0946E1E9482A100CD0BF3 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = cocoa/it.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF094701E9482A200CD0BF3 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = cocoa/nl.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF094721E9482A300CD0BF3 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = cocoa/pl.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF094741E9482A400CD0BF3 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = cocoa/ko.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF094761E9482A600CD0BF3 /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = cocoa/hy.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF094781E9482A700CD0BF3 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "cocoa/pt-BR.lproj/ProblemDialog.strings"; sourceTree = ""; }; + CEF0947A1E9482A800CD0BF3 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = cocoa/ru.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF0947C1E9482AA00CD0BF3 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = cocoa/uk.lproj/ProblemDialog.strings; sourceTree = ""; }; + CEF0947E1E9482AB00CD0BF3 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "cocoa/zh-Hans.lproj/ProblemDialog.strings"; sourceTree = ""; }; + CEF094801E9482AC00CD0BF3 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = cocoa/vi.lproj/ProblemDialog.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 = ""; }; @@ -454,6 +468,7 @@ CEF093FD1E94795600CD0BF3 /* DetailsPanel.xib */, CEF0941E1E947AF700CD0BF3 /* DetailsPanelPicture.xib */, CEF0943F1E947CAB00CD0BF3 /* PrioritizeDialog.xib */, + CEF094601E94828600CD0BF3 /* ProblemDialog.xib */, ); name = xib; sourceTree = ""; @@ -597,8 +612,6 @@ CE97210C1E74E41C00A598C9 /* PreferencesPanelPicture_UI.m */, CE97210D1E74E41C00A598C9 /* PreferencesPanelStandard_UI.h */, CE97210E1E74E41C00A598C9 /* PreferencesPanelStandard_UI.m */, - CE9721111E74E41D00A598C9 /* ProblemDialog_UI.h */, - CE9721121E74E41D00A598C9 /* ProblemDialog_UI.m */, CE9721151E74E41D00A598C9 /* PyBaseApp.h */, CE9721161E74E41D00A598C9 /* PyBaseApp.m */, CE9721171E74E41D00A598C9 /* PyColumns.h */, @@ -760,6 +773,7 @@ CE7CA6061E76337700874874 /* about.xib in Resources */, CE7CA6071E76337700874874 /* cocoalib.strings in Resources */, CE0559871E762105008EB4F8 /* IgnoreListDialog.xib in Resources */, + CEF094621E94828600CD0BF3 /* ProblemDialog.xib in Resources */, CEF094201E947AF700CD0BF3 /* DetailsPanelPicture.xib in Resources */, CEFC8A261E74F23000965F37 /* dupeguru.icns in Resources */, CE65D0CC1E7781640092126E /* progress.xib in Resources */, @@ -833,7 +847,6 @@ CE6F7E171E74EA26004C0518 /* NSTableViewAdditions.m in Sources */, CE9721471E74E41D00A598C9 /* PreferencesPanelPicture_UI.m in Sources */, CE97215C1E74E41D00A598C9 /* PyTable.m in Sources */, - CE97214A1E74E41D00A598C9 /* ProblemDialog_UI.m in Sources */, CE9721581E74E41D00A598C9 /* PyProgressWindow.m in Sources */, CE6F7DEC1E74E9E4004C0518 /* NSEventAdditions.m in Sources */, CE6F7E161E74EA26004C0518 /* NSIndexPathAdditions.m in Sources */, @@ -1120,6 +1133,29 @@ name = PrioritizeDialog.xib; sourceTree = ""; }; + CEF094601E94828600CD0BF3 /* ProblemDialog.xib */ = { + isa = PBXVariantGroup; + children = ( + CEF094611E94828600CD0BF3 /* Base */, + CEF094641E94829800CD0BF3 /* fr */, + CEF094661E94829900CD0BF3 /* de */, + CEF094681E94829C00CD0BF3 /* cs */, + CEF0946A1E94829E00CD0BF3 /* es */, + CEF0946C1E9482A000CD0BF3 /* el */, + CEF0946E1E9482A100CD0BF3 /* it */, + CEF094701E9482A200CD0BF3 /* nl */, + CEF094721E9482A300CD0BF3 /* pl */, + CEF094741E9482A400CD0BF3 /* ko */, + CEF094761E9482A600CD0BF3 /* hy */, + CEF094781E9482A700CD0BF3 /* pt-BR */, + CEF0947A1E9482A800CD0BF3 /* ru */, + CEF0947C1E9482AA00CD0BF3 /* uk */, + CEF0947E1E9482AB00CD0BF3 /* zh-Hans */, + CEF094801E9482AC00CD0BF3 /* vi */, + ); + name = ProblemDialog.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */