Selaa lähdekoodia

Missing translations. Prepared for remove & reload implementation.

Thomas Buck 10 vuotta sitten
vanhempi
commit
3d8c4656bd
3 muutettua tiedostoa jossa 33 lisäystä ja 20 poistoa
  1. 30
    17
      RedditBar/AppDelegate.m
  2. 1
    1
      RedditBar/RedditBar-Info.plist
  3. 2
    2
      RedditBar/de.lproj/Prefs.strings

+ 30
- 17
RedditBar/AppDelegate.m Näytä tiedosto

@@ -144,25 +144,40 @@
144 144
     [self reloadListWithOptions];
145 145
 }
146 146
 
147
--(IBAction)linkToOpen:(id)sender {
148
-    NSString *title = [(NSMenuItem *)sender title];
149
-    if ([title isEqualToString:NSLocalizedString(@"Link...", nil)]) {
150
-        for (NSUInteger i = 0; i < [menuItems count]; i++) {
151
-            NSMenuItem *item = [menuItems objectAtIndex:i];
152
-            NSMenu *submenu = item.submenu;
153
-            if ((submenu != nil) && (sender == [submenu itemAtIndex:0])) {
154
-                RedditItem *rItem = [redditItems objectAtIndex:i];
155
-                [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[rItem link]]];
156
-                break;
147
+-(void)openAndRemoveAndReloadWithIndex:(NSInteger)index Comments:(Boolean)comments {
148
+    RedditItem *rItem = [redditItems objectAtIndex:index];
149
+    NSString *url;
150
+    if (comments)
151
+        url = [rItem comments];
152
+    else
153
+        url = [rItem link];
154
+    [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
155
+    
156
+    if (currentState.removeVisited) {
157
+        // TODO remove selfpost, remove submenu if link & comments visited
158
+        //[statusMenu removeItem:[menuItems objectAtIndex:i]];
159
+        
160
+        Boolean removed = TRUE;
161
+        Boolean listNowEmpty = TRUE;
162
+        
163
+        if (removed && listNowEmpty) {
164
+            [self reloadNextList:nil];
165
+        } else {
166
+            if (removed && currentState.reloadAfterVisit) {
167
+                // TODO load one more item!
157 168
             }
158 169
         }
159
-    } else if ([title isEqualToString:NSLocalizedString(@"Comments...", nil)]) {
170
+    }
171
+}
172
+
173
+-(IBAction)linkToOpen:(id)sender {
174
+    NSString *title = [(NSMenuItem *)sender title];
175
+    if ([title isEqualToString:NSLocalizedString(@"Link...", nil)] || [title isEqualToString:NSLocalizedString(@"Comments...", nil)]) {
160 176
         for (NSUInteger i = 0; i < [menuItems count]; i++) {
161 177
             NSMenuItem *item = [menuItems objectAtIndex:i];
162 178
             NSMenu *submenu = item.submenu;
163
-            if ((submenu != nil) && (sender == [submenu itemAtIndex:1])) {
164
-                RedditItem *rItem = [redditItems objectAtIndex:i];
165
-                [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[rItem comments]]];
179
+            if ((submenu != nil) && (sender == [submenu itemAtIndex:([title isEqualToString:NSLocalizedString(@"Link...", nil)] ? 0 : 1)])) {
180
+                [self openAndRemoveAndReloadWithIndex:i Comments:[title isEqualToString:NSLocalizedString(@"Comments...", nil)]];
166 181
                 break;
167 182
             }
168 183
         }
@@ -170,9 +185,7 @@
170 185
         for (NSUInteger i = 0; i < [menuItems count]; i++) {
171 186
             NSMenuItem *item = [menuItems objectAtIndex:i];
172 187
             if (sender == item) {
173
-                RedditItem *rItem = [redditItems objectAtIndex:i];
174
-                [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[rItem link]]];
175
-                [statusMenu removeItem:[menuItems objectAtIndex:i]];
188
+                [self openAndRemoveAndReloadWithIndex:i Comments:FALSE];
176 189
                 break;
177 190
             }
178 191
         }

+ 1
- 1
RedditBar/RedditBar-Info.plist Näytä tiedosto

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

+ 2
- 2
RedditBar/de.lproj/Prefs.strings Näytä tiedosto

@@ -8,7 +8,7 @@
8 8
 "32T-3T-EcY.title" = "Ausschneiden";
9 9
 
10 10
 /* Class = "NSButtonCell"; title = "Remove visited links"; ObjectID = "7KI-oO-Qcg"; */
11
-"7KI-oO-Qcg.title" = "Remove visited links";
11
+"7KI-oO-Qcg.title" = "Entferne besuchte Links";
12 12
 
13 13
 /* Class = "NSTextFieldCell"; title = "Items:"; ObjectID = "FNJ-RL-DXT"; */
14 14
 "FNJ-RL-DXT.title" = "Links:";
@@ -74,7 +74,7 @@
74 74
 "sKV-FZ-wbQ.title" = "hot";
75 75
 
76 76
 /* Class = "NSButtonCell"; title = "Reload after every visited link"; ObjectID = "twM-Jr-KGn"; */
77
-"twM-Jr-KGn.title" = "Reload after every visited link";
77
+"twM-Jr-KGn.title" = "Nach jedem besuchten Link nachladen";
78 78
 
79 79
 /* Class = "NSMenuItem"; title = "Copy"; ObjectID = "wSY-To-FDI"; */
80 80
 "wSY-To-FDI.title" = "Kopieren";

Loading…
Peruuta
Tallenna