Browse Source

Subclassed NSWindow for PrefWindow to activate it after showing.

Thomas Buck 11 years ago
parent
commit
f2d5bba53f

+ 6
- 0
RedditBar.xcodeproj/project.pbxproj View File

@@ -24,6 +24,7 @@
24 24
 		E9CF1F49184961020004AE02 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E9CF1F47184961020004AE02 /* InfoPlist.strings */; };
25 25
 		E9CF1F4B184961020004AE02 /* RedditBarTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E9CF1F4A184961020004AE02 /* RedditBarTests.m */; };
26 26
 		E9CF1F5C1849685C0004AE02 /* PrefController.m in Sources */ = {isa = PBXBuildFile; fileRef = E9CF1F5B1849685C0004AE02 /* PrefController.m */; };
27
+		E9F64A2E185E1E2900D6CA16 /* PrefWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E9F64A2D185E1E2900D6CA16 /* PrefWindow.m */; };
27 28
 /* End PBXBuildFile section */
28 29
 
29 30
 /* Begin PBXContainerItemProxy section */
@@ -75,6 +76,8 @@
75 76
 		E9CF1F5A1849685C0004AE02 /* PrefController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefController.h; sourceTree = "<group>"; };
76 77
 		E9CF1F5B1849685C0004AE02 /* PrefController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrefController.m; sourceTree = "<group>"; };
77 78
 		E9F64A2B185D51C100D6CA16 /* RedditBar.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = RedditBar.entitlements; sourceTree = "<group>"; };
79
+		E9F64A2C185E1E2900D6CA16 /* PrefWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefWindow.h; sourceTree = "<group>"; };
80
+		E9F64A2D185E1E2900D6CA16 /* PrefWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrefWindow.m; sourceTree = "<group>"; };
78 81
 /* End PBXFileReference section */
79 82
 
80 83
 /* Begin PBXFrameworksBuildPhase section */
@@ -151,6 +154,8 @@
151 154
 				E9341913184A1A1A00D03488 /* StateModel.m */,
152 155
 				E9CF1F5A1849685C0004AE02 /* PrefController.h */,
153 156
 				E9CF1F5B1849685C0004AE02 /* PrefController.m */,
157
+				E9F64A2C185E1E2900D6CA16 /* PrefWindow.h */,
158
+				E9F64A2D185E1E2900D6CA16 /* PrefWindow.m */,
154 159
 				E9CF1F35184961020004AE02 /* MainMenu.xib */,
155 160
 				E9341919184A47DE00D03488 /* Prefs.xib */,
156 161
 				E90E74B2184FAA0F00F38929 /* Localizable.strings */,
@@ -334,6 +339,7 @@
334 339
 				E9A129B1184BD24000F50D1D /* RedditItem.m in Sources */,
335 340
 				E9CF1F2D184961010004AE02 /* main.m in Sources */,
336 341
 				E9CF1F5C1849685C0004AE02 /* PrefController.m in Sources */,
342
+				E9F64A2E185E1E2900D6CA16 /* PrefWindow.m in Sources */,
337 343
 				E9B6773E184B73DC00850559 /* Reddit.m in Sources */,
338 344
 			);
339 345
 			runOnlyForDeploymentPostprocessing = 0;

+ 1
- 0
RedditBar/AppDelegate.m View File

@@ -192,6 +192,7 @@
192 192
     [prefWindow setParent:self];
193 193
     [prefWindow setState:currentState];
194 194
     [prefWindow showWindow:self];
195
+    [[prefWindow window] makeKeyAndOrderFront:self];
195 196
 }
196 197
 
197 198
 -(IBAction)showAbout:(id)sender {

+ 1
- 1
RedditBar/Base.lproj/Prefs.strings View File

@@ -1,5 +1,5 @@
1 1
 
2
-/* Class = "NSWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
2
+/* Class = "PrefWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
3 3
 "1.title" = "RedditBar Preferences";
4 4
 
5 5
 /* Class = "NSTextFieldCell"; title = "10"; ObjectID = "0SD-Tf-uZS"; */

+ 14
- 14
RedditBar/Base.lproj/Prefs.xib View File

@@ -21,17 +21,17 @@
21 21
         </customObject>
22 22
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
23 23
         <customObject id="-3" userLabel="Application"/>
24
-        <window title="RedditBar Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" releasedWhenClosed="NO" wantsToBeColor="NO" animationBehavior="default" id="1">
24
+        <window title="RedditBar Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" releasedWhenClosed="NO" wantsToBeColor="NO" animationBehavior="default" id="1" customClass="PrefWindow">
25 25
             <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
26 26
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
27
-            <rect key="contentRect" x="196" y="240" width="340" height="339"/>
27
+            <rect key="contentRect" x="196" y="240" width="340" height="323"/>
28 28
             <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1058"/>
29 29
             <view key="contentView" id="2">
30
-                <rect key="frame" x="0.0" y="0.0" width="340" height="339"/>
30
+                <rect key="frame" x="0.0" y="0.0" width="340" height="323"/>
31 31
                 <autoresizingMask key="autoresizingMask"/>
32 32
                 <subviews>
33 33
                     <textField verticalHuggingPriority="750" id="0mi-88-o94">
34
-                        <rect key="frame" x="120" y="299" width="200" height="22"/>
34
+                        <rect key="frame" x="120" y="283" width="200" height="22"/>
35 35
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
36 36
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="xlI-hU-MqM">
37 37
                             <font key="font" metaFont="system"/>
@@ -40,7 +40,7 @@
40 40
                         </textFieldCell>
41 41
                     </textField>
42 42
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="f72-fM-yQc">
43
-                        <rect key="frame" x="18" y="304" width="96" height="17"/>
43
+                        <rect key="frame" x="18" y="288" width="96" height="17"/>
44 44
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
45 45
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Username: " id="GTO-OP-MYS">
46 46
                             <font key="font" metaFont="system"/>
@@ -49,7 +49,7 @@
49 49
                         </textFieldCell>
50 50
                     </textField>
51 51
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="JMQ-a6-DKC">
52
-                        <rect key="frame" x="18" y="270" width="96" height="17"/>
52
+                        <rect key="frame" x="18" y="254" width="96" height="17"/>
53 53
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
54 54
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Password:" id="m11-YF-fEa">
55 55
                             <font key="font" metaFont="system"/>
@@ -58,7 +58,7 @@
58 58
                         </textFieldCell>
59 59
                     </textField>
60 60
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="qFP-pd-32c">
61
-                        <rect key="frame" x="18" y="104" width="96" height="17"/>
61
+                        <rect key="frame" x="18" y="88" width="96" height="17"/>
62 62
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
63 63
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Items:" id="FNJ-RL-DXT">
64 64
                             <font key="font" metaFont="system"/>
@@ -67,7 +67,7 @@
67 67
                         </textFieldCell>
68 68
                     </textField>
69 69
                     <secureTextField verticalHuggingPriority="750" id="ARP-lb-J16">
70
-                        <rect key="frame" x="120" y="267" width="200" height="22"/>
70
+                        <rect key="frame" x="120" y="251" width="200" height="22"/>
71 71
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
72 72
                         <secureTextFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="We7-pG-rAt">
73 73
                             <font key="font" metaFont="system"/>
@@ -104,7 +104,7 @@ Gw
104 104
                         </connections>
105 105
                     </button>
106 106
                     <scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="8ew-wY-1Yh">
107
-                        <rect key="frame" x="20" y="129" width="300" height="100"/>
107
+                        <rect key="frame" x="20" y="113" width="300" height="100"/>
108 108
                         <autoresizingMask key="autoresizingMask"/>
109 109
                         <clipView key="contentView" copiesOnScroll="NO" id="ENU-Jw-8fO">
110 110
                             <rect key="frame" x="1" y="1" width="298" height="98"/>
@@ -133,7 +133,7 @@ Gw
133 133
                         </scroller>
134 134
                     </scrollView>
135 135
                     <button id="XZM-90-hQ8">
136
-                        <rect key="frame" x="18" y="236" width="280" height="25"/>
136
+                        <rect key="frame" x="18" y="220" width="280" height="25"/>
137 137
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
138 138
                         <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="vW5-Cp-Bm1">
139 139
                             <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -144,7 +144,7 @@ Gw
144 144
                         </connections>
145 145
                     </button>
146 146
                     <textField verticalHuggingPriority="750" id="MAv-jO-hIv">
147
-                        <rect key="frame" x="120" y="99" width="57" height="22"/>
147
+                        <rect key="frame" x="120" y="83" width="57" height="22"/>
148 148
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
149 149
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" title="10" drawsBackground="YES" id="0SD-Tf-uZS">
150 150
                             <font key="font" metaFont="system"/>
@@ -157,7 +157,7 @@ Gw
157 157
                         </connections>
158 158
                     </textField>
159 159
                     <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="jxz-fQ-M1L">
160
-                        <rect key="frame" x="182" y="96" width="19" height="27"/>
160
+                        <rect key="frame" x="182" y="80" width="19" height="27"/>
161 161
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
162 162
                         <stepperCell key="cell" continuous="YES" alignment="left" maxValue="100" id="Gba-jV-Ouh"/>
163 163
                         <connections>
@@ -165,11 +165,11 @@ Gw
165 165
                         </connections>
166 166
                     </stepper>
167 167
                     <progressIndicator canDrawConcurrently="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" id="vz0-tR-n1f">
168
-                        <rect key="frame" x="304" y="240" width="16" height="16"/>
168
+                        <rect key="frame" x="304" y="224" width="16" height="16"/>
169 169
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
170 170
                     </progressIndicator>
171 171
                     <button id="fRR-M9-szp">
172
-                        <rect key="frame" x="18" y="75" width="304" height="18"/>
172
+                        <rect key="frame" x="18" y="53" width="304" height="18"/>
173 173
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
174 174
                         <buttonCell key="cell" type="check" title="Show Subreddit after Title" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="nFK-xi-2F3">
175 175
                             <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>

+ 13
- 0
RedditBar/PrefWindow.h View File

@@ -0,0 +1,13 @@
1
+//
2
+//  PrefWindow.h
3
+//  RedditBar
4
+//
5
+//  Created by Thomas Buck on 15.12.13.
6
+//  Copyright (c) 2013 xythobuz. All rights reserved.
7
+//
8
+
9
+#import <Cocoa/Cocoa.h>
10
+
11
+@interface PrefWindow : NSWindow
12
+
13
+@end

+ 17
- 0
RedditBar/PrefWindow.m View File

@@ -0,0 +1,17 @@
1
+//
2
+//  PrefWindow.m
3
+//  RedditBar
4
+//
5
+//  Created by Thomas Buck on 15.12.13.
6
+//  Copyright (c) 2013 xythobuz. All rights reserved.
7
+//
8
+
9
+#import "PrefWindow.h"
10
+
11
+@implementation PrefWindow
12
+
13
+-(BOOL)canBecomeKeyWindow {
14
+    return YES;
15
+}
16
+
17
+@end

+ 1
- 1
RedditBar/RedditBar-Info.plist View File

@@ -21,7 +21,7 @@
21 21
 	<key>CFBundleSignature</key>
22 22
 	<string>????</string>
23 23
 	<key>CFBundleVersion</key>
24
-	<string>204</string>
24
+	<string>218</string>
25 25
 	<key>LSApplicationCategoryType</key>
26 26
 	<string>public.app-category.utilities</string>
27 27
 	<key>LSMinimumSystemVersion</key>

+ 1
- 1
RedditBar/de.lproj/Localizable.strings View File

@@ -44,7 +44,7 @@
44 44
 "Use Subreddits list" = "Zeige Subreddit Liste";
45 45
 
46 46
 /* Pref Checkbox State 1 */
47
-"Use Subscriptions" = "Zeige Abbonements";
47
+"Use Subscriptions" = "Zeige Abonnements";
48 48
 
49 49
 /* Pref API Error */
50 50
 "Wrong Username or Password!" = "Falscher Nutzername oder falsches Passwort!";

+ 2
- 2
RedditBar/de.lproj/Prefs.strings View File

@@ -1,4 +1,4 @@
1
-/* Class = "NSWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
1
+/* Class = "PrefWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
2 2
 "1.title" = "RedditBar Einstellungen";
3 3
 
4 4
 /* Class = "NSTextFieldCell"; title = "10"; ObjectID = "0SD-Tf-uZS"; */
@@ -8,7 +8,7 @@
8 8
 "32T-3T-EcY.title" = "Ausschneiden";
9 9
 
10 10
 /* Class = "NSTextFieldCell"; title = "Items:"; ObjectID = "FNJ-RL-DXT"; */
11
-"FNJ-RL-DXT.title" = "Länge:";
11
+"FNJ-RL-DXT.title" = "Links:";
12 12
 
13 13
 /* Class = "NSTextFieldCell"; title = "Username: "; ObjectID = "GTO-OP-MYS"; */
14 14
 "GTO-OP-MYS.title" = "Benutzername: ";

+ 1
- 1
RedditBar/en.lproj/Prefs.strings View File

@@ -1,4 +1,4 @@
1
-/* Class = "NSWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
1
+/* Class = "PrefWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
2 2
 "1.title" = "RedditBar Preferences";
3 3
 
4 4
 /* Class = "NSTextFieldCell"; title = "10"; ObjectID = "0SD-Tf-uZS"; */

+ 1
- 1
RedditBarTests/de.lproj/Prefs.strings View File

@@ -1,4 +1,4 @@
1
-/* Class = "NSWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
1
+/* Class = "PrefWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
2 2
 "1.title" = "RedditBar Preferences";
3 3
 
4 4
 /* Class = "NSTextFieldCell"; title = "10"; ObjectID = "0SD-Tf-uZS"; */

+ 1
- 1
RedditBarTests/en.lproj/Prefs.strings View File

@@ -1,4 +1,4 @@
1
-/* Class = "NSWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
1
+/* Class = "PrefWindow"; title = "RedditBar Preferences"; ObjectID = "1"; */
2 2
 "1.title" = "RedditBar Preferences";
3 3
 
4 4
 /* Class = "NSTextFieldCell"; title = "10"; ObjectID = "0SD-Tf-uZS"; */

Loading…
Cancel
Save