Skip to content
This repository was archived by the owner on Jun 23, 2019. It is now read-only.

Commit ff388fc

Browse files
moyitproJames
authored andcommitted
2.4.2 - Fix menu disabiling and use different solution
to show correction/update status dialog as modal.
1 parent e8853bc commit ff388fc

File tree

6 files changed

+67
-51
lines changed

6 files changed

+67
-51
lines changed

Base.lproj/FixSearchDialog.xib

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16G16b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
@@ -24,16 +24,16 @@
2424
<string>allValues</string>
2525
</declaredKeys>
2626
</arrayController>
27-
<window title="Search" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="DbO-Pz-y0h">
27+
<window title="Search" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="alertPanel" id="DbO-Pz-y0h">
2828
<windowStyleMask key="styleMask" titled="YES"/>
2929
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
30-
<rect key="contentRect" x="131" y="158" width="455" height="377"/>
30+
<rect key="contentRect" x="712" y="522" width="455" height="377"/>
3131
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
3232
<view key="contentView" id="02G-J8-xy0">
3333
<rect key="frame" x="0.0" y="0.0" width="455" height="377"/>
3434
<autoresizingMask key="autoresizingMask"/>
3535
<subviews>
36-
<searchField wantsLayer="YES" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zqr-YP-nbl">
36+
<searchField wantsLayer="YES" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zqr-YP-nbl">
3737
<rect key="frame" x="22" y="340" width="413" height="22"/>
3838
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
3939
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" placeholderString="Search Title" usesSingleLineMode="YES" bezelStyle="round" sendsWholeSearchString="YES" id="cSZ-MM-49Y">
@@ -85,7 +85,7 @@ Gw
8585
<action selector="closesearch:" target="-2" id="mkH-dV-IAr"/>
8686
</connections>
8787
</button>
88-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0cQ-v0-rGj">
88+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0cQ-v0-rGj">
8989
<rect key="frame" x="22" y="157" width="415" height="17"/>
9090
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
9191
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="EOL-fv-9qi">
@@ -110,7 +110,7 @@ IA
110110
<rect key="frame" x="0.0" y="0.0" width="398" height="73"/>
111111
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
112112
<subviews>
113-
<textView ambiguous="YES" editable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" usesFontPanel="YES" findStyle="panel" usesRuler="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" smartInsertDelete="YES" id="iBE-bg-nWF">
113+
<textView ambiguous="YES" editable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" usesRuler="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" smartInsertDelete="YES" id="iBE-bg-nWF">
114114
<rect key="frame" x="0.0" y="0.0" width="398" height="73"/>
115115
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
116116
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -143,7 +143,7 @@ IA
143143
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
144144
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
145145
<tableColumns>
146-
<tableColumn editable="NO" width="257.55078125" minWidth="40" maxWidth="1000" id="bNU-0h-Tw9">
146+
<tableColumn identifier="" editable="NO" width="257.55078125" minWidth="40" maxWidth="1000" id="bNU-0h-Tw9">
147147
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Title">
148148
<font key="font" metaFont="smallSystem"/>
149149
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@@ -159,7 +159,7 @@ IA
159159
<binding destination="VfW-m1-nhU" name="value" keyPath="arrangedObjects.title" id="Agj-LK-PXr"/>
160160
</connections>
161161
</tableColumn>
162-
<tableColumn editable="NO" width="74" minWidth="40" maxWidth="1000" id="KG0-hK-qHl">
162+
<tableColumn identifier="" editable="NO" width="74" minWidth="40" maxWidth="1000" id="KG0-hK-qHl">
163163
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Type">
164164
<font key="font" metaFont="smallSystem"/>
165165
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@@ -179,7 +179,7 @@ IA
179179
</binding>
180180
</connections>
181181
</tableColumn>
182-
<tableColumn editable="NO" width="70" minWidth="10" maxWidth="3.4028234663852886e+38" id="tK4-U2-DdB">
182+
<tableColumn identifier="" editable="NO" width="70" minWidth="10" maxWidth="3.4028234663852886e+38" id="tK4-U2-DdB">
183183
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Episodes">
184184
<font key="font" metaFont="smallSystem"/>
185185
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@@ -211,7 +211,7 @@ IA
211211
<autoresizingMask key="autoresizingMask"/>
212212
</scroller>
213213
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="GqG-4a-mWY">
214-
<rect key="frame" x="-14" y="16" width="15" height="0.0"/>
214+
<rect key="frame" x="-14" y="15" width="15" height="0.0"/>
215215
<autoresizingMask key="autoresizingMask"/>
216216
</scroller>
217217
<tableHeaderView key="headerView" id="u1g-0B-sEm">

Base.lproj/MainMenu.xib

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
</connections>
162162
</arrayController>
163163
<customObject id="540" customClass="SUUpdater"/>
164-
<menu id="543" userLabel="StatusMenu">
164+
<menu autoenablesItems="NO" id="543" userLabel="StatusMenu">
165165
<items>
166166
<menuItem title="About MAL Updater OS X" id="547">
167167
<modifierMask key="keyEquivalentModifierMask"/>
@@ -199,21 +199,21 @@
199199
</connections>
200200
</menuItem>
201201
<menuItem isSeparatorItem="YES" hidden="YES" id="egk-cQ-duZ"/>
202-
<menuItem title="Last Scrobbled:" hidden="YES" enabled="NO" id="53a-L9-dCg">
202+
<menuItem title="Last Scrobbled:" hidden="YES" enabled="NO" identifier="lastscrobbled" id="53a-L9-dCg">
203203
<modifierMask key="keyEquivalentModifierMask"/>
204204
</menuItem>
205-
<menuItem title="Show Title" hidden="YES" enabled="NO" indentationLevel="1" id="XZU-Ti-Qvg">
205+
<menuItem title="Show Title" hidden="YES" enabled="NO" identifier="showtitle" indentationLevel="1" id="XZU-Ti-Qvg">
206206
<modifierMask key="keyEquivalentModifierMask"/>
207207
</menuItem>
208-
<menuItem title="Episode" hidden="YES" enabled="NO" indentationLevel="1" id="tL9-L5-eca">
208+
<menuItem title="Episode" hidden="YES" enabled="NO" identifier="episode" indentationLevel="1" id="tL9-L5-eca">
209209
<modifierMask key="keyEquivalentModifierMask"/>
210210
</menuItem>
211211
<menuItem isSeparatorItem="YES" hidden="YES" id="ZEo-hm-rcH">
212212
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
213213
</menuItem>
214214
<menuItem title="Update/Correct" hidden="YES" id="xQ0-Wd-k7I">
215215
<modifierMask key="keyEquivalentModifierMask"/>
216-
<menu key="submenu" title="Update/Correct" id="tvQ-no-ADg">
216+
<menu key="submenu" title="Update/Correct" autoenablesItems="NO" identifier="updatecorrect" id="tvQ-no-ADg">
217217
<items>
218218
<menuItem title="Update Status…" id="jLZ-Sk-Bfm">
219219
<modifierMask key="keyEquivalentModifierMask"/>
@@ -232,7 +232,7 @@
232232
</menuItem>
233233
<menuItem title="Share" hidden="YES" id="4x0-G3-pYv">
234234
<modifierMask key="keyEquivalentModifierMask"/>
235-
<menu key="submenu" title="Share" id="ltR-rE-E7c">
235+
<menu key="submenu" title="Share" identifier="share" id="ltR-rE-E7c">
236236
<items>
237237
<menuItem state="on" image="NSShareTemplate" hidden="YES" id="mLn-eT-r6O"/>
238238
</items>
@@ -400,8 +400,8 @@
400400
<rect key="frame" x="154" y="0.0" width="286" height="190"/>
401401
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
402402
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="ypk-hd-jNn">
403-
<rect key="frame" x="1" y="1" width="284" height="188"/>
404-
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
403+
<rect key="frame" x="1" y="1" width="269" height="188"/>
404+
<autoresizingMask key="autoresizingMask"/>
405405
<subviews>
406406
<textView editable="NO" importsGraphics="NO" verticallyResizable="YES" findStyle="panel" continuousSpellChecking="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" smartInsertDelete="YES" id="bGm-dl-hOF">
407407
<rect key="frame" x="0.0" y="0.0" width="269" height="188"/>

FixSearchDialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
- (id)init;
2626
- (bool)getdeleteTitleonCorrection;
2727
- (bool)getcorrectonce;
28+
- (void)showWindowAsModal:(void (^)(long returnCode))completionHandler;
2829

2930
@end

FixSearchDialog.m

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#import "Utility.h"
1313

1414
@interface FixSearchDialog ()
15-
15+
@property (nonatomic, copy) void (^completionHandler)(long returnCode);
1616
@end
1717

1818
@implementation FixSearchDialog
@@ -55,14 +55,20 @@ - (void)windowDidLoad {
5555
}
5656
}
5757

58+
- (void)showWindowAsModal:(void (^)(long returnCode))completionHandler {
59+
[self.window makeKeyAndOrderFront:self];
60+
[NSApp activateIgnoringOtherApps:YES];
61+
_completionHandler = completionHandler;
62+
}
63+
5864
- (IBAction)closesearch:(id)sender {
5965
//[self.window orderOut:self];
6066
//[NSApp endSheet:self.window returnCode:0];
6167
if (self.window.sheetParent) {
6268
[self.window.sheetParent endSheet:self.window returnCode:NSModalResponseCancel];
6369
}
6470
else {
65-
[NSApp stopModalWithCode:NSModalResponseCancel];
71+
_completionHandler(NSModalResponseCancel);
6672
}
6773
[self.window close];
6874
}
@@ -100,14 +106,13 @@ - (void)finish:(NSDictionary *)d{
100106
// No episode total yet, set to set
101107
selectedtotalepisodes = 0;
102108
}
103-
//[self.window orderOut:self];
104-
// [NSApp endSheet:self.window returnCode:1];
105109
if (self.window.sheetParent) {
106110
[self.window.sheetParent endSheet:self.window returnCode:NSModalResponseOK];
107111
}
108112
else {
109-
[NSApp stopModalWithCode:NSModalResponseOK];
113+
_completionHandler(NSModalResponseOK);
110114
}
115+
[self.window close];
111116
}
112117

113118
- (IBAction)search:(id)sender{

0 commit comments

Comments
 (0)