Revision: 14700
http://sourceforge.net/p/skim-app/code/14700
Author: hofman
Date: 2024-11-16 10:05:48 +0000 (Sat, 16 Nov 2024)
Log Message:
-----------
Always select added download in table. No need to return whether download was
added.
Modified Paths:
--------------
trunk/SKDownloadController.h
trunk/SKDownloadController.m
Modified: trunk/SKDownloadController.h
===================================================================
--- trunk/SKDownloadController.h 2024-11-15 23:33:49 UTC (rev 14699)
+++ trunk/SKDownloadController.h 2024-11-16 10:05:48 UTC (rev 14700)
@@ -60,7 +60,7 @@
@property (nonatomic, nullable, strong) IBOutlet SKTableView *tableView;
@property (nonatomic, nullable, strong) IBOutlet NSButton *clearButton;
-- (BOOL)addDownloadForURL:(nullable NSURL *)aURL;
+- (void)addDownloadForURL:(nullable NSURL *)aURL;
- (IBAction)showDownloadPreferences:(nullable id)sender;
- (IBAction)clearDownloads:(nullable id)sender;
Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m 2024-11-15 23:33:49 UTC (rev 14699)
+++ trunk/SKDownloadController.m 2024-11-16 10:05:48 UTC (rev 14700)
@@ -159,21 +159,16 @@
[tbClearButton setEnabled:[[self downloads]
valueForKeyPath:@"@max.canRemove"]];
}
-- (BOOL)addDownloadForURL:(NSURL *)aURL showWindow:(BOOL)flag {
+- (void)addDownloadForURL:(NSURL *)aURL showWindow:(BOOL)flag {
if (aURL) {
SKDownload *download = [[SKDownload alloc] initWithURL:aURL];
- NSInteger row = [self countOfDownloads];
[self addObjectToDownloads:download];
if (flag)
[self showWindow:nil];
- [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row]
byExtendingSelection:NO];
- [tableView scrollRowToVisible:row];
- return YES;
}
- return NO;
}
-- (BOOL)addDownloadForURL:(NSURL *)aURL {
+- (void)addDownloadForURL:(NSURL *)aURL {
return [self addDownloadForURL:aURL showWindow:[[NSUserDefaults
standardUserDefaults] boolForKey:SKAutoOpenDownloadsWindowKey]];
}
@@ -258,7 +253,11 @@
#pragma mark Adding/Removing Downloads
- (void)addObjectToDownloads:(SKDownload *)download {
- [self insertObject:download inDownloadsAtIndex:[self countOfDownloads]];
+ NSInteger row = [self countOfDownloads];
+ [self insertObject:download inDownloadsAtIndex:row];
+ [self addObjectToDownloads:download];
+ [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row]
byExtendingSelection:NO];
+ [tableView scrollRowToVisible:row];
}
- (void)removeObjectFromDownloads:(SKDownload *)download {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit