diff options
author | Michael Rog <michael@michaelrog.com> | 2017-08-07 17:37:29 -0500 |
---|---|---|
committer | Michael Rog <michael@michaelrog.com> | 2017-08-07 17:41:43 -0500 |
commit | 0164dba459c2cceed12519a2ce96c7aaf2dac3b4 (patch) | |
tree | cfd6e55b4954d2fb495133b5d3a745d9e63db211 /Source | |
parent | e3f897092127c9459c84a979455035c0e3840fec (diff) | |
download | sequelpro-0164dba459c2cceed12519a2ce96c7aaf2dac3b4.tar.gz sequelpro-0164dba459c2cceed12519a2ce96c7aaf2dac3b4.tar.bz2 sequelpro-0164dba459c2cceed12519a2ce96c7aaf2dac3b4.zip |
Add a 24-hour-format export filename token.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPConstants.h | 1 | ||||
-rw-r--r-- | Source/SPConstants.m | 19 | ||||
-rw-r--r-- | Source/SPExportController.m | 19 | ||||
-rw-r--r-- | Source/SPExportFilenameUtilities.m | 4 |
4 files changed, 25 insertions, 18 deletions
diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 1419ec9a..969d709f 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -414,6 +414,7 @@ extern NSString *SPFileNameYearTokenName; extern NSString *SPFileNameMonthTokenName; extern NSString *SPFileNameDayTokenName; extern NSString *SPFileNameTimeTokenName; +extern NSString *SPFileName24HourTimeTokenName; extern NSString *SPFileNameFavoriteTokenName; extern NSString *SPFileNameTableTokenName; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index 7ae37df3..aba9b83e 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -206,15 +206,16 @@ NSString *SPImportClipboardTempFileNamePrefix = @"/tmp/_SP_ClipBoard_Import_F NSString *SPLastExportSettings = @"LastExportSettings"; // Export filename tokens -NSString *SPFileNameDatabaseTokenName = @"database"; -NSString *SPFileNameHostTokenName = @"host"; -NSString *SPFileNameDateTokenName = @"date"; -NSString *SPFileNameYearTokenName = @"year"; -NSString *SPFileNameMonthTokenName = @"month"; -NSString *SPFileNameDayTokenName = @"day"; -NSString *SPFileNameTimeTokenName = @"time"; -NSString *SPFileNameFavoriteTokenName = @"favorite"; -NSString *SPFileNameTableTokenName = @"table"; +NSString *SPFileNameDatabaseTokenName = @"database"; +NSString *SPFileNameHostTokenName = @"host"; +NSString *SPFileNameDateTokenName = @"date"; +NSString *SPFileNameYearTokenName = @"year"; +NSString *SPFileNameMonthTokenName = @"month"; +NSString *SPFileNameDayTokenName = @"day"; +NSString *SPFileNameTimeTokenName = @"time"; +NSString *SPFileName24HourTimeTokenName = @"time24"; +NSString *SPFileNameFavoriteTokenName = @"favorite"; +NSString *SPFileNameTableTokenName = @"table"; // Misc NSString *SPContentFilters = @"ContentFilters"; diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 0cccabb5..28e29dac 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -125,15 +125,16 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; prefs = [NSUserDefaults standardUserDefaults]; localizedTokenNames = [@{ - SPFileNameHostTokenName: NSLocalizedString(@"Host", @"export filename host token"), - SPFileNameDatabaseTokenName: NSLocalizedString(@"Database", @"export filename database token"), - SPFileNameTableTokenName: NSLocalizedString(@"Table", @"table"), - SPFileNameDateTokenName: NSLocalizedString(@"Date", @"export filename date token"), - SPFileNameYearTokenName: NSLocalizedString(@"Year", @"export filename date token"), - SPFileNameMonthTokenName: NSLocalizedString(@"Month", @"export filename date token"), - SPFileNameDayTokenName: NSLocalizedString(@"Day", @"export filename date token"), - SPFileNameTimeTokenName: NSLocalizedString(@"Time", @"export filename time token"), - SPFileNameFavoriteTokenName: NSLocalizedString(@"Favorite", @"export filename favorite name token") + SPFileNameHostTokenName: NSLocalizedString(@"Host", @"export filename host token"), + SPFileNameDatabaseTokenName: NSLocalizedString(@"Database", @"export filename database token"), + SPFileNameTableTokenName: NSLocalizedString(@"Table", @"table"), + SPFileNameDateTokenName: NSLocalizedString(@"Date", @"export filename date token"), + SPFileNameYearTokenName: NSLocalizedString(@"Year", @"export filename date token"), + SPFileNameMonthTokenName: NSLocalizedString(@"Month", @"export filename date token"), + SPFileNameDayTokenName: NSLocalizedString(@"Day", @"export filename date token"), + SPFileNameTimeTokenName: NSLocalizedString(@"Time", @"export filename time token"), + SPFileName24HourTimeTokenName: NSLocalizedString(@"24-Hour Time", @"export filename time token"), + SPFileNameFavoriteTokenName: NSLocalizedString(@"Favorite", @"export filename favorite name token") } retain]; } diff --git a/Source/SPExportFilenameUtilities.m b/Source/SPExportFilenameUtilities.m index 69b8f786..17e01e73 100644 --- a/Source/SPExportFilenameUtilities.m +++ b/Source/SPExportFilenameUtilities.m @@ -126,6 +126,7 @@ [SPExportFileNameTokenObject tokenWithId:SPFileNameMonthTokenName], [SPExportFileNameTokenObject tokenWithId:SPFileNameDayTokenName], [SPExportFileNameTokenObject tokenWithId:SPFileNameTimeTokenName], + [SPExportFileNameTokenObject tokenWithId:SPFileName24HourTimeTokenName], [SPExportFileNameTokenObject tokenWithId:SPFileNameFavoriteTokenName], (tableObject = [SPExportFileNameTokenObject tokenWithId:SPFileNameTableTokenName]), nil @@ -296,6 +297,9 @@ [dateFormatter setTimeStyle:NSDateFormatterShortStyle]; [string appendString:[dateFormatter stringFromDate:[NSDate date]]]; } + else if ([tokenContent isEqualToString:SPFileName24HourTimeTokenName]) { + [string appendString:[[NSDate date] descriptionWithCalendarFormat:@"%H:%M:%S" timeZone:nil locale:nil]]; + } else if ([tokenContent isEqualToString:SPFileNameFavoriteTokenName]) { [string appendStringOrNil:[tableDocumentInstance name]]; } |