mirror of
https://github.com/ViennaRSS/vienna-rss.git
synced 2026-04-07 19:27:39 +00:00
Merge pull request #1687 from Eitot/feature/constants
Refactor notifications constants and global variables
This commit is contained in:
@@ -136,7 +136,7 @@ static NSUserInterfaceItemIdentifier const VNADisclosureButtonIdentifier = @"Dis
|
||||
[self.credentialsWindow.sheetParent endSheet:self.credentialsWindow];
|
||||
[self.credentialsWindow orderOut:self];
|
||||
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"MA_Notify_GotAuthenticationForFolder"
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:MA_Notify_GotAuthenticationForFolder
|
||||
object:self.folder];
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ static NSUserInterfaceItemIdentifier const VNADisclosureButtonIdentifier = @"Dis
|
||||
[self.credentialsWindow.sheetParent endSheet:self.credentialsWindow];
|
||||
[self.credentialsWindow orderOut:self];
|
||||
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"MA_Notify_CancelAuthenticationForFolder"
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:MA_Notify_CancelAuthenticationForFolder
|
||||
object:self.folder];
|
||||
}
|
||||
|
||||
|
||||
@@ -261,20 +261,20 @@ static void *VNAAppControllerObserverContext = &VNAAppControllerObserverContext;
|
||||
|
||||
// Register a bunch of notifications
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleFolderSelection:) name:@"MA_Notify_FolderSelectionChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleCheckFrequencyChange:) name:@"MA_Notify_CheckFrequencyChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleEditFolder:) name:@"MA_Notify_EditFolder" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleRefreshStatusChange:) name:@"MA_Notify_RefreshStatus" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleTabChange:) name:@"MA_Notify_TabChanged" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleTabCountChange:) name:@"MA_Notify_TabCountChanged" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderNameChange:) name:@"MA_Notify_FolderNameChanged" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderSelection:) name:MA_Notify_FolderSelectionChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleCheckFrequencyChange:) name:MA_Notify_CheckFrequencyChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleEditFolder:) name:MA_Notify_EditFolder object:nil];
|
||||
[nc addObserver:self selector:@selector(handleRefreshStatusChange:) name:MA_Notify_RefreshStatus object:nil];
|
||||
[nc addObserver:self selector:@selector(handleTabChange:) name:MA_Notify_TabChanged object:nil];
|
||||
[nc addObserver:self selector:@selector(handleTabCountChange:) name:MA_Notify_TabCountChanged object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderNameChange:) name:MA_Notify_FolderNameChanged object:nil];
|
||||
[nc addObserver:self selector:@selector(handleDidBecomeKeyWindow:) name:NSWindowDidBecomeKeyNotification object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleShowAppInStatusBar:) name:@"MA_Notify_ShowAppInStatusBarChanged" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleShowFilterBar:) name:@"MA_Notify_FilterBarChanged" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleUpdateUnreadCount:) name:@"MA_Notify_FoldersUpdated" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:MA_Notify_PreferenceChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleShowAppInStatusBar:) name:MA_Notify_ShowAppInStatusBarChanged object:nil];
|
||||
[nc addObserver:self selector:@selector(handleShowFilterBar:) name:MA_Notify_FilterBarChanged object:nil];
|
||||
[nc addObserver:self selector:@selector(handleUpdateUnreadCount:) name:MA_Notify_FoldersUpdated object:nil];
|
||||
//Open Reader Notifications
|
||||
[nc addObserver:self selector:@selector(handleGoogleAuthFailed:) name:@"MA_Notify_GoogleAuthFailed" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleGoogleAuthFailed:) name:MA_Notify_GoogleAuthFailed object:nil];
|
||||
|
||||
// Initialize the database
|
||||
if ((db = [Database sharedManager]) == nil) {
|
||||
@@ -2539,7 +2539,7 @@ withReplyEvent:(NSAppleEventDescriptor *)replyEvent
|
||||
[folder clearFlag:VNAFolderFlagLoadFullHTML];
|
||||
[[Database sharedManager] clearFlag:VNAFolderFlagLoadFullHTML forFolder:folderID];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_LoadFullHTMLChange" object:@(folderID)];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_LoadFullHTMLChange object:@(folderID)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
FMDatabaseQueue *queue = self.databaseQueue;
|
||||
[queue inDatabase:^(FMDatabase *db) {
|
||||
[db executeUpdate:@"UPDATE folders SET flags=? WHERE folder_id=?", @(folder.flags), @(folderId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated" object:@(folderId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated object:@(folderId)];
|
||||
}];
|
||||
}
|
||||
}
|
||||
@@ -577,7 +577,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
FMDatabaseQueue *queue = self.databaseQueue;
|
||||
[queue inDatabase:^(FMDatabase *db) {
|
||||
[db executeUpdate:@"UPDATE folders SET flags=? WHERE folder_id=?", @(folder.flags), @(folderId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated" object:@(folderId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated object:@(folderId)];
|
||||
}];
|
||||
}
|
||||
}
|
||||
@@ -659,7 +659,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
FMDatabaseQueue *queue = self.databaseQueue;
|
||||
[queue inDatabase:^(FMDatabase *db) {
|
||||
[db executeUpdate:@"UPDATE rss_folders SET feed_url=? WHERE folder_id=?", feed_url, @(folderId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated" object:@(folderId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated object:@(folderId)];
|
||||
}];
|
||||
}
|
||||
return YES;
|
||||
@@ -866,7 +866,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
}
|
||||
|
||||
// Send a notification when new folders are added
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FolderAdded" object:folder];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FolderAdded object:folder];
|
||||
}
|
||||
return newItemId;
|
||||
}
|
||||
@@ -1100,7 +1100,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
|
||||
// Send a notification that the folder has changed. It is the responsibility of the
|
||||
// notifiee that they work out that the name is the part that has changed.
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FolderNameChanged" object:@(folderId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FolderNameChanged object:@(folderId)];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -1142,7 +1142,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
|
||||
// Send a notification that the folder has changed. It is the responsibility of the
|
||||
// notifiee that they work out that the description is the part that has changed.
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FolderDescriptionChanged"
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FolderDescriptionChanged
|
||||
object:@(folderId)];
|
||||
return YES;
|
||||
}
|
||||
@@ -1187,7 +1187,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
|
||||
// Send a notification that the folder has changed. It is the responsibility of the
|
||||
// notifiee that they work out that the link is the part that has changed.
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FolderHomePageChanged"
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FolderHomePageChanged
|
||||
object:@(folderId)];
|
||||
return YES;
|
||||
}
|
||||
@@ -1690,7 +1690,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
for (Folder * folder in [self.foldersDict objectEnumerator])
|
||||
[folder clearCache];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated" object:@(self.trashFolderId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated object:@(self.trashFolderId)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1802,7 +1802,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
self.smartfoldersDict[@(folderId)] = criteriaTree;
|
||||
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc vna_postNotificationOnMainThreadWithName:@"MA_Notify_ArticleListContentChange"
|
||||
[nc vna_postNotificationOnMainThreadWithName:MA_Notify_ArticleListContentChange
|
||||
object:@(folderId)];
|
||||
}
|
||||
|
||||
@@ -2355,7 +2355,7 @@ NSNotificationName const VNADatabaseDidDeleteFolderNotification = @"Database Did
|
||||
FMDatabaseQueue *queue = self.databaseQueue;
|
||||
[queue inDatabase:^(FMDatabase *db) {
|
||||
[db executeUpdate:@"UPDATE folders SET unread_count=? WHERE folder_id=?", @(newCount), @(folder.itemId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated" object:@(folder.itemId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated object:@(folder.itemId)];
|
||||
}];
|
||||
|
||||
// Update childUnreadCount for parents.
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
|
||||
#import "Field.h"
|
||||
|
||||
static NSString *const VNACodingKeyDisplayName = @"displayName";
|
||||
static NSString *const VNACodingKeyName = @"name";
|
||||
static NSString *const VNACodingKeySQLField = @"sqlField";
|
||||
static NSString *const VNACodingKeyTag = @"tag";
|
||||
static NSString *const VNACodingKeyType = @"type";
|
||||
static NSString *const VNACodingKeyVisible = @"visible";
|
||||
static NSString *const VNACodingKeyWidth = @"width";
|
||||
static NSString * const VNACodingKeyDisplayName = @"displayName";
|
||||
static NSString * const VNACodingKeyName = @"name";
|
||||
static NSString * const VNACodingKeySQLField = @"sqlField";
|
||||
static NSString * const VNACodingKeyTag = @"tag";
|
||||
static NSString * const VNACodingKeyType = @"type";
|
||||
static NSString * const VNACodingKeyVisible = @"visible";
|
||||
static NSString * const VNACodingKeyWidth = @"width";
|
||||
|
||||
@implementation Field
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
@import UniformTypeIdentifiers;
|
||||
|
||||
static NSString *const VNACodingKeyFilename = @"filename";
|
||||
static NSString *const VNACodingKeySize = @"size";
|
||||
static NSString * const VNACodingKeyFilename = @"filename";
|
||||
static NSString * const VNACodingKeySize = @"size";
|
||||
|
||||
@interface DownloadItem ()
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
// Send a notification that the specified download item has changed.
|
||||
- (void)notifyDownloadItemChange:(DownloadItem *)item {
|
||||
NSNotificationCenter *nc = NSNotificationCenter.defaultCenter;
|
||||
[nc postNotificationName:@"MA_Notify_DownloadsListChange" object:item];
|
||||
[nc postNotificationName:MA_Notify_DownloadsListChange object:item];
|
||||
}
|
||||
|
||||
// Delivers a user notification for the given download item.
|
||||
@@ -274,7 +274,7 @@
|
||||
notification.userInfo = @{UserNotificationContextKey: UserNotificationContextFileDownloadCompleted,
|
||||
UserNotificationFilePathKey: fileName};
|
||||
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"MA_Notify_DownloadCompleted" object:fileName];
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:MA_Notify_DownloadCompleted object:fileName];
|
||||
} else if (item.state == DownloadStateFailed) {
|
||||
notification.title = NSLocalizedString(@"Download failed", @"Notification title");
|
||||
notification.informativeText = [NSString stringWithFormat:NSLocalizedString(@"File %@ failed to download", @"Notification body"), fileName];
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#import "DownloadWindow.h"
|
||||
|
||||
#import "AppController+Notifications.h"
|
||||
#import "Constants.h"
|
||||
#import "DownloadItem.h"
|
||||
#import "DownloadManager.h"
|
||||
#import "HelperFunctions.h"
|
||||
@@ -53,7 +54,7 @@
|
||||
|
||||
// Register to get notified when the download manager's list changes
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleDownloadsChange:) name:@"MA_Notify_DownloadsListChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleDownloadsChange:) name:MA_Notify_DownloadsListChange object:nil];
|
||||
|
||||
// Set the cell for each row
|
||||
ImageAndTextCell * imageAndTextCell;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
@import os.log;
|
||||
|
||||
#import "Constants.h"
|
||||
#import "URLRequestExtensions.h"
|
||||
#import "Folder.h"
|
||||
#import "Database.h"
|
||||
@@ -42,8 +43,8 @@
|
||||
#import "ActivityItem.h"
|
||||
#import "Article.h"
|
||||
|
||||
static NSString *LoginBaseURL = @"%@://%@/accounts/ClientLogin?accountType=GOOGLE&service=reader";
|
||||
static NSString *ClientName = @"ViennaRSS";
|
||||
static NSString * const LoginBaseURL = @"%@://%@/accounts/ClientLogin?accountType=GOOGLE&service=reader";
|
||||
static NSString * const ClientName = @"ViennaRSS";
|
||||
static NSString *latestAlertDescription = @"";
|
||||
|
||||
// host specific variables
|
||||
@@ -192,13 +193,13 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
if (error) {
|
||||
NSString * alertDescription = error.localizedDescription;
|
||||
if (![alertDescription isEqualToString:latestAlertDescription]) {
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_GoogleAuthFailed" object:alertDescription];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_GoogleAuthFailed object:alertDescription];
|
||||
latestAlertDescription = alertDescription;
|
||||
}
|
||||
} else if (((NSHTTPURLResponse *)response).statusCode != 200) {
|
||||
NSString * alertDescription = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||
if (![alertDescription isEqualToString:latestAlertDescription]) {
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_GoogleAuthFailed" object:alertDescription];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_GoogleAuthFailed object:alertDescription];
|
||||
latestAlertDescription = alertDescription;
|
||||
}
|
||||
} else { // statusCode 200
|
||||
@@ -503,7 +504,7 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
[refreshedFolder clearNonPersistedFlag:VNAFolderFlagUpdating];
|
||||
[refreshedFolder setNonPersistedFlag:VNAFolderFlagError];
|
||||
[refreshedFolder clearNonPersistedFlag:VNAFolderFlagSyncedOK]; // get ready for next request
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated
|
||||
object:@(refreshedFolder.itemId)];
|
||||
}
|
||||
|
||||
@@ -682,7 +683,7 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
[refreshedFolder setNonPersistedFlag:VNAFolderFlagError];
|
||||
[refreshedFolder clearNonPersistedFlag:VNAFolderFlagSyncedOK];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated
|
||||
object:@(refreshedFolder.itemId)];
|
||||
}); //block for dispatch_async
|
||||
} // feedRequestDone
|
||||
@@ -729,7 +730,7 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
});
|
||||
[refreshedFolder clearNonPersistedFlag:VNAFolderFlagUpdating];
|
||||
[refreshedFolder setNonPersistedFlag:VNAFolderFlagError];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated" object:@(
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated object:@(
|
||||
refreshedFolder.itemId)];
|
||||
return;
|
||||
} // try/catch
|
||||
@@ -748,7 +749,7 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
[refreshedFolder clearNonPersistedFlag:VNAFolderFlagUpdating];
|
||||
[refreshedFolder setNonPersistedFlag:VNAFolderFlagError];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated
|
||||
object:@(refreshedFolder.itemId)];
|
||||
}); //block for dispatch_async
|
||||
} // readRequestDone
|
||||
@@ -780,7 +781,7 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
[guidArray addObject:guid];
|
||||
[[refreshedFolder articleFromGuid:guid] markFlagged:YES];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_ArticleListContentChange" object:@(
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_ArticleListContentChange object:@(
|
||||
refreshedFolder.itemId)];
|
||||
|
||||
[[Database sharedManager] markStarredArticlesFromFolder:refreshedFolder guidArray:guidArray];
|
||||
@@ -803,7 +804,7 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
[refreshedFolder clearNonPersistedFlag:VNAFolderFlagUpdating];
|
||||
[refreshedFolder setNonPersistedFlag:VNAFolderFlagError];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated
|
||||
object:@(refreshedFolder.itemId)];
|
||||
}); //block for dispatch_async
|
||||
} // starredRequestDone
|
||||
@@ -932,7 +933,7 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
neededParentId = VNAFolderTypeRoot;
|
||||
}
|
||||
if (localFolder.parentId != neededParentId) {
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_OpenReaderFolderChange"
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_OpenReaderFolderChange
|
||||
object:@[ [NSNumber numberWithInteger:nativeId],
|
||||
[NSNumber numberWithInteger:neededParentId],
|
||||
[NSNumber numberWithInteger:0]]];
|
||||
@@ -1132,8 +1133,8 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
[[Database sharedManager] markArticleRead:article.folderId guid:article.guid isRead:readFlag];
|
||||
[article markRead:readFlag];
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated" object:@(article.folderId)];
|
||||
[nc vna_postNotificationOnMainThreadWithName:@"MA_Notify_ArticleListStateChange" object:@(article.folderId)];
|
||||
[nc vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated object:@(article.folderId)];
|
||||
[nc vna_postNotificationOnMainThreadWithName:MA_Notify_ArticleListStateChange object:@(article.folderId)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1174,7 +1175,7 @@ typedef NS_ENUM (NSInteger, OpenReaderStatus) {
|
||||
Folder *folder = ((NSDictionary *)[request vna_userInfo])[@"folder"];
|
||||
[[Database sharedManager] markFolderRead:folder.itemId];
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc vna_postNotificationOnMainThreadWithName:@"MA_Notify_ArticleListStateChange" object:@(folder.itemId)];
|
||||
[nc vna_postNotificationOnMainThreadWithName:MA_Notify_ArticleListStateChange object:@(folder.itemId)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,11 +104,11 @@ typedef NS_ENUM (NSInteger, Redirect301Status) {
|
||||
_urlSession = [NSURLSession sessionWithConfiguration:config delegate:self delegateQueue:[NSOperationQueue mainQueue]];
|
||||
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleGotAuthenticationForFolder:) name:@"MA_Notify_GotAuthenticationForFolder" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleCancelAuthenticationForFolder:) name:@"MA_Notify_CancelAuthenticationForFolder"
|
||||
[nc addObserver:self selector:@selector(handleGotAuthenticationForFolder:) name:MA_Notify_GotAuthenticationForFolder object:nil];
|
||||
[nc addObserver:self selector:@selector(handleCancelAuthenticationForFolder:) name:MA_Notify_CancelAuthenticationForFolder
|
||||
object:nil];
|
||||
[nc addObserver:self selector:@selector(handleWillDeleteFolder:) name:VNADatabaseWillDeleteFolderNotification object:nil];
|
||||
[nc addObserver:self selector:@selector(handleChangeConcurrentDownloads:) name:@"MA_Notify_CowncurrentDownloadsChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleChangeConcurrentDownloads:) name:MA_Notify_ConcurrentDownloadsChange object:nil];
|
||||
// be notified on system wake up after sleep
|
||||
[[NSWorkspace sharedWorkspace].notificationCenter addObserver:self selector:@selector(handleDidWake:)
|
||||
name:@"NSWorkspaceDidWakeNotification" object:nil];
|
||||
@@ -363,7 +363,7 @@ typedef NS_ENUM (NSInteger, Redirect301Status) {
|
||||
} else {
|
||||
[folder clearNonPersistedFlag:VNAFolderFlagError];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated" object:@(folder.itemId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated object:@(folder.itemId)];
|
||||
}
|
||||
|
||||
/* setFolderUpdatingFlag
|
||||
@@ -377,7 +377,7 @@ typedef NS_ENUM (NSInteger, Redirect301Status) {
|
||||
} else {
|
||||
[folder clearNonPersistedFlag:VNAFolderFlagUpdating];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated" object:@(folder.itemId)];
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated object:@(folder.itemId)];
|
||||
}
|
||||
|
||||
/* pumpFolderIconRefresh
|
||||
@@ -417,7 +417,7 @@ typedef NS_ENUM (NSInteger, Redirect301Status) {
|
||||
folder.image = iconImage;
|
||||
|
||||
// Broadcast a notification since the folder image has now changed
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_FoldersUpdated
|
||||
object:@(folder.itemId)];
|
||||
|
||||
// Log additional details about this.
|
||||
@@ -536,7 +536,7 @@ typedef NS_ENUM (NSInteger, Redirect301Status) {
|
||||
hasStarted = YES;
|
||||
countOfNewArticles = 0;
|
||||
[[OpenReader sharedManager] resetCountOfNewArticles];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_RefreshStatus" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_RefreshStatus object:nil];
|
||||
}
|
||||
} // refreshFeed
|
||||
|
||||
@@ -902,7 +902,7 @@ typedef NS_ENUM (NSInteger, Redirect301Status) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
connectorItem.status = logText;
|
||||
});
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:@"MA_Notify_ArticleListContentChange" object:@(folder.
|
||||
[[NSNotificationCenter defaultCenter] vna_postNotificationOnMainThreadWithName:MA_Notify_ArticleListContentChange object:@(folder.
|
||||
itemId)];
|
||||
}
|
||||
|
||||
@@ -1207,8 +1207,8 @@ typedef NS_ENUM (NSInteger, Redirect301Status) {
|
||||
{
|
||||
if (hasStarted && networkQueue.operationCount == 0) {
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc postNotificationName:@"MA_Notify_RefreshStatus" object:nil];
|
||||
[nc postNotificationName:@"MA_Notify_ArticleListContentChange" object:nil];
|
||||
[nc postNotificationName:MA_Notify_RefreshStatus object:nil];
|
||||
[nc postNotificationName:MA_Notify_ArticleListContentChange object:nil];
|
||||
statusMessageDuringRefresh = NSLocalizedString(@"Refresh completed", nil);
|
||||
hasStarted = NO;
|
||||
os_log_info(VNA_LOG, "Finished refreshing");
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#import "InfoPanelController.h"
|
||||
|
||||
#import "Constants.h"
|
||||
#import "Database.h"
|
||||
#import "DateFormatterExtension.h"
|
||||
#import "Folder.h"
|
||||
@@ -155,7 +156,7 @@
|
||||
} else {
|
||||
[[Database sharedManager] clearFlag:VNAFolderFlagLoadFullHTML forFolder:self.infoFolderId];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_LoadFullHTMLChange"
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_LoadFullHTMLChange
|
||||
object:@(self.infoFolderId)];
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#import "InfoPanelManager.h"
|
||||
|
||||
#import "AppController.h"
|
||||
#import "Constants.h"
|
||||
#import "Database.h"
|
||||
#import "InfoPanelController.h"
|
||||
|
||||
@@ -59,9 +60,9 @@
|
||||
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleFolderDeleted:) name:VNADatabaseDidDeleteFolderNotification object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderChange:) name:@"MA_Notify_FolderNameChanged" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderChange:) name:@"MA_Notify_FoldersUpdated" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderChange:) name:@"MA_Notify_LoadFullHTMLChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderChange:) name:MA_Notify_FolderNameChanged object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderChange:) name:MA_Notify_FoldersUpdated object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderChange:) name:MA_Notify_LoadFullHTMLChange object:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#import "AppController.h"
|
||||
#import "ArticleController.h"
|
||||
#import "Constants.h"
|
||||
#import "Preferences.h"
|
||||
#import "Vienna-Swift.h"
|
||||
|
||||
@@ -184,7 +185,7 @@
|
||||
//set the new frame to the webview
|
||||
webView.frame = newWebViewRect;
|
||||
self.fittingHeight = fittingHeight;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_CellResize" object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_CellResize object:self];
|
||||
WebKitArticleView *articleView = (WebKitArticleView *)(self.articleView);
|
||||
[articleView deleteHtmlFile];
|
||||
}];
|
||||
|
||||
@@ -126,8 +126,8 @@ static void *VNAArticleControllerObserverContext = &VNAArticleControllerObserver
|
||||
|
||||
// Register for notifications
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleArticleListContentChange:) name:@"MA_Notify_ArticleListContentChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleArticleListStateChange:) name:@"MA_Notify_ArticleListStateChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleArticleListContentChange:) name:MA_Notify_ArticleListContentChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleArticleListStateChange:) name:MA_Notify_ArticleListStateChange object:nil];
|
||||
|
||||
[NSUserDefaults.standardUserDefaults addObserver:self
|
||||
forKeyPath:MAPref_FilterMode
|
||||
@@ -168,7 +168,7 @@ static void *VNAArticleControllerObserverContext = &VNAArticleControllerObserver
|
||||
[self selectFolderAndArticle:currentFolderId guid:currentSelectedArticle.guid];
|
||||
[self ensureSelectedArticle];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_ArticleViewChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_ArticleViewChange object:nil];
|
||||
}
|
||||
|
||||
/* currentFolderId
|
||||
@@ -495,7 +495,7 @@ static void *VNAArticleControllerObserverContext = &VNAArticleControllerObserver
|
||||
[[Preferences standardPreferences] boolForKey:MAPref_CheckForUpdatedArticles]
|
||||
&& currentArticle.revised && !currentArticle.read)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_ArticleViewChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_ArticleViewChange object:nil];
|
||||
}
|
||||
} // reloadArrayOfArticles
|
||||
|
||||
@@ -795,7 +795,7 @@ static void *VNAArticleControllerObserverContext = &VNAArticleControllerObserver
|
||||
[[Database sharedManager] markArticleRead:folderId guid:theArticle.guid isRead:readFlag];
|
||||
[theArticle markRead:readFlag];
|
||||
if (folderId != lastFolderId && lastFolderId != -1) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FoldersUpdated
|
||||
object:@(lastFolderId)];
|
||||
}
|
||||
lastFolderId = folderId;
|
||||
@@ -803,7 +803,7 @@ static void *VNAArticleControllerObserverContext = &VNAArticleControllerObserver
|
||||
}
|
||||
}
|
||||
if (lastFolderId != -1) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FoldersUpdated
|
||||
object:@(lastFolderId)];
|
||||
}
|
||||
}
|
||||
@@ -827,14 +827,14 @@ static void *VNAArticleControllerObserverContext = &VNAArticleControllerObserver
|
||||
} else {
|
||||
[db markArticleRead:folderId guid:articleRef.guid isRead:readFlag];
|
||||
if (folderId != lastFolderId && lastFolderId != -1) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FoldersUpdated
|
||||
object:@(lastFolderId)];
|
||||
}
|
||||
lastFolderId = folderId;
|
||||
}
|
||||
}
|
||||
if (lastFolderId != -1) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FoldersUpdated
|
||||
object:@(lastFolderId)];
|
||||
}
|
||||
}
|
||||
@@ -936,7 +936,7 @@ static void *VNAArticleControllerObserverContext = &VNAArticleControllerObserver
|
||||
} else {
|
||||
[dbManager markArticleRead:folderId guid:theGuid isRead:readFlag];
|
||||
if (folderId != lastFolderId && lastFolderId != -1) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FoldersUpdated
|
||||
object:@(lastFolderId)];
|
||||
}
|
||||
lastFolderId = folderId;
|
||||
@@ -948,7 +948,7 @@ static void *VNAArticleControllerObserverContext = &VNAArticleControllerObserver
|
||||
}
|
||||
|
||||
if (lastFolderId != -1) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FoldersUpdated"
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FoldersUpdated
|
||||
object:@(lastFolderId)];
|
||||
}
|
||||
if (lastFolderId != -1 && [dbManager folderFromID:currentFolderId].type != VNAFolderTypeRSS
|
||||
|
||||
@@ -25,7 +25,7 @@ extension ArticleConverter {
|
||||
func setup() {
|
||||
// Update the article content style when the active display style has
|
||||
// changed.
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(self.initForCurrentStyle), name: NSNotification.Name("MA_Notify_StyleChange"), object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(self.initForCurrentStyle), name: .styleChanged, object: nil)
|
||||
|
||||
self.initForCurrentStyle()
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ static void *VNAArticleListViewObserverContext = &VNAArticleListViewObserverCont
|
||||
{
|
||||
// Register for notification
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleArticleListFontChange:) name:@"MA_Notify_ArticleListFontChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReadingPaneChange:) name:@"MA_Notify_ReadingPaneChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleLoadFullHTMLChange:) name:@"MA_Notify_LoadFullHTMLChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleRefreshArticle:) name:@"MA_Notify_ArticleViewChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleArticleViewEnded:) name:@"MA_Notify_ArticleViewEnded" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleArticleListFontChange:) name:MA_Notify_ArticleListFontChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReadingPaneChange:) name:MA_Notify_ReadingPaneChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleLoadFullHTMLChange:) name:MA_Notify_LoadFullHTMLChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleRefreshArticle:) name:MA_Notify_ArticleViewChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleArticleViewEnded:) name:MA_Notify_ArticleViewEnded object:nil];
|
||||
|
||||
[self initialiseArticleView];
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
@import UniformTypeIdentifiers;
|
||||
|
||||
#import "Constants.h"
|
||||
#import "DownloadManager.h"
|
||||
#import "DSClickableURLTextField.h"
|
||||
#import "NSWorkspace+OpenWithMenu.h"
|
||||
@@ -45,7 +46,7 @@
|
||||
|
||||
// Register to be notified when a download completes.
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleDownloadCompleted:) name:@"MA_Notify_DownloadCompleted" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleDownloadCompleted:) name:MA_Notify_DownloadCompleted object:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -111,13 +111,13 @@ static void *VNAFoldersTreeObserverContext = &VNAFoldersTreeObserverContext;
|
||||
|
||||
// Register for notifications
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleFolderUpdate:) name:@"MA_Notify_FoldersUpdated" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderNameChange:) name:@"MA_Notify_FolderNameChanged" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderAdded:) name:@"MA_Notify_FolderAdded" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderUpdate:) name:MA_Notify_FoldersUpdated object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderNameChange:) name:MA_Notify_FolderNameChanged object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderAdded:) name:MA_Notify_FolderAdded object:nil];
|
||||
[nc addObserver:self selector:@selector(handleFolderDeleted:) name:VNADatabaseDidDeleteFolderNotification object:nil];
|
||||
[nc addObserver:self selector:@selector(handleShowFolderImagesChange:) name:@"MA_Notify_ShowFolderImages" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleAutoSortFoldersTreeChange:) name:@"MA_Notify_AutoSortFoldersTreeChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleOpenReaderFolderChange:) name:@"MA_Notify_OpenReaderFolderChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleShowFolderImagesChange:) name:MA_Notify_ShowFolderImages object:nil];
|
||||
[nc addObserver:self selector:@selector(handleAutoSortFoldersTreeChange:) name:MA_Notify_AutoSortFoldersTreeChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleOpenReaderFolderChange:) name:MA_Notify_OpenReaderFolderChange object:nil];
|
||||
|
||||
[userDefaults addObserver:self
|
||||
forKeyPath:MAPref_FeedListSizeMode
|
||||
@@ -397,7 +397,7 @@ static void *VNAFoldersTreeObserverContext = &VNAFoldersTreeObserverContext;
|
||||
[self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:(NSUInteger)rowIndex] byExtendingSelection:NO];
|
||||
[self.outlineView scrollRowToVisible:rowIndex];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FolderSelectionChange" object:node];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FolderSelectionChange object:node];
|
||||
self.blockSelectionHandler = NO;
|
||||
return YES;
|
||||
}
|
||||
@@ -641,7 +641,7 @@ static void *VNAFoldersTreeObserverContext = &VNAFoldersTreeObserverContext;
|
||||
[APPCONTROLLER openURLFromString:urlString inPreferredBrowser:YES];
|
||||
}
|
||||
} else if (node.folder.type == VNAFolderTypeSmart) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_EditFolder" object:node];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_EditFolder object:node];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ static void *VNAFoldersTreeObserverContext = &VNAFoldersTreeObserverContext;
|
||||
if (currentFolderId == folderId) {
|
||||
self.blockSelectionHandler = YES;
|
||||
[self selectFolder:nextNode.nodeId];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FolderSelectionChange" object:nextNode];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FolderSelectionChange object:nextNode];
|
||||
self.blockSelectionHandler = NO;
|
||||
}
|
||||
}
|
||||
@@ -1477,7 +1477,7 @@ static void *VNAFoldersTreeObserverContext = &VNAFoldersTreeObserverContext;
|
||||
{
|
||||
if (!self.blockSelectionHandler) {
|
||||
TreeNode * node = [self.outlineView itemAtRow:self.outlineView.selectedRow];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FolderSelectionChange" object:node];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FolderSelectionChange object:node];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -308,11 +308,11 @@ extension TabbedBrowserViewController: MMTabBarViewDelegate {
|
||||
}
|
||||
|
||||
func tabView(_ tabView: NSTabView, didSelect tabViewItem: NSTabViewItem?) {
|
||||
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MA_Notify_TabChanged"), object: tabViewItem?.view)
|
||||
NotificationCenter.default.post(name: .tabChanged, object: tabViewItem?.view)
|
||||
}
|
||||
|
||||
func tabViewDidChangeNumberOfTabViewItems(_ tabView: NSTabView) {
|
||||
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MA_Notify_TabCountChanged"), object: tabView)
|
||||
NotificationCenter.default.post(name: .tabCountChanged, object: tabView)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ static void *VNAUnifiedDisplayViewObserverContext = &VNAUnifiedDisplayViewObserv
|
||||
{
|
||||
// Register for notification
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleReadingPaneChange:) name:@"MA_Notify_ReadingPaneChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleCellDidResize:) name:@"MA_Notify_CellResize" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReadingPaneChange:) name:MA_Notify_ReadingPaneChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleCellDidResize:) name:MA_Notify_CellResize object:nil];
|
||||
|
||||
[self initTableView];
|
||||
}
|
||||
|
||||
@@ -116,11 +116,11 @@ class WebKitArticleTab: BrowserTab, ArticleContentView {
|
||||
|
||||
override func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
|
||||
super.webView(webView, didFinish: navigation)
|
||||
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MA_Notify_ArticleViewEnded"), object: self)
|
||||
NotificationCenter.default.post(name: .articleViewEnded, object: self)
|
||||
}
|
||||
|
||||
override func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
|
||||
super.webView(webView, didFailProvisionalNavigation: navigation, withError: error)
|
||||
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MA_Notify_ArticleViewEnded"), object: self)
|
||||
NotificationCenter.default.post(name: .articleViewEnded, object: self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,27 +21,31 @@
|
||||
|
||||
@import Foundation;
|
||||
|
||||
extern NSString * _Nonnull MA_Field_GUID;
|
||||
extern NSString * _Nullable MA_Field_Subject;
|
||||
extern NSString * _Nullable MA_Field_Author;
|
||||
extern NSString * _Nullable MA_Field_Link;
|
||||
extern NSString * _Nullable MA_Field_Date;
|
||||
extern NSString * _Nullable MA_Field_Read;
|
||||
extern NSString * _Nullable MA_Field_Flagged;
|
||||
extern NSString * _Nullable MA_Field_Comments;
|
||||
extern NSString * _Nullable MA_Field_Deleted;
|
||||
extern NSString * _Nullable MA_Field_Text;
|
||||
extern NSString * _Nullable MA_Field_Folder;
|
||||
extern NSString * _Nullable MA_Field_Parent;
|
||||
extern NSString * _Nullable MA_Field_Headlines;
|
||||
extern NSString * _Nullable MA_Field_Summary;
|
||||
extern NSString * _Nullable MA_Field_CreatedDate;
|
||||
extern NSString * _Nullable MA_Field_Enclosure;
|
||||
extern NSString * _Nullable MA_Field_EnclosureDownloaded;
|
||||
extern NSString * _Nullable MA_Field_HasEnclosure;
|
||||
|
||||
@class Folder;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
extern NSString * const MA_Field_GUID;
|
||||
extern NSString * const MA_Field_Subject;
|
||||
extern NSString * const MA_Field_Author;
|
||||
extern NSString * const MA_Field_Link;
|
||||
extern NSString * const MA_Field_Date;
|
||||
extern NSString * const MA_Field_Read;
|
||||
extern NSString * const MA_Field_Flagged;
|
||||
extern NSString * const MA_Field_Comments;
|
||||
extern NSString * const MA_Field_Deleted;
|
||||
extern NSString * const MA_Field_Text;
|
||||
extern NSString * const MA_Field_Folder;
|
||||
extern NSString * const MA_Field_Parent;
|
||||
extern NSString * const MA_Field_Headlines;
|
||||
extern NSString * const MA_Field_Summary;
|
||||
extern NSString * const MA_Field_CreatedDate;
|
||||
extern NSString * const MA_Field_Enclosure;
|
||||
extern NSString * const MA_Field_EnclosureDownloaded;
|
||||
extern NSString * const MA_Field_HasEnclosure;
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
// Article field IDs
|
||||
typedef NS_ENUM(NSInteger, ArticleFieldID) {
|
||||
ArticleFieldIDGUID = 400,
|
||||
|
||||
@@ -27,24 +27,24 @@
|
||||
#import "Folder.h"
|
||||
|
||||
// The names here are internal field names, not for localisation.
|
||||
NSString * MA_Field_GUID = @"GUID";
|
||||
NSString * MA_Field_Subject = @"Subject";
|
||||
NSString * MA_Field_Author = @"Author";
|
||||
NSString * MA_Field_Link = @"Link";
|
||||
NSString * MA_Field_Date = @"Date";
|
||||
NSString * MA_Field_Comments = @"Comments";
|
||||
NSString * MA_Field_Read = @"Read";
|
||||
NSString * MA_Field_Flagged = @"Flagged";
|
||||
NSString * MA_Field_Deleted = @"Deleted";
|
||||
NSString * MA_Field_Text = @"Text";
|
||||
NSString * MA_Field_Folder = @"Folder";
|
||||
NSString * MA_Field_Parent = @"Parent";
|
||||
NSString * MA_Field_Headlines = @"Headlines";
|
||||
NSString * MA_Field_Summary = @"Summary";
|
||||
NSString * MA_Field_CreatedDate = @"CreatedDate";
|
||||
NSString * MA_Field_Enclosure = @"Enclosure";
|
||||
NSString * MA_Field_EnclosureDownloaded = @"EnclosureDownloaded";
|
||||
NSString * MA_Field_HasEnclosure = @"HasEnclosure";
|
||||
NSString * const MA_Field_GUID = @"GUID";
|
||||
NSString * const MA_Field_Subject = @"Subject";
|
||||
NSString * const MA_Field_Author = @"Author";
|
||||
NSString * const MA_Field_Link = @"Link";
|
||||
NSString * const MA_Field_Date = @"Date";
|
||||
NSString * const MA_Field_Comments = @"Comments";
|
||||
NSString * const MA_Field_Read = @"Read";
|
||||
NSString * const MA_Field_Flagged = @"Flagged";
|
||||
NSString * const MA_Field_Deleted = @"Deleted";
|
||||
NSString * const MA_Field_Text = @"Text";
|
||||
NSString * const MA_Field_Folder = @"Folder";
|
||||
NSString * const MA_Field_Parent = @"Parent";
|
||||
NSString * const MA_Field_Headlines = @"Headlines";
|
||||
NSString * const MA_Field_Summary = @"Summary";
|
||||
NSString * const MA_Field_CreatedDate = @"CreatedDate";
|
||||
NSString * const MA_Field_Enclosure = @"Enclosure";
|
||||
NSString * const MA_Field_EnclosureDownloaded = @"EnclosureDownloaded";
|
||||
NSString * const MA_Field_HasEnclosure = @"HasEnclosure";
|
||||
|
||||
@implementation Article
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
//
|
||||
|
||||
#import "AppearancePreferencesViewController.h"
|
||||
|
||||
#import "Constants.h"
|
||||
#import "Preferences.h"
|
||||
|
||||
// List of minimum font sizes. I picked the ones that matched the same option in
|
||||
@@ -37,9 +39,9 @@ static NSInteger const availableMinimumFontSizes[] = { 9, 10, 11, 12, 14, 18, 24
|
||||
|
||||
- (void)viewDidLoad {
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:@"MA_Notify_ArticleListFontChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:kMA_Notify_MinimumFontSizeChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:MA_Notify_ArticleListFontChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:MA_Notify_MinimumFontSizeChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear {
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:@"MA_Notify_CheckFrequencyChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:MA_Notify_CheckFrequencyChange object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:MA_Notify_PreferenceChange object:nil];
|
||||
appToPathMap = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
|
||||
|
||||
@@ -62,10 +62,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
NSString * syncingUser;
|
||||
}
|
||||
|
||||
// String constants for NSNotificationCenter
|
||||
extern NSString * const kMA_Notify_MinimumFontSizeChange;
|
||||
extern NSString * const kMA_Notify_UseJavaScriptChange;
|
||||
|
||||
@property (class, readonly, nonatomic) Preferences *standardPreferences;
|
||||
|
||||
// Accessor functions
|
||||
|
||||
@@ -41,11 +41,6 @@ static NSString * const MA_DefaultStyleName = @"Default";
|
||||
static NSString * const MA_Database_Name = @"messages.db";
|
||||
static NSString * const MA_FeedSourcesFolder_Name = @"Sources";
|
||||
|
||||
// NSNotificationCenter string constants
|
||||
NSString * const kMA_Notify_MinimumFontSizeChange = @"MA_Notify_MinimumFontSizeChange";
|
||||
NSString * const kMA_Notify_UseJavaScriptChange = @"MA_Notify_UseJavaScriptChange";
|
||||
|
||||
|
||||
// The default preferences object.
|
||||
static Preferences * _standardPreferences = nil;
|
||||
|
||||
@@ -240,8 +235,15 @@ static Preferences * _standardPreferences = nil;
|
||||
|
||||
- (void)migrateEncodedPreferences
|
||||
{
|
||||
if ([userPrefs objectForKey:MAPref_Deprecated_ArticleListSortOrders]) {
|
||||
NSData *archive = [self objectForKey:MAPref_Deprecated_ArticleListSortOrders];
|
||||
// Deprecated defaults keys. These were used in older versions of Vienna.
|
||||
NSString * const articleSortDescriptorsKey = @"ArticleSortDescriptors";
|
||||
NSString * const downloadsListKey = @"DownloadsList";
|
||||
NSString * const messageListFontKey = @"MessageListFont";
|
||||
NSString * const folderFontKey = @"FolderFont";
|
||||
NSString * const folderListFontKey = @"FolderListFont";
|
||||
|
||||
if ([userPrefs objectForKey:articleSortDescriptorsKey]) {
|
||||
NSData *archive = [self objectForKey:articleSortDescriptorsKey];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
NSMutableArray *sortDescriptors = [[NSUnarchiver unarchiveObjectWithData:archive] mutableCopy];
|
||||
@@ -260,12 +262,12 @@ static Preferences * _standardPreferences = nil;
|
||||
NSData *keyedArchive = [NSKeyedArchiver vna_archivedDataWithRootObject:[sortDescriptors copy]
|
||||
requiringSecureCoding:YES];
|
||||
[self setObject:keyedArchive forKey:MAPref_ArticleListSortOrders];
|
||||
[userPrefs removeObjectForKey:MAPref_Deprecated_ArticleListSortOrders];
|
||||
[userPrefs removeObjectForKey:articleSortDescriptorsKey];
|
||||
}
|
||||
|
||||
if ([userPrefs objectForKey:MAPref_Deprecated_DownloadItemList]) {
|
||||
if ([userPrefs objectForKey:downloadsListKey]) {
|
||||
// Download items were stored as an array of non-keyed archives.
|
||||
NSArray *array = [self objectForKey:MAPref_Deprecated_DownloadItemList];
|
||||
NSArray *array = [self objectForKey:downloadsListKey];
|
||||
NSMutableArray *downloadItems = [NSMutableArray array];
|
||||
|
||||
for (NSData *archive in array) {
|
||||
@@ -284,11 +286,11 @@ static Preferences * _standardPreferences = nil;
|
||||
NSData *keyedArchive = [NSKeyedArchiver vna_archivedDataWithRootObject:downloadItems
|
||||
requiringSecureCoding:YES];
|
||||
[self setObject:keyedArchive forKey:MAPref_DownloadItemList];
|
||||
[userPrefs removeObjectForKey:MAPref_Deprecated_DownloadItemList];
|
||||
[userPrefs removeObjectForKey:downloadsListKey];
|
||||
}
|
||||
|
||||
if ([userPrefs objectForKey:MAPref_Deprecated_ArticleListFont]) {
|
||||
NSData *archive = [self objectForKey:MAPref_Deprecated_ArticleListFont];
|
||||
if ([userPrefs objectForKey:messageListFontKey]) {
|
||||
NSData *archive = [self objectForKey:messageListFontKey];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
NSFont *font = [NSUnarchiver unarchiveObjectWithData:archive];
|
||||
@@ -296,11 +298,11 @@ static Preferences * _standardPreferences = nil;
|
||||
NSData *keyedArchive = [NSKeyedArchiver vna_archivedDataWithRootObject:font
|
||||
requiringSecureCoding:YES];
|
||||
[self setObject:keyedArchive forKey:MAPref_ArticleListFont];
|
||||
[userPrefs removeObjectForKey:MAPref_Deprecated_ArticleListFont];
|
||||
[userPrefs removeObjectForKey:messageListFontKey];
|
||||
}
|
||||
|
||||
if ([userPrefs objectForKey:MAPref_Deprecated_FolderFont]) {
|
||||
NSData *archive = [self objectForKey:MAPref_Deprecated_FolderFont];
|
||||
if ([userPrefs objectForKey:folderFontKey]) {
|
||||
NSData *archive = [self objectForKey:folderFontKey];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
NSFont *font = [NSUnarchiver unarchiveObjectWithData:archive];
|
||||
@@ -309,11 +311,11 @@ static Preferences * _standardPreferences = nil;
|
||||
[userPrefs setInteger:VNAFeedListSizeModeTiny
|
||||
forKey:MAPref_FeedListSizeMode];
|
||||
}
|
||||
[userPrefs removeObjectForKey:MAPref_Deprecated_FolderFont];
|
||||
[userPrefs removeObjectForKey:folderFontKey];
|
||||
}
|
||||
|
||||
if ([userPrefs objectForKey:MAPref_Deprecated_FolderListFont]) {
|
||||
NSData *archive = [self objectForKey:MAPref_Deprecated_FolderListFont];
|
||||
if ([userPrefs objectForKey:folderListFontKey]) {
|
||||
NSData *archive = [self objectForKey:folderListFontKey];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
NSFont *font = [NSKeyedUnarchiver vna_unarchivedObjectOfClass:[NSFont class]
|
||||
@@ -323,7 +325,7 @@ static Preferences * _standardPreferences = nil;
|
||||
[userPrefs setInteger:VNAFeedListSizeModeTiny
|
||||
forKey:MAPref_FeedListSizeMode];
|
||||
}
|
||||
[userPrefs removeObjectForKey:MAPref_Deprecated_FolderListFont];
|
||||
[userPrefs removeObjectForKey:folderListFontKey];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -462,7 +464,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (useJavaScript != flag) {
|
||||
useJavaScript = flag;
|
||||
[self setBool:flag forKey:MAPref_UseJavaScript];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMA_Notify_UseJavaScriptChange
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_UseJavaScriptChange
|
||||
object:nil];
|
||||
}
|
||||
}
|
||||
@@ -475,7 +477,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (downloads != concurrentDownloads) {
|
||||
concurrentDownloads = downloads;
|
||||
[self setInteger:downloads forKey:MAPref_ConcurrentDownloads];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_CowncurrentDownloadsChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_ConcurrentDownloadsChange object:nil];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -497,7 +499,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (newSize != minimumFontSize) {
|
||||
minimumFontSize = newSize;
|
||||
[self setInteger:minimumFontSize forKey:MAPref_MinimumFontSize];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMA_Notify_MinimumFontSizeChange
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_MinimumFontSizeChange
|
||||
object:nil];
|
||||
}
|
||||
}
|
||||
@@ -510,7 +512,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (enableMinimumFontSize != flag) {
|
||||
enableMinimumFontSize = flag;
|
||||
[self setBool:flag forKey:MAPref_UseMinimumFontSize];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMA_Notify_MinimumFontSizeChange
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_MinimumFontSizeChange
|
||||
object:nil];
|
||||
}
|
||||
}
|
||||
@@ -531,7 +533,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (showFolderImages != flag) {
|
||||
showFolderImages = flag;
|
||||
[self setBool:flag forKey:MAPref_ShowFolderImages];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_ShowFolderImages" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_ShowFolderImages object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -573,7 +575,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (layout != newLayout) {
|
||||
layout = newLayout;
|
||||
[self setInteger:newLayout forKey:MAPref_Layout];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_ReadingPaneChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_ReadingPaneChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -614,7 +616,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (refreshFrequency != newFrequency) {
|
||||
refreshFrequency = newFrequency;
|
||||
[self setInteger:newFrequency forKey:MAPref_CheckFrequency];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_CheckFrequencyChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_CheckFrequencyChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -634,7 +636,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (flag != refreshOnStartup) {
|
||||
refreshOnStartup = flag;
|
||||
[self setBool:flag forKey:MAPref_CheckForNewArticlesOnStartup];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,7 +656,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (flag != alwaysAcceptBetas) {
|
||||
alwaysAcceptBetas = flag;
|
||||
[self setBool:flag forKey:MAPref_AlwaysAcceptBetas];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -676,7 +678,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (newInterval != markReadInterval) {
|
||||
markReadInterval = newInterval;
|
||||
[self setObject:@((float)newInterval) forKey:MAPref_MarkReadInterval];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,7 +719,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (openLinksInVienna != flag) {
|
||||
openLinksInVienna = flag;
|
||||
[self setBool:flag forKey:MAPref_OpenLinksInVienna];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -738,7 +740,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (openLinksInBackground != flag) {
|
||||
openLinksInBackground = flag;
|
||||
[self setBool:flag forKey:MAPref_OpenLinksInBackground];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -759,7 +761,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (markUpdatedAsNew != flag) {
|
||||
markUpdatedAsNew = flag;
|
||||
[self setBool:flag forKey:MAPref_CheckForUpdatedArticles];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,7 +790,7 @@ static Preferences * _standardPreferences = nil;
|
||||
displayStyle = newStyleName;
|
||||
[self setString:displayStyle forKey:MAPref_ActiveStyleName];
|
||||
if (flag) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_StyleChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_StyleChange object:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -809,7 +811,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (newValue != textSizeMultiplier) {
|
||||
textSizeMultiplier = newValue;
|
||||
[self setObject:@(newValue) forKey:MAPref_ActiveTextSizeMultiplier];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_StyleChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_StyleChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -838,7 +840,7 @@ static Preferences * _standardPreferences = nil;
|
||||
NSData *archive = [NSKeyedArchiver vna_archivedDataWithRootObject:articleFont
|
||||
requiringSecureCoding:YES];
|
||||
[self setObject:archive forKey:MAPref_ArticleListFont];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_ArticleListFontChange" object:articleFont];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_ArticleListFontChange object:articleFont];
|
||||
}
|
||||
|
||||
/* setArticleListFontSize
|
||||
@@ -850,7 +852,7 @@ static Preferences * _standardPreferences = nil;
|
||||
NSData *archive = [NSKeyedArchiver vna_archivedDataWithRootObject:articleFont
|
||||
requiringSecureCoding:YES];
|
||||
[self setObject:archive forKey:MAPref_ArticleListFont];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_ArticleListFontChange" object:articleFont];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_ArticleListFontChange object:articleFont];
|
||||
}
|
||||
|
||||
/* articleSortDescriptors
|
||||
@@ -883,7 +885,7 @@ static Preferences * _standardPreferences = nil;
|
||||
NSData *archive = [NSKeyedArchiver vna_archivedDataWithRootObject:articleSortDescriptors
|
||||
requiringSecureCoding:YES];
|
||||
[self setObject:archive forKey:MAPref_ArticleListSortOrders];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -903,7 +905,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (foldersTreeSortMethod != newMethod) {
|
||||
foldersTreeSortMethod = newMethod;
|
||||
[self setInteger:newMethod forKey:MAPref_AutoSortFoldersTree];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_AutoSortFoldersTreeChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_AutoSortFoldersTreeChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -923,7 +925,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (newMethod != newArticlesNotification) {
|
||||
newArticlesNotification = newMethod;
|
||||
[self setInteger:newArticlesNotification forKey:MAPref_NewArticlesNotification];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -943,7 +945,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (showAppInStatusBar != show) {
|
||||
showAppInStatusBar = show;
|
||||
[self setBool:showAppInStatusBar forKey:MAPref_ShowAppInStatusBar];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_ShowAppInStatusBarChanged" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_ShowAppInStatusBarChanged object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -982,7 +984,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (showFilterBar != show) {
|
||||
showFilterBar = show;
|
||||
[self setBool:showFilterBar forKey:MAPref_ShowFilterBar];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_FilterBarChanged" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_FilterBarChanged object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1013,7 +1015,7 @@ static Preferences * _standardPreferences = nil;
|
||||
[self createFeedSourcesFolderIfNecessary];
|
||||
}
|
||||
[self setBool:shouldSaveFeedSource forKey:MAPref_ShouldSaveFeedSource];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1044,7 +1046,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (syncGoogleReader != flag) {
|
||||
syncGoogleReader = flag;
|
||||
[self setBool:syncGoogleReader forKey:MAPref_SyncGoogleReader];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_SyncGoogleReaderChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_SyncGoogleReaderChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1061,7 +1063,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (prefersGoogleNewSubscription != flag) {
|
||||
prefersGoogleNewSubscription = flag;
|
||||
[self setBool:prefersGoogleNewSubscription forKey:MAPref_GoogleNewSubscription];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_GoogleReaderNewSubscriptionChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_GoogleReaderNewSubscriptionChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1078,7 +1080,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (![syncServer isEqualToString:newServer]) {
|
||||
syncServer = [newServer copy];
|
||||
[self setString:syncServer forKey:MAPref_SyncServer];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_SyncGoogleReaderChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_SyncGoogleReaderChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1095,7 +1097,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (![syncScheme isEqualToString:newScheme]) {
|
||||
syncScheme = [newScheme copy];
|
||||
[self setString:syncScheme forKey:MAPref_SyncScheme];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_SyncGoogleReaderChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_SyncGoogleReaderChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1112,7 +1114,7 @@ static Preferences * _standardPreferences = nil;
|
||||
if (![syncingUser isEqualToString:newUser]) {
|
||||
syncingUser = [newUser copy];
|
||||
[self setString:syncingUser forKey:MAPref_SyncingUser];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"MA_Notify_SyncGoogleReaderChange" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MA_Notify_SyncGoogleReaderChange object:nil];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,13 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import "SyncingPreferencesViewController.h"
|
||||
|
||||
#import "Constants.h"
|
||||
#import "OpenReader.h"
|
||||
#import "Keychain.h"
|
||||
#import "Preferences.h"
|
||||
#import "StringExtensions.h"
|
||||
#import "SyncingPreferencesViewController.h"
|
||||
|
||||
@interface SyncingPreferencesViewController ()
|
||||
|
||||
@@ -41,7 +43,7 @@ static NSString *syncingUser;
|
||||
- (void)viewWillAppear {
|
||||
// Set up to be notified
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleGoogleAuthFailed:) name:@"MA_Notify_GoogleAuthFailed" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleGoogleAuthFailed:) name:MA_Notify_GoogleAuthFailed object:nil];
|
||||
[nc addObserver:self selector:@selector(handleServerTextDidChange:) name:NSControlTextDidChangeNotification object:openReaderHost];
|
||||
[nc addObserver:self selector:@selector(handleUserTextDidChange:) name:NSControlTextDidChangeNotification object:username];
|
||||
[nc addObserver:self selector:@selector(handlePasswordTextDidChange:) name:NSControlTextDidChangeNotification object:password];
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:@"MA_Notify_PreferenceChange" object:nil];
|
||||
[nc addObserver:self selector:@selector(handleReloadPreferences:) name:MA_Notify_PreferenceChange object:nil];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear {
|
||||
|
||||
@@ -20,81 +20,108 @@
|
||||
|
||||
@import Cocoa;
|
||||
|
||||
extern NSString * MA_DefaultUserAgentString;
|
||||
extern NSString * MA_BrowserUserAgentString;
|
||||
extern NSString * const MA_DefaultUserAgentString;
|
||||
extern NSString * const MA_BrowserUserAgentString;
|
||||
|
||||
extern NSString *const MAPref_ArticleListFont;
|
||||
extern NSString * MAPref_AutoSortFoldersTree;
|
||||
extern NSString * MAPref_CheckForUpdatedArticles;
|
||||
extern NSString * MAPref_ShowUnreadArticlesInBold;
|
||||
extern NSString * MAPref_CachedFolderID;
|
||||
extern NSString * MAPref_DefaultDatabase;
|
||||
extern NSString *const MAPref_DownloadsFolderBookmark;
|
||||
extern NSString * MAPref_SortColumn;
|
||||
extern NSString * MAPref_CheckFrequency;
|
||||
extern NSString * MAPref_ArticleListColumns;
|
||||
extern NSString * MAPref_CheckForNewArticlesOnStartup;
|
||||
extern NSString * MAPref_ActiveStyleName;
|
||||
extern NSString * MAPref_ActiveTextSizeMultiplier;
|
||||
extern NSString * MAPref_FolderStates;
|
||||
extern NSString * MAPref_BacktrackQueueSize;
|
||||
extern NSString * MAPref_MarkReadInterval;
|
||||
extern NSString * MAPref_OpenLinksInVienna;
|
||||
extern NSString * MAPref_OpenLinksInBackground;
|
||||
extern NSString * MAPref_MinimumFontSize;
|
||||
extern NSString * MAPref_UseMinimumFontSize;
|
||||
extern NSString * MAPref_AutoExpireDuration;
|
||||
extern NSString *const MAPref_DownloadItemList;
|
||||
extern NSString * MAPref_ShowFolderImages;
|
||||
extern NSString * MAPref_UseJavaScript;
|
||||
extern NSString * MAPref_CachedArticleGUID;
|
||||
extern NSString *const MAPref_ArticleListSortOrders;
|
||||
extern NSString * MAPref_FilterMode;
|
||||
extern NSString * MAPref_LastRefreshDate;
|
||||
extern NSString * MAPref_TabList;
|
||||
extern NSString * MAPref_TabTitleDictionary;
|
||||
extern NSString * MAPref_Layout;
|
||||
extern NSString * MAPref_NewArticlesNotification;
|
||||
extern NSString * MAPref_EmptyTrashNotification;
|
||||
extern NSString * MAPref_ShowAppInStatusBar;
|
||||
extern NSString * MAPref_ShowStatusBar;
|
||||
extern NSString * MAPref_ShowFilterBar;
|
||||
extern NSString * MAPref_LastViennaVersionRun;
|
||||
extern NSString * MAPref_HighestViennaVersionRun;
|
||||
extern NSString * MAPref_ShouldSaveFeedSource;
|
||||
extern NSString * MAPref_ShouldSaveFeedSourceBackup;
|
||||
extern NSString * MAPref_SearchMethod;
|
||||
extern NSString * MAPref_SyncGoogleReader;
|
||||
extern NSString * MAPref_GoogleNewSubscription;
|
||||
extern NSString * MAPref_ConcurrentDownloads;
|
||||
extern NSString * MAPref_SyncServer;
|
||||
extern NSString * MAPref_SyncScheme;
|
||||
extern NSString * MAPref_SyncingUser;
|
||||
extern NSString * MAPref_SyncingAppId;
|
||||
extern NSString * MAPref_SyncingAppKey;
|
||||
extern NSString * MAPref_AlwaysAcceptBetas;
|
||||
extern NSString * MAPref_UserAgentName;
|
||||
extern NSString *const MAPref_UseRelativeDates;
|
||||
extern NSNotificationName const MA_Notify_ArticleListContentChange;
|
||||
extern NSNotificationName const MA_Notify_ArticleListFontChange;
|
||||
extern NSNotificationName const MA_Notify_ArticleListStateChange;
|
||||
extern NSNotificationName const MA_Notify_ArticleViewChange;
|
||||
extern NSNotificationName const MA_Notify_ArticleViewEnded NS_SWIFT_NAME(articleViewEnded);
|
||||
extern NSNotificationName const MA_Notify_AutoSortFoldersTreeChange;
|
||||
extern NSNotificationName const MA_Notify_CancelAuthenticationForFolder;
|
||||
extern NSNotificationName const MA_Notify_CellResize;
|
||||
extern NSNotificationName const MA_Notify_CheckFrequencyChange;
|
||||
extern NSNotificationName const MA_Notify_ConcurrentDownloadsChange;
|
||||
extern NSNotificationName const MA_Notify_DownloadCompleted;
|
||||
extern NSNotificationName const MA_Notify_DownloadsListChange;
|
||||
extern NSNotificationName const MA_Notify_EditFolder;
|
||||
extern NSNotificationName const MA_Notify_FilterBarChanged;
|
||||
extern NSNotificationName const MA_Notify_FolderAdded;
|
||||
extern NSNotificationName const MA_Notify_FolderDescriptionChanged; // Unused
|
||||
extern NSNotificationName const MA_Notify_FolderHomePageChanged; // Unused
|
||||
extern NSNotificationName const MA_Notify_FolderNameChanged;
|
||||
extern NSNotificationName const MA_Notify_FolderSelectionChange;
|
||||
extern NSNotificationName const MA_Notify_FoldersUpdated;
|
||||
extern NSNotificationName const MA_Notify_GoogleAuthFailed;
|
||||
extern NSNotificationName const MA_Notify_GoogleReaderNewSubscriptionChange; // Unused
|
||||
extern NSNotificationName const MA_Notify_GotAuthenticationForFolder;
|
||||
extern NSNotificationName const MA_Notify_LoadFullHTMLChange;
|
||||
extern NSNotificationName const MA_Notify_MinimumFontSizeChange;
|
||||
extern NSNotificationName const MA_Notify_OpenReaderFolderChange;
|
||||
extern NSNotificationName const MA_Notify_PreferenceChange;
|
||||
extern NSNotificationName const MA_Notify_ReadingPaneChange;
|
||||
extern NSNotificationName const MA_Notify_RefreshStatus;
|
||||
extern NSNotificationName const MA_Notify_ShowAppInStatusBarChanged;
|
||||
extern NSNotificationName const MA_Notify_ShowFolderImages;
|
||||
extern NSNotificationName const MA_Notify_StyleChange NS_SWIFT_NAME(styleChanged);
|
||||
extern NSNotificationName const MA_Notify_SyncGoogleReaderChange; // Unused
|
||||
extern NSNotificationName const MA_Notify_TabChanged NS_SWIFT_NAME(tabChanged);
|
||||
extern NSNotificationName const MA_Notify_TabCountChanged NS_SWIFT_NAME(tabCountChanged);
|
||||
extern NSNotificationName const MA_Notify_UseJavaScriptChange; // Unused
|
||||
|
||||
extern NSString * const MAPref_ArticleListFont;
|
||||
extern NSString * const MAPref_AutoSortFoldersTree;
|
||||
extern NSString * const MAPref_CheckForUpdatedArticles;
|
||||
extern NSString * const MAPref_ShowUnreadArticlesInBold;
|
||||
extern NSString * const MAPref_CachedFolderID;
|
||||
extern NSString * const MAPref_DefaultDatabase;
|
||||
extern NSString * const MAPref_DownloadsFolderBookmark;
|
||||
extern NSString * const MAPref_SortColumn;
|
||||
extern NSString * const MAPref_CheckFrequency;
|
||||
extern NSString * const MAPref_ArticleListColumns;
|
||||
extern NSString * const MAPref_CheckForNewArticlesOnStartup;
|
||||
extern NSString * const MAPref_ActiveStyleName;
|
||||
extern NSString * const MAPref_ActiveTextSizeMultiplier;
|
||||
extern NSString * const MAPref_FolderStates;
|
||||
extern NSString * const MAPref_BacktrackQueueSize;
|
||||
extern NSString * const MAPref_MarkReadInterval;
|
||||
extern NSString * const MAPref_OpenLinksInVienna;
|
||||
extern NSString * const MAPref_OpenLinksInBackground;
|
||||
extern NSString * const MAPref_MinimumFontSize;
|
||||
extern NSString * const MAPref_UseMinimumFontSize;
|
||||
extern NSString * const MAPref_AutoExpireDuration;
|
||||
extern NSString * const MAPref_DownloadItemList;
|
||||
extern NSString * const MAPref_ShowFolderImages;
|
||||
extern NSString * const MAPref_UseJavaScript;
|
||||
extern NSString * const MAPref_CachedArticleGUID;
|
||||
extern NSString * const MAPref_ArticleListSortOrders;
|
||||
extern NSString * const MAPref_FilterMode;
|
||||
extern NSString * const MAPref_LastRefreshDate;
|
||||
extern NSString * const MAPref_TabList;
|
||||
extern NSString * const MAPref_TabTitleDictionary;
|
||||
extern NSString * const MAPref_Layout;
|
||||
extern NSString * const MAPref_NewArticlesNotification;
|
||||
extern NSString * const MAPref_EmptyTrashNotification;
|
||||
extern NSString * const MAPref_ShowAppInStatusBar;
|
||||
extern NSString * const MAPref_ShowStatusBar;
|
||||
extern NSString * const MAPref_ShowFilterBar;
|
||||
extern NSString * const MAPref_LastViennaVersionRun;
|
||||
extern NSString * const MAPref_HighestViennaVersionRun;
|
||||
extern NSString * const MAPref_ShouldSaveFeedSource;
|
||||
extern NSString * const MAPref_ShouldSaveFeedSourceBackup;
|
||||
extern NSString * const MAPref_SearchMethod;
|
||||
extern NSString * const MAPref_SyncGoogleReader;
|
||||
extern NSString * const MAPref_GoogleNewSubscription;
|
||||
extern NSString * const MAPref_ConcurrentDownloads;
|
||||
extern NSString * const MAPref_SyncServer;
|
||||
extern NSString * const MAPref_SyncScheme;
|
||||
extern NSString * const MAPref_SyncingUser;
|
||||
extern NSString * const MAPref_SyncingAppId;
|
||||
extern NSString * const MAPref_SyncingAppKey;
|
||||
extern NSString * const MAPref_AlwaysAcceptBetas;
|
||||
extern NSString * const MAPref_UserAgentName;
|
||||
extern NSString * const MAPref_UseRelativeDates;
|
||||
extern NSString * const MAPref_ShowDetailsOnFeedCredentialsDialog;
|
||||
extern NSString * const MAPref_ShowEnclosureBar;
|
||||
extern NSString * const MAPref_FeedListSizeMode;
|
||||
extern NSString * const MAPref_ShowFeedsWithUnreadItemsInBold;
|
||||
|
||||
// Deprecated defaults keys
|
||||
extern NSString *const MAPref_Deprecated_ArticleListFont;
|
||||
extern NSString *const MAPref_Deprecated_ArticleListSortOrders;
|
||||
extern NSString *const MAPref_Deprecated_DownloadItemList;
|
||||
extern NSString *const MAPref_Deprecated_FolderFont;
|
||||
extern NSString *const MAPref_Deprecated_FolderListFont;
|
||||
|
||||
extern NSInteger const MA_Default_BackTrackQueueSize;
|
||||
extern NSInteger const MA_Default_RefreshThreads;
|
||||
extern float const MA_Default_Read_Interval;
|
||||
extern NSInteger const MA_Default_MinimumFontSize;
|
||||
extern NSInteger const MA_Default_AutoExpireDuration;
|
||||
extern NSInteger const MA_Default_Check_Frequency;
|
||||
extern CGFloat const MA_Default_Main_Window_Min_Width;
|
||||
extern CGFloat const MA_Default_Main_Window_Min_Height;
|
||||
extern NSInteger const MA_Default_ConcurrentDownloads;
|
||||
|
||||
extern NSPasteboardType const VNAPasteboardTypeRSSItem;
|
||||
|
||||
@@ -20,76 +20,103 @@
|
||||
|
||||
#import "Constants.h"
|
||||
|
||||
NSString * MA_DefaultUserAgentString = @"%@/%@ (Macintosh; Intel macOS %@)";
|
||||
NSString * MA_BrowserUserAgentString = @"(Macintosh; Intel Mac OS X %@) AppleWebKit/%@ (KHTML, like Gecko) Version/%@ Safari/604.1.38 %@/%@";
|
||||
NSString * const MA_DefaultUserAgentString = @"%@/%@ (Macintosh; Intel macOS %@)";
|
||||
NSString * const MA_BrowserUserAgentString = @"(Macintosh; Intel Mac OS X %@) AppleWebKit/%@ (KHTML, like Gecko) Version/%@ Safari/604.1.38 %@/%@";
|
||||
|
||||
NSString *const MAPref_ArticleListFont = @"ArticleListFont";
|
||||
NSString * MAPref_AutoSortFoldersTree = @"AutomaticallySortFoldersTree";
|
||||
NSString * MAPref_CheckForUpdatedArticles = @"CheckForUpdatedArticles";
|
||||
NSString * MAPref_ShowUnreadArticlesInBold = @"ShowUnreadArticlesInBold";
|
||||
NSString * MAPref_CachedFolderID = @"CachedFolderID";
|
||||
NSString * MAPref_DefaultDatabase = @"DefaultDatabase";
|
||||
NSString *const MAPref_DownloadsFolderBookmark = @"DownloadsFolderBookmark";
|
||||
NSString * MAPref_SortColumn = @"SortColumn";
|
||||
NSString * MAPref_CheckFrequency = @"CheckFrequencyInSeconds";
|
||||
NSString * MAPref_ArticleListColumns = @"MessageColumns";
|
||||
NSString * MAPref_CheckForNewArticlesOnStartup = @"CheckForNewMessagesOnStartup";
|
||||
NSString * MAPref_ActiveStyleName = @"ActiveStyle";
|
||||
NSString * MAPref_ActiveTextSizeMultiplier = @"TextSizeMultiplier";
|
||||
NSString * MAPref_FolderStates = @"FolderStates";
|
||||
NSString * MAPref_BacktrackQueueSize = @"BacktrackQueueSize";
|
||||
NSString * MAPref_MarkReadInterval = @"MarkReadInterval";
|
||||
NSString * MAPref_OpenLinksInVienna = @"OpenLinksInVienna";
|
||||
NSString * MAPref_OpenLinksInBackground = @"OpenLinksInBackground";
|
||||
NSString * MAPref_MinimumFontSize = @"MinimumFontSize";
|
||||
NSString * MAPref_UseMinimumFontSize = @"UseMinimumFontSize";
|
||||
NSString * MAPref_AutoExpireDuration = @"AutoExpireFrequency";
|
||||
NSString *const MAPref_DownloadItemList = @"DownloadItemsList";
|
||||
NSString * MAPref_ShowFolderImages = @"ShowFolderImages";
|
||||
NSString * MAPref_UseJavaScript = @"UseJavaScript";
|
||||
NSString * MAPref_CachedArticleGUID = @"CachedArticleGUID";
|
||||
NSString *const MAPref_ArticleListSortOrders = @"ArticleListSortOrders";
|
||||
NSString * MAPref_FilterMode = @"FilterMode";
|
||||
NSString * MAPref_LastRefreshDate = @"LastRefreshDate";
|
||||
NSString * MAPref_TabList = @"TabList";
|
||||
NSString * MAPref_TabTitleDictionary = @"TabTitleDict";
|
||||
NSString * MAPref_Layout = @"Layout";
|
||||
NSString * MAPref_NewArticlesNotification = @"NewArticlesNotification";
|
||||
NSString * MAPref_EmptyTrashNotification = @"EmptyTrashNotification";
|
||||
NSString * MAPref_ShowAppInStatusBar = @"ShowAppInStatusBar";
|
||||
NSString * MAPref_ShowStatusBar = @"ShowStatusBar";
|
||||
NSString * MAPref_ShowFilterBar = @"ShowFilterBar";
|
||||
NSString * MAPref_LastViennaVersionRun = @"LastViennaVersionRun";
|
||||
NSString * MAPref_HighestViennaVersionRun = @"HighestViennaVersionRun";
|
||||
NSString * MAPref_ShouldSaveFeedSource = @"ShouldSaveFeedSource";
|
||||
NSString * MAPref_ShouldSaveFeedSourceBackup = @"ShouldSaveFeedSourceBackup";
|
||||
NSString * MAPref_SearchMethod = @"SearchMethod";
|
||||
NSString * MAPref_SyncGoogleReader = @"SyncGoogleReader";
|
||||
NSString * MAPref_GoogleNewSubscription = @"GoogleNewSubscription";
|
||||
NSString * MAPref_ConcurrentDownloads = @"ConcurrentDownloads";
|
||||
NSString * MAPref_SyncServer = @"SyncServer";
|
||||
NSString * MAPref_SyncScheme = @"SyncScheme";
|
||||
NSString * MAPref_SyncingUser = @"SyncingUser";
|
||||
NSString * MAPref_SyncingAppId = @"SyncingAppId";
|
||||
NSString * MAPref_SyncingAppKey = @"SyncingAppKey";
|
||||
NSString * MAPref_AlwaysAcceptBetas = @"AlwayAcceptBetas";
|
||||
NSString * MAPref_UserAgentName = @"UserAgentName";
|
||||
NSNotificationName const MA_Notify_ArticleListContentChange = @"MA_Notify_ArticleListContentChange";
|
||||
NSNotificationName const MA_Notify_ArticleListFontChange = @"MA_Notify_ArticleListFontChange";
|
||||
NSNotificationName const MA_Notify_ArticleListStateChange = @"MA_Notify_ArticleListStateChange";
|
||||
NSNotificationName const MA_Notify_ArticleViewChange = @"MA_Notify_ArticleViewChange";
|
||||
NSNotificationName const MA_Notify_ArticleViewEnded = @"MA_Notify_ArticleViewEnded";
|
||||
NSNotificationName const MA_Notify_AutoSortFoldersTreeChange = @"MA_Notify_AutoSortFoldersTreeChange";
|
||||
NSNotificationName const MA_Notify_CancelAuthenticationForFolder = @"MA_Notify_CancelAuthenticationForFolder";
|
||||
NSNotificationName const MA_Notify_CellResize = @"MA_Notify_CellResize";
|
||||
NSNotificationName const MA_Notify_CheckFrequencyChange = @"MA_Notify_CheckFrequencyChange";
|
||||
NSNotificationName const MA_Notify_ConcurrentDownloadsChange = @"MA_Notify_ConcurrentDownloadsChange";
|
||||
NSNotificationName const MA_Notify_DownloadCompleted = @"MA_Notify_DownloadCompleted";
|
||||
NSNotificationName const MA_Notify_DownloadsListChange = @"MA_Notify_DownloadsListChange";
|
||||
NSNotificationName const MA_Notify_EditFolder = @"MA_Notify_EditFolder";
|
||||
NSNotificationName const MA_Notify_FilterBarChanged = @"MA_Notify_FilterBarChanged";
|
||||
NSNotificationName const MA_Notify_FolderAdded = @"MA_Notify_FolderAdded";
|
||||
NSNotificationName const MA_Notify_FolderDescriptionChanged = @"MA_Notify_FolderDescriptionChanged";
|
||||
NSNotificationName const MA_Notify_FolderHomePageChanged = @"MA_Notify_FolderHomePageChanged";
|
||||
NSNotificationName const MA_Notify_FolderNameChanged = @"MA_Notify_FolderNameChanged";
|
||||
NSNotificationName const MA_Notify_FolderSelectionChange = @"MA_Notify_FolderSelectionChange";
|
||||
NSNotificationName const MA_Notify_FoldersUpdated = @"MA_Notify_FoldersUpdated";
|
||||
NSNotificationName const MA_Notify_GoogleAuthFailed = @"MA_Notify_GoogleAuthFailed";
|
||||
NSNotificationName const MA_Notify_GoogleReaderNewSubscriptionChange = @"MA_Notify_GoogleReaderNewSubscriptionChange";
|
||||
NSNotificationName const MA_Notify_GotAuthenticationForFolder = @"MA_Notify_GotAuthenticationForFolder";
|
||||
NSNotificationName const MA_Notify_LoadFullHTMLChange = @"MA_Notify_LoadFullHTMLChange";
|
||||
NSNotificationName const MA_Notify_MinimumFontSizeChange = @"MA_Notify_MinimumFontSizeChange";
|
||||
NSNotificationName const MA_Notify_OpenReaderFolderChange = @"MA_Notify_OpenReaderFolderChange";
|
||||
NSNotificationName const MA_Notify_PreferenceChange = @"MA_Notify_PreferenceChange";
|
||||
NSNotificationName const MA_Notify_ReadingPaneChange = @"MA_Notify_ReadingPaneChange";
|
||||
NSNotificationName const MA_Notify_RefreshStatus = @"MA_Notify_RefreshStatus";
|
||||
NSNotificationName const MA_Notify_ShowAppInStatusBarChanged = @"MA_Notify_ShowAppInStatusBarChanged";
|
||||
NSNotificationName const MA_Notify_ShowFolderImages = @"MA_Notify_ShowFolderImages";
|
||||
NSNotificationName const MA_Notify_StyleChange = @"MA_Notify_StyleChange";
|
||||
NSNotificationName const MA_Notify_SyncGoogleReaderChange = @"MA_Notify_SyncGoogleReaderChange";
|
||||
NSNotificationName const MA_Notify_TabChanged = @"MA_Notify_TabChanged";
|
||||
NSNotificationName const MA_Notify_TabCountChanged = @"MA_Notify_TabCountChanged";
|
||||
NSNotificationName const MA_Notify_UseJavaScriptChange = @"MA_Notify_UseJavaScriptChange";
|
||||
|
||||
// Deprecated defaults keys
|
||||
NSString *const MAPref_Deprecated_ArticleListFont = @"MessageListFont";
|
||||
NSString *const MAPref_Deprecated_ArticleListSortOrders = @"ArticleSortDescriptors";
|
||||
NSString *const MAPref_Deprecated_DownloadItemList = @"DownloadsList";
|
||||
NSString *const MAPref_Deprecated_FolderFont = @"FolderFont";
|
||||
NSString *const MAPref_Deprecated_FolderListFont = @"FolderListFont";
|
||||
NSString * const MAPref_ArticleListFont = @"ArticleListFont";
|
||||
NSString * const MAPref_AutoSortFoldersTree = @"AutomaticallySortFoldersTree";
|
||||
NSString * const MAPref_CheckForUpdatedArticles = @"CheckForUpdatedArticles";
|
||||
NSString * const MAPref_ShowUnreadArticlesInBold = @"ShowUnreadArticlesInBold";
|
||||
NSString * const MAPref_CachedFolderID = @"CachedFolderID";
|
||||
NSString * const MAPref_DefaultDatabase = @"DefaultDatabase";
|
||||
NSString * const MAPref_DownloadsFolderBookmark = @"DownloadsFolderBookmark";
|
||||
NSString * const MAPref_SortColumn = @"SortColumn";
|
||||
NSString * const MAPref_CheckFrequency = @"CheckFrequencyInSeconds";
|
||||
NSString * const MAPref_ArticleListColumns = @"MessageColumns";
|
||||
NSString * const MAPref_CheckForNewArticlesOnStartup = @"CheckForNewMessagesOnStartup";
|
||||
NSString * const MAPref_ActiveStyleName = @"ActiveStyle";
|
||||
NSString * const MAPref_ActiveTextSizeMultiplier = @"TextSizeMultiplier";
|
||||
NSString * const MAPref_FolderStates = @"FolderStates";
|
||||
NSString * const MAPref_BacktrackQueueSize = @"BacktrackQueueSize";
|
||||
NSString * const MAPref_MarkReadInterval = @"MarkReadInterval";
|
||||
NSString * const MAPref_OpenLinksInVienna = @"OpenLinksInVienna";
|
||||
NSString * const MAPref_OpenLinksInBackground = @"OpenLinksInBackground";
|
||||
NSString * const MAPref_MinimumFontSize = @"MinimumFontSize";
|
||||
NSString * const MAPref_UseMinimumFontSize = @"UseMinimumFontSize";
|
||||
NSString * const MAPref_AutoExpireDuration = @"AutoExpireFrequency";
|
||||
NSString * const MAPref_DownloadItemList = @"DownloadItemsList";
|
||||
NSString * const MAPref_ShowFolderImages = @"ShowFolderImages";
|
||||
NSString * const MAPref_UseJavaScript = @"UseJavaScript";
|
||||
NSString * const MAPref_CachedArticleGUID = @"CachedArticleGUID";
|
||||
NSString * const MAPref_ArticleListSortOrders = @"ArticleListSortOrders";
|
||||
NSString * const MAPref_FilterMode = @"FilterMode";
|
||||
NSString * const MAPref_LastRefreshDate = @"LastRefreshDate";
|
||||
NSString * const MAPref_TabList = @"TabList";
|
||||
NSString * const MAPref_TabTitleDictionary = @"TabTitleDict";
|
||||
NSString * const MAPref_Layout = @"Layout";
|
||||
NSString * const MAPref_NewArticlesNotification = @"NewArticlesNotification";
|
||||
NSString * const MAPref_EmptyTrashNotification = @"EmptyTrashNotification";
|
||||
NSString * const MAPref_ShowAppInStatusBar = @"ShowAppInStatusBar";
|
||||
NSString * const MAPref_ShowStatusBar = @"ShowStatusBar";
|
||||
NSString * const MAPref_ShowFilterBar = @"ShowFilterBar";
|
||||
NSString * const MAPref_LastViennaVersionRun = @"LastViennaVersionRun";
|
||||
NSString * const MAPref_HighestViennaVersionRun = @"HighestViennaVersionRun";
|
||||
NSString * const MAPref_ShouldSaveFeedSource = @"ShouldSaveFeedSource";
|
||||
NSString * const MAPref_ShouldSaveFeedSourceBackup = @"ShouldSaveFeedSourceBackup";
|
||||
NSString * const MAPref_SearchMethod = @"SearchMethod";
|
||||
NSString * const MAPref_SyncGoogleReader = @"SyncGoogleReader";
|
||||
NSString * const MAPref_GoogleNewSubscription = @"GoogleNewSubscription";
|
||||
NSString * const MAPref_ConcurrentDownloads = @"ConcurrentDownloads";
|
||||
NSString * const MAPref_SyncServer = @"SyncServer";
|
||||
NSString * const MAPref_SyncScheme = @"SyncScheme";
|
||||
NSString * const MAPref_SyncingUser = @"SyncingUser";
|
||||
NSString * const MAPref_SyncingAppId = @"SyncingAppId";
|
||||
NSString * const MAPref_SyncingAppKey = @"SyncingAppKey";
|
||||
NSString * const MAPref_AlwaysAcceptBetas = @"AlwayAcceptBetas";
|
||||
NSString * const MAPref_UserAgentName = @"UserAgentName";
|
||||
|
||||
NSInteger const MA_Default_BackTrackQueueSize = 20;
|
||||
NSInteger const MA_Default_RefreshThreads = 20;
|
||||
NSInteger const MA_Default_MinimumFontSize = 9;
|
||||
float const MA_Default_Read_Interval = 0.5;
|
||||
NSInteger const MA_Default_AutoExpireDuration = 0;
|
||||
NSInteger const MA_Default_Check_Frequency = 10800;
|
||||
CGFloat const MA_Default_Main_Window_Min_Width = 700.0;
|
||||
CGFloat const MA_Default_Main_Window_Min_Height = 350.0;
|
||||
NSInteger const MA_Default_ConcurrentDownloads = 10;
|
||||
|
||||
// Constants for External Weblog Editor Interface according to http://ranchero.com/netnewswire/developers/externalinterface.php
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#import "ArticleConverter.h"
|
||||
#import "ArticleListView.h"
|
||||
#import "ArticleViewDelegate.h"
|
||||
#import "Constants.h"
|
||||
#import "DisclosureView.h"
|
||||
#import "Feed.h"
|
||||
#import "FeedItem.h"
|
||||
|
||||
Reference in New Issue
Block a user