Revision: 29562
http://sourceforge.net/p/bibdesk/svn/29562
Author: hofman
Date: 2025-09-08 22:36:50 +0000 (Mon, 08 Sep 2025)
Log Message:
-----------
Add date to downloads table, display only time for today
Modified Paths:
--------------
trunk/bibdesk/BDSKDownloadManager.h
trunk/bibdesk/BDSKDownloadManager.m
trunk/bibdesk/en.lproj/WebGroupDownloads.html
Modified: trunk/bibdesk/BDSKDownloadManager.h
===================================================================
--- trunk/bibdesk/BDSKDownloadManager.h 2025-09-08 16:38:32 UTC (rev 29561)
+++ trunk/bibdesk/BDSKDownloadManager.h 2025-09-08 22:36:50 UTC (rev 29562)
@@ -85,6 +85,7 @@
NSString *suggestedFilename;
BDSKDownloadStatus status;
id download;
+ NSDate *date;
}
- (instancetype)initWithDownload:(id)aDownload URL:(NSURL *)aURL;
@@ -97,6 +98,7 @@
@property (nonatomic, nullable, strong) NSURL *tempFileURL;
@property (nonatomic, nullable, strong) NSString *suggestedFilename;
@property (nonatomic) BDSKDownloadStatus status;
+@property (nonatomic, nullable, readonly) NSString *dateDescription;
@end
Modified: trunk/bibdesk/BDSKDownloadManager.m
===================================================================
--- trunk/bibdesk/BDSKDownloadManager.m 2025-09-08 16:38:32 UTC (rev 29561)
+++ trunk/bibdesk/BDSKDownloadManager.m 2025-09-08 22:36:50 UTC (rev 29562)
@@ -42,6 +42,7 @@
#import "BDSKStringConstants.h"
#import "NSURL_BDSKExtensions.h"
#import "NSFileManager_BDSKExtensions.h"
+#import "NSDate_BDSKExtensions.h"
#define BDSKRemoveFinishedDownloadsKey @"BDSKRemoveFinishedDownloads"
#define BDSKRemoveFailedDownloadsKey @"BDSKRemoveFailedDownloads"
@@ -289,7 +290,7 @@
@implementation BDSKWebDownload
@synthesize download, uniqueID, URL, fileURL, tempFileURL, status,
suggestedFilename;
-@dynamic fileName;
+@dynamic fileName, dateDescription;
- (instancetype)initWithDownload:(id)aDownload URL:(NSURL *)aURL {
self = [super init];
@@ -301,6 +302,7 @@
status = BDSKDownloadStatusDownloading;
download = aDownload;
suggestedFilename = nil;
+ date = [NSDate date];
}
return self;
}
@@ -321,6 +323,13 @@
return fileName;
}
+- (NSString *)dateDescription {
+ if ([[NSCalendar currentCalendar] isDateInToday:date])
+ return [date shortTimeDescription];
+ else
+ return [NSString stringWithFormat:@"%@ %@", [date
shortDateDescription], [date shortTimeDescription]];
+}
+
- (void)setStatus:(BDSKDownloadStatus)newStatus {
if (status != newStatus) {
status = newStatus;
Modified: trunk/bibdesk/en.lproj/WebGroupDownloads.html
===================================================================
--- trunk/bibdesk/en.lproj/WebGroupDownloads.html 2025-09-08 16:38:32 UTC
(rev 29561)
+++ trunk/bibdesk/en.lproj/WebGroupDownloads.html 2025-09-08 22:36:50 UTC
(rev 29562)
@@ -57,6 +57,7 @@
<span class="status">
<!-- Localize text -->
<$status=0?>Downloading<?$status=1?>Finished<?$status=2?>Failed</$status?>
+ — <$dateDescription/>
</span>
</td>
<td>
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit