Sync after choose bbsmenu URL
@@ -87,7 +87,7 @@ | ||
87 | 87 | </dict> |
88 | 88 | </array> |
89 | 89 | <key>CFBundleVersion</key> |
90 | - <string>772</string> | |
90 | + <string>773</string> | |
91 | 91 | <key>LSMinimumSystemVersion</key> |
92 | 92 | <string>10.7.5</string> |
93 | 93 | <key>NSAppleScriptEnabled</key> |
@@ -28,74 +28,71 @@ | ||
28 | 28 | return kABSLocalizableStringsFileNameKey; |
29 | 29 | } |
30 | 30 | |
31 | -- (id) init | |
31 | +- (id)init | |
32 | 32 | { |
33 | - if (self = [super initWithWindowNibName : kABSNibFileNameKey]) { | |
33 | + if (self = [super initWithWindowNibName:kABSNibFileNameKey]) { | |
34 | 34 | ; |
35 | 35 | } |
36 | 36 | return self; |
37 | 37 | } |
38 | 38 | |
39 | -- (void) dealloc | |
39 | +- (void)dealloc | |
40 | 40 | { |
41 | - [[NSNotificationCenter defaultCenter] removeObserver : self]; | |
41 | + [[NSNotificationCenter defaultCenter] removeObserver:self]; | |
42 | 42 | [_currentSearchStr release]; |
43 | 43 | [super dealloc]; |
44 | 44 | } |
45 | 45 | |
46 | -- (void) awakeFromNib | |
46 | +- (void)awakeFromNib | |
47 | 47 | { |
48 | - [[NSNotificationCenter defaultCenter] | |
49 | - addObserver : self | |
50 | - selector : @selector(boardListDidChange:) | |
51 | - name : CMRBBSListDidChangeNotification | |
52 | - object : [[BoardManager defaultManager] defaultList]]; | |
48 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(boardListDidChange:) name:CMRBBSListDidChangeNotification object:[[BoardManager defaultManager] defaultList]]; | |
49 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(defaultListDidSync:) name:BoardWarriorDidFinishSyncingNotification object:[BoardWarrior warrior]]; | |
53 | 50 | |
54 | - [[self defaultListOLView] setDataSource : [[BoardManager defaultManager] defaultList]]; | |
55 | - [[self defaultListOLView] setAutoresizesOutlineColumn : NO]; | |
56 | - [[self defaultListOLView] setVerticalMotionCanBeginDrag : NO]; | |
57 | - [[self defaultListOLView] setDoubleAction: @selector(doAddAndClose:)]; | |
58 | - [[self OKButton] setEnabled : NO]; | |
51 | + [[self defaultListOLView] setDataSource:[[BoardManager defaultManager] defaultList]]; | |
52 | + [[self defaultListOLView] setAutoresizesOutlineColumn:NO]; | |
53 | + [[self defaultListOLView] setVerticalMotionCanBeginDrag:NO]; | |
54 | + [[self defaultListOLView] setDoubleAction:@selector(doAddAndClose:)]; | |
55 | + [[self OKButton] setEnabled:NO]; | |
59 | 56 | } |
60 | 57 | |
61 | 58 | #pragma mark Accessors |
62 | 59 | |
63 | -- (NSOutlineView *) defaultListOLView | |
60 | +- (NSOutlineView *)defaultListOLView | |
64 | 61 | { |
65 | 62 | return m_defaultListOLView; |
66 | 63 | } |
67 | -- (NSSearchField *) searchField | |
64 | +- (NSSearchField *)searchField | |
68 | 65 | { |
69 | 66 | return m_searchField; |
70 | 67 | } |
71 | 68 | |
72 | -- (NSTextFieldCell *) brdNameField | |
69 | +- (NSTextFieldCell *)brdNameField | |
73 | 70 | { |
74 | 71 | return m_brdNameField; |
75 | 72 | } |
76 | -- (NSTextFieldCell *) brdURLField | |
73 | +- (NSTextFieldCell *)brdURLField | |
77 | 74 | { |
78 | 75 | return m_brdURLField; |
79 | 76 | } |
80 | 77 | |
81 | -- (NSButton *) OKButton | |
78 | +- (NSButton *)OKButton | |
82 | 79 | { |
83 | 80 | return m_OKButton; |
84 | 81 | } |
85 | -- (NSButton *) cancelButton | |
82 | +- (NSButton *)cancelButton | |
86 | 83 | { |
87 | 84 | return m_cancelButton; |
88 | 85 | } |
89 | -- (NSButton *) helpButton | |
86 | +- (NSButton *)helpButton | |
90 | 87 | { |
91 | 88 | return m_helpButton; |
92 | 89 | } |
93 | 90 | |
94 | -- (NSString *) currentSearchStr | |
91 | +- (NSString *)currentSearchStr | |
95 | 92 | { |
96 | 93 | return _currentSearchStr; |
97 | 94 | } |
98 | -- (void) setCurrentSearchStr : (NSString *) newStr | |
95 | +- (void)setCurrentSearchStr:(NSString *)newStr | |
99 | 96 | { |
100 | 97 | [newStr retain]; |
101 | 98 | [_currentSearchStr release]; |
@@ -104,7 +101,7 @@ | ||
104 | 101 | |
105 | 102 | #pragma mark IBActions |
106 | 103 | |
107 | -- (IBAction) searchBoards : (id) sender | |
104 | +- (IBAction)searchBoards:(id)sender | |
108 | 105 | { |
109 | 106 | [self showMatchedItemsWithCurrentSearchStr]; |
110 | 107 | } |
@@ -114,9 +111,8 @@ | ||
114 | 111 | [[NSHelpManager sharedHelpManager] openHelpAnchor:[self localizedString:@"Boards list"] inBook:[NSBundle applicationHelpBookName]]; |
115 | 112 | } |
116 | 113 | |
117 | -- (IBAction)syncDefaultList:(id)sender; | |
114 | +- (IBAction)syncDefaultList:(id)sender | |
118 | 115 | { |
119 | - [[BoardWarrior warrior] setDelegate:self]; | |
120 | 116 | [[BoardWarrior warrior] syncBoardLists]; |
121 | 117 | } |
122 | 118 |
@@ -125,17 +121,6 @@ | ||
125 | 121 | [[CMRPref sharedPreferencesPane] showPreferencesPaneWithIdentifier:PPAdvancedPreferencesIdentifier]; |
126 | 122 | } |
127 | 123 | |
128 | -- (void)warriorDidFinishSyncing:(BoardWarrior *)warrior | |
129 | -{ | |
130 | - [[self defaultListOLView] reloadData]; | |
131 | - [warrior setDelegate:nil]; | |
132 | -} | |
133 | - | |
134 | -- (void)warrior:(BoardWarrior *)warrior didFailSync:(NSError *)error | |
135 | -{ | |
136 | - [warrior setDelegate:nil]; | |
137 | -} | |
138 | - | |
139 | 124 | - (IBAction) close : (id) sender |
140 | 125 | { |
141 | 126 | [NSApp endSheet : [self window] |
@@ -418,4 +403,9 @@ | ||
418 | 403 | [self showMatchedItemsWithCurrentSearchStr]; |
419 | 404 | } |
420 | 405 | } |
406 | + | |
407 | +- (void)defaultListDidSync:(NSNotification *)notification | |
408 | +{ | |
409 | + [[self defaultListOLView] reloadData]; | |
410 | +} | |
421 | 411 | @end |
@@ -3,11 +3,12 @@ | ||
3 | 3 | // BathyScaphe |
4 | 4 | // |
5 | 5 | // Created by Tsutomu Sawada on 06/08/06. |
6 | -// Copyright 2006-2010 BathyScaphe Project. All rights reserved. | |
6 | +// Copyright 2006-2015 BathyScaphe Project. All rights reserved. | |
7 | 7 | // encoding="UTF-8" |
8 | 8 | // |
9 | 9 | |
10 | 10 | #import <Foundation/Foundation.h> |
11 | +#import <AppKit/NSApplication.h> // For NSModalSession... | |
11 | 12 | |
12 | 13 | @class BSURLDownload, BSModalStatusWindowController; |
13 | 14 |
@@ -49,3 +50,5 @@ | ||
49 | 50 | @end |
50 | 51 | |
51 | 52 | extern NSString *const kBoardWarriorErrorDomain; |
53 | + | |
54 | +extern NSString *const BoardWarriorDidFinishSyncingNotification; |
@@ -3,7 +3,7 @@ | ||
3 | 3 | // BathyScaphe |
4 | 4 | // |
5 | 5 | // Created by Tsutomu Sawada on 06/08/06. |
6 | -// Copyright 2006-2014 BathyScaphe Project. All rights reserved. | |
6 | +// Copyright 2006-2015 BathyScaphe Project. All rights reserved. | |
7 | 7 | // encoding="UTF-8" |
8 | 8 | // |
9 | 9 |
@@ -19,6 +19,8 @@ | ||
19 | 19 | |
20 | 20 | NSString *const kBoardWarriorErrorDomain = @"BoardWarriorErrorDomain"; |
21 | 21 | |
22 | +NSString *const BoardWarriorDidFinishSyncingNotification = @"jp.tsawada2.BathyScaphe.BoardWarriorDidFinishSyncingNotification"; | |
23 | + | |
22 | 24 | static NSString *const kBWLocalizedStringsTableName = @"BoardWarrior"; |
23 | 25 | |
24 | 26 | //static NSString *const kBWLogFolderName = @"Logs"; |
@@ -297,6 +299,7 @@ | ||
297 | 299 | if ([self delegateRespondsToSelector:@selector(warriorDidFinishSyncing:)]) { |
298 | 300 | [[self delegate] warriorDidFinishSyncing:self]; |
299 | 301 | } |
302 | + UTILNotifyName(BoardWarriorDidFinishSyncingNotification); | |
300 | 303 | } |
301 | 304 | |
302 | 305 | - (BOOL)createLogFileIfNeededAtPath:(NSString *)filePath |
@@ -21,7 +21,7 @@ | ||
21 | 21 | <key>CFBundleSignature</key> |
22 | 22 | <string>????</string> |
23 | 23 | <key>CFBundleVersion</key> |
24 | - <string>120</string> | |
24 | + <string>121</string> | |
25 | 25 | <key>NSHumanReadableCopyright</key> |
26 | 26 | <string>© 2005-2015 tsawada2 & BathyScaphe Project</string> |
27 | 27 | <key>NSMainNibFile</key> |
@@ -14,7 +14,11 @@ | ||
14 | 14 | static NSString *const kAdvancedPaneToolTipKey = @"Advanced ToolTip"; |
15 | 15 | static NSString *const kAdvancedPaneHelpAnchorKey = @"Help_Advanced"; |
16 | 16 | |
17 | +@interface NSObject(CMRAppDelegateStub) | |
18 | +- (void)runBoardWarrior:(id)sender; | |
19 | +@end | |
17 | 20 | |
21 | + | |
18 | 22 | @implementation AdvancedPrefController |
19 | 23 | - (NSString *)mainNibName |
20 | 24 | { |
@@ -53,8 +57,22 @@ | ||
53 | 57 | return; |
54 | 58 | } |
55 | 59 | |
56 | - [[self preferences] setBBSMenuURL:[NSURL URLWithString:typedText]]; | |
60 | + [[self preferences] setBBSMenuURL:[NSURL URLWithString:typedText]]; | |
61 | + [self performSelector:@selector(showConfirmSyncAlert:) withObject:sender afterDelay:0.3]; | |
57 | 62 | } |
63 | + | |
64 | +- (void)showConfirmSyncAlert:(id)sender | |
65 | +{ | |
66 | + NSAlert *alert = [[[NSAlert alloc] init] autorelease]; | |
67 | + [alert setAlertStyle:NSInformationalAlertStyle]; | |
68 | + [alert setMessageText:PPLocalizedString(@"Confirm Sync Alert Message")]; | |
69 | + [alert setInformativeText:PPLocalizedString(@"Confirm Sync Alert Informative")]; | |
70 | + [alert addButtonWithTitle:PPLocalizedString(@"Confirm Sync Alert OK")]; | |
71 | + [alert addButtonWithTitle:PPLocalizedString(@"Confirm Sync Alert Not Yet")]; | |
72 | + if ([alert runModal] == NSAlertFirstButtonReturn) { | |
73 | + [[NSApp delegate] runBoardWarrior:sender]; | |
74 | + } | |
75 | +} | |
58 | 76 | @end |
59 | 77 | |
60 | 78 |
@@ -1,3 +1,9 @@ | ||
1 | +2015-02-27 tsawada2 <tsawada2@users.sourceforge.jp> | |
2 | + * application/source/bbs/BoardWarrior.m | |
3 | + * application/source/browser/AddBoardSheetController.m | |
4 | + * application/subproj/preference/AdvancedPrefController.m | |
5 | + * application/subproj/preference/ja.lproj/Localizable.strings | |
6 | + 「詳細」環境設定で掲示板リストの同期先を変更した際、すぐに同期が行えるようにした。 | |
1 | 7 | 2015-02-26 tsawada2 <tsawada2@users.sourceforge.jp> |
2 | 8 | * application/source/manager/BSSSSPIconManager.m |
3 | 9 | * application/source/preferences/AppDefaults-BoardWarrior.m |