diff --git a/cocoa/base/DetailsPanel.h b/cocoa/base/DetailsPanel.h
index 50bcef87..cd7858a3 100644
--- a/cocoa/base/DetailsPanel.h
+++ b/cocoa/base/DetailsPanel.h
@@ -18,6 +18,7 @@ http://www.hardcoded.net/licenses/bsd_license
- (id)initWithPy:(PyApp *)aPy;
- (PyDetailsPanel *)py;
+- (BOOL)isVisible;
- (void)toggleVisibility;
/* Python --> Cocoa */
diff --git a/cocoa/base/DetailsPanel.m b/cocoa/base/DetailsPanel.m
index 95cbbecb..dfb8388d 100644
--- a/cocoa/base/DetailsPanel.m
+++ b/cocoa/base/DetailsPanel.m
@@ -34,9 +34,14 @@ http://www.hardcoded.net/licenses/bsd_license
[detailsTable reloadData];
}
+- (BOOL)isVisible
+{
+ return [[self window] isVisible];
+}
+
- (void)toggleVisibility
{
- if ([[self window] isVisible]) {
+ if ([self isVisible]) {
[[self window] close];
}
else {
diff --git a/cocoa/base/ResultWindow.h b/cocoa/base/ResultWindow.h
index 3290f38b..164581a8 100644
--- a/cocoa/base/ResultWindow.h
+++ b/cocoa/base/ResultWindow.h
@@ -18,9 +18,8 @@ http://www.hardcoded.net/licenses/bsd_license
@protected
IBOutlet PyDupeGuruBase *py;
IBOutlet id app;
- IBOutlet NSSegmentedControl *deltaSwitch;
+ IBOutlet NSSegmentedControl *optionsSwitch;
IBOutlet HSTableView *matches;
- IBOutlet NSSegmentedControl *pmSwitch;
IBOutlet NSTextField *stats;
IBOutlet NSMenu *columnsMenu;
IBOutlet NSSearchField *filterField;
@@ -42,8 +41,7 @@ http://www.hardcoded.net/licenses/bsd_license
/* Actions */
- (IBAction)clearIgnoreList:(id)sender;
-- (IBAction)changeDelta:(id)sender;
-- (IBAction)changePowerMarker:(id)sender;
+- (IBAction)changeOptions:(id)sender;
- (IBAction)copyMarked:(id)sender;
- (IBAction)deleteMarked:(id)sender;
- (IBAction)hardlinkMarked:(id)sender;
diff --git a/cocoa/base/ResultWindow.m b/cocoa/base/ResultWindow.m
index cdd40666..a071fb13 100644
--- a/cocoa/base/ResultWindow.m
+++ b/cocoa/base/ResultWindow.m
@@ -25,8 +25,6 @@ http://www.hardcoded.net/licenses/bsd_license
problemDialog = [[ProblemDialog alloc] initWithPy:py];
[self initResultColumns];
[self fillColumnsMenu];
- [deltaSwitch setSelectedSegment:0];
- [pmSwitch setSelectedSegment:0];
[matches setTarget:self];
[matches setDoubleAction:@selector(openClicked:)];
@@ -147,6 +145,13 @@ http://www.hardcoded.net/licenses/bsd_license
}
}
+- (void)updateOptionSegments
+{
+ [optionsSwitch setSelected:[[(AppDelegateBase *)app detailsPanel] isVisible] forSegment:0];
+ [optionsSwitch setSelected:[table powerMarkerMode] forSegment:1];
+ [optionsSwitch setSelected:[table deltaValuesMode] forSegment:2];
+}
+
/* Actions */
- (IBAction)clearIgnoreList:(id)sender
{
@@ -158,14 +163,18 @@ http://www.hardcoded.net/licenses/bsd_license
[py clearIgnoreList];
}
-- (IBAction)changeDelta:(id)sender
+- (IBAction)changeOptions:(id)sender
{
- [table setDeltaValuesMode:[deltaSwitch selectedSegment] == 1];
-}
-
-- (IBAction)changePowerMarker:(id)sender
-{
- [table setPowerMarkerMode:[pmSwitch selectedSegment] == 1];
+ NSInteger seg = [optionsSwitch selectedSegment];
+ if (seg == 0) {
+ [self toggleDetailsPanel:sender];
+ }
+ else if (seg == 1) {
+ [self togglePowerMarker:sender];
+ }
+ else if (seg == 2) {
+ [self toggleDelta:sender];
+ }
}
- (IBAction)copyMarked:(id)sender
@@ -380,27 +389,22 @@ http://www.hardcoded.net/licenses/bsd_license
}
}
-- (IBAction)toggleDelta:(id)sender
-{
- if ([deltaSwitch selectedSegment] == 1)
- [deltaSwitch setSelectedSegment:0];
- else
- [deltaSwitch setSelectedSegment:1];
- [self changeDelta:sender];
-}
-
- (IBAction)toggleDetailsPanel:(id)sender
{
[[(AppDelegateBase *)app detailsPanel] toggleVisibility];
+ [self updateOptionSegments];
+}
+
+- (IBAction)toggleDelta:(id)sender
+{
+ [table setDeltaValuesMode:![table deltaValuesMode]];
+ [self updateOptionSegments];
}
- (IBAction)togglePowerMarker:(id)sender
{
- if ([pmSwitch selectedSegment] == 1)
- [pmSwitch setSelectedSegment:0];
- else
- [pmSwitch setSelectedSegment:1];
- [self changePowerMarker:sender];
+ [table setPowerMarkerMode:![table powerMarkerMode]];
+ [self updateOptionSegments];
}
/* Notifications */
diff --git a/cocoa/base/xib/MainMenu.xib b/cocoa/base/xib/MainMenu.xib
index b6a97463..6a292305 100644
--- a/cocoa/base/xib/MainMenu.xib
+++ b/cocoa/base/xib/MainMenu.xib
@@ -50,76 +50,24 @@
YES
YES
YES
- 1
+ 2
1
@@ -4088,8 +3961,7 @@
YES
YES
- changeDelta:
- changePowerMarker:
+ changeOptions:
clearIgnoreList:
copyMarked:
deleteMarked:
@@ -4152,15 +4024,13 @@
id
id
id
- id
YES
YES
- changeDelta:
- changePowerMarker:
+ changeOptions:
clearIgnoreList:
copyMarked:
deleteMarked:
@@ -4194,11 +4064,7 @@
YES
- changeDelta:
- id
-
-
- changePowerMarker:
+ changeOptions:
id
@@ -4325,10 +4191,9 @@
YES
app
columnsMenu
- deltaSwitch
filterField
matches
- pmSwitch
+ optionsSwitch
py
stats
@@ -4336,7 +4201,6 @@
YES
id
NSMenu
- NSSegmentedControl
NSSearchField
HSTableView
NSSegmentedControl
@@ -4350,10 +4214,9 @@
YES
app
columnsMenu
- deltaSwitch
filterField
matches
- pmSwitch
+ optionsSwitch
py
stats
@@ -4367,10 +4230,6 @@
columnsMenu
NSMenu
-
- deltaSwitch
- NSSegmentedControl
-
filterField
NSSearchField
@@ -4380,7 +4239,7 @@
HSTableView
- pmSwitch
+ optionsSwitch
NSSegmentedControl
@@ -5046,7 +4905,6 @@
NSMenuCheckmark
NSMenuMixedState
NSSwitch
- details32
folder32
preferences32
@@ -5057,7 +4915,6 @@
{9, 8}
{7, 2}
{15, 15}
- {48, 48}
{32, 32}
{32, 32}
diff --git a/cocoa/se/dupeguru.xcodeproj/project.pbxproj b/cocoa/se/dupeguru.xcodeproj/project.pbxproj
index d943bcda..fe32070c 100644
--- a/cocoa/se/dupeguru.xcodeproj/project.pbxproj
+++ b/cocoa/se/dupeguru.xcodeproj/project.pbxproj
@@ -44,7 +44,6 @@
CEEFC0F810945D9F001F3A39 /* DirectoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEEFC0F710945D9F001F3A39 /* DirectoryPanel.xib */; };
CEEFC0FB10945E37001F3A39 /* DetailsPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEEFC0FA10945E37001F3A39 /* DetailsPanel.xib */; };
CEFC294609C89E3D00D9F998 /* folder32.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFC294509C89E3D00D9F998 /* folder32.png */; };
- CEFC295509C89FF200D9F998 /* details32.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFC295309C89FF200D9F998 /* details32.png */; };
CEFC295609C89FF200D9F998 /* preferences32.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFC295409C89FF200D9F998 /* preferences32.png */; };
CEFC7F9E0FC9517500CD5728 /* Dialogs.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F8B0FC9517500CD5728 /* Dialogs.m */; };
CEFC7F9F0FC9517500CD5728 /* HSErrorReportWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F8D0FC9517500CD5728 /* HSErrorReportWindow.m */; };
@@ -139,7 +138,6 @@
CEEFC0F710945D9F001F3A39 /* DirectoryPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = DirectoryPanel.xib; path = ../base/xib/DirectoryPanel.xib; sourceTree = ""; };
CEEFC0FA10945E37001F3A39 /* DetailsPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = DetailsPanel.xib; path = ../base/xib/DetailsPanel.xib; sourceTree = ""; };
CEFC294509C89E3D00D9F998 /* folder32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = folder32.png; path = ../../images/folder32.png; sourceTree = SOURCE_ROOT; };
- CEFC295309C89FF200D9F998 /* details32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = details32.png; path = ../../images/details32.png; sourceTree = SOURCE_ROOT; };
CEFC295409C89FF200D9F998 /* preferences32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = preferences32.png; path = ../../images/preferences32.png; sourceTree = SOURCE_ROOT; };
CEFC7F8A0FC9517500CD5728 /* Dialogs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Dialogs.h; path = ../../cocoalib/Dialogs.h; sourceTree = SOURCE_ROOT; };
CEFC7F8B0FC9517500CD5728 /* Dialogs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Dialogs.m; path = ../../cocoalib/Dialogs.m; sourceTree = SOURCE_ROOT; };
@@ -333,7 +331,6 @@
CEFC294309C89E0000D9F998 /* images */ = {
isa = PBXGroup;
children = (
- CEFC295309C89FF200D9F998 /* details32.png */,
CEFC295409C89FF200D9F998 /* preferences32.png */,
CEFC294509C89E3D00D9F998 /* folder32.png */,
);
@@ -461,7 +458,6 @@
CE073F6309CAE1A3005C1D2F /* help in Resources */,
CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */,
CEFC294609C89E3D00D9F998 /* folder32.png in Resources */,
- CEFC295509C89FF200D9F998 /* details32.png in Resources */,
CEFC295609C89FF200D9F998 /* preferences32.png in Resources */,
CE6E0DFE1054E9EF008D9390 /* dsa_pub.pem in Resources */,
CEEFC0F810945D9F001F3A39 /* DirectoryPanel.xib in Resources */,