|
@@ -30,7 +30,7 @@
|
30
|
30
|
|
31
|
31
|
@implementation AppDelegate
|
32
|
32
|
|
33
|
|
-@synthesize statusMenu, statusItem, statusImage, statusHighlightImage, prefWindow, currentState, application, api, firstMenuItem, menuItems, redditItems;
|
|
33
|
+@synthesize statusMenu, statusItem, statusImage, statusHighlightImage, prefWindow, currentState, application, api, firstMenuItem, menuItems, redditItems, lastFullName;
|
34
|
34
|
|
35
|
35
|
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
36
|
36
|
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
|
|
@@ -42,6 +42,7 @@
|
42
|
42
|
[statusItem setMenu:statusMenu];
|
43
|
43
|
[statusItem setToolTip:NSLocalizedString(@"RedditBar", @"Main Menuitem Tooltip")];
|
44
|
44
|
[statusItem setHighlightMode:YES];
|
|
45
|
+ lastFullName = nil;
|
45
|
46
|
currentState = [[StateModel alloc] init];
|
46
|
47
|
[self defaultPreferences];
|
47
|
48
|
[self loadPreferences];
|
|
@@ -90,6 +91,8 @@
|
90
|
91
|
[firstMenuItem setHidden:NO];
|
91
|
92
|
return;
|
92
|
93
|
}
|
|
94
|
+ lastFullName = [items objectAtIndex:[items count] - 1]; // last link fullname is at end of array
|
|
95
|
+ items = [items subarrayWithRange:NSMakeRange(0, [items count] - 1)]; // Remove last item
|
93
|
96
|
redditItems = items;
|
94
|
97
|
[self clearMenuItems];
|
95
|
98
|
[firstMenuItem setHidden:YES];
|
|
@@ -103,6 +106,8 @@
|
103
|
106
|
[firstMenuItem setHidden:NO];
|
104
|
107
|
return;
|
105
|
108
|
}
|
|
109
|
+ lastFullName = [items objectAtIndex:[items count] - 1]; // last link fullname is at end of array
|
|
110
|
+ items = [items subarrayWithRange:NSMakeRange(0, [items count] - 1)]; // Remove last item
|
106
|
111
|
redditItems = items;
|
107
|
112
|
[self clearMenuItems];
|
108
|
113
|
[firstMenuItem setHidden:YES];
|
|
@@ -135,6 +140,7 @@
|
135
|
140
|
[firstMenuItem setTitle:NSLocalizedString(@"Loading...", @"Statusitem when user clicks reload")];
|
136
|
141
|
[self clearMenuItems];
|
137
|
142
|
[firstMenuItem setHidden:NO];
|
|
143
|
+ lastFullName = nil; // reload from start
|
138
|
144
|
[self reloadListWithOptions];
|
139
|
145
|
}
|
140
|
146
|
|
|
@@ -142,9 +148,7 @@
|
142
|
148
|
[firstMenuItem setTitle:NSLocalizedString(@"Loading...", nil)];
|
143
|
149
|
[self clearMenuItems];
|
144
|
150
|
[firstMenuItem setHidden:NO];
|
145
|
|
-
|
146
|
|
- // TODO on list load, store after cookie??
|
147
|
|
- // then use it here to load the list after the last item
|
|
151
|
+ [self reloadListWithOptions];
|
148
|
152
|
}
|
149
|
153
|
|
150
|
154
|
-(IBAction)linkToOpen:(id)sender {
|