Permalink
Browse files

Make URL support for loading prefs explicit in ui. Improve error mess…

…age on failed URL prefs load. Fix URL prefs loading.
  • Loading branch information...
1 parent beb1c87 commit 247a06e3114ba139b462970dd81c6a6043fcbcba @gnachman gnachman committed Aug 11, 2011
Showing with 12 additions and 10 deletions.
  1. +6 −6 English.lproj/PreferencePanel.xib
  2. +5 −3 PreferencePanel.m
  3. +1 −1 iTermApplicationDelegate.m
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="1947"/>
+ <integer value="1924"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -973,13 +973,13 @@
<object class="NSButton" id="731675876">
<reference key="NSNextResponder" ref="505411774"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{64, 54}, {261, 18}}</string>
+ <string key="NSFrame">{{64, 54}, {354, 18}}</string>
<reference key="NSSuperview" ref="505411774"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="71661080">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">0</int>
- <string key="NSContents">Load preferences from custom folder:</string>
+ <string key="NSContents">Load preferences from a user-defined folder or URL:</string>
<reference key="NSSupport" ref="966507434"/>
<reference key="NSControlView" ref="731675876"/>
<int key="NSButtonFlags">1211912703</int>
@@ -1032,13 +1032,13 @@
<object class="NSButton" id="916346445">
<reference key="NSNextResponder" ref="505411774"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{434, 20}, {234, 32}}</string>
+ <string key="NSFrame">{{434, 20}, {184, 32}}</string>
<reference key="NSSuperview" ref="505411774"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="53419469">
- <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Copy Curent Settings to Folder</string>
+ <string key="NSContents">Save Settings to Folder</string>
<reference key="NSSupport" ref="966507434"/>
<reference key="NSControlView" ref="916346445"/>
<int key="NSButtonFlags">-2038284033</int>
View
@@ -1255,7 +1255,7 @@ - (void)run
[showWindowBorder setState:defaultShowWindowBorder?NSOnState:NSOffState];
[lionStyleFullscreen setState:defaultLionStyleFullscreen?NSOnState:NSOffState];
[loadPrefsFromCustomFolder setState:defaultLoadPrefsFromCustomFolder?NSOnState:NSOffState];
- [prefsCustomFolder setStringValue:defaultPrefsCustomFolder];
+ [prefsCustomFolder setStringValue:defaultPrefsCustomFolder ? defaultPrefsCustomFolder : @""];
[self showWindow: self];
[[self window] setLevel:NSNormalWindowLevel];
@@ -1910,8 +1910,10 @@ - (BOOL)loadPrefs
if ([folder hasPrefix:@"http://"] ||
[folder hasPrefix:@"https://"]) {
+ filename = folder;
+
// Download the URL's contents.
- NSURL *url = [NSURL URLWithString:folder];
+ NSURL *url = [NSURL URLWithString:filename];
const NSTimeInterval kFetchTimeout = 5.0;
NSURLRequest *req = [NSURLRequest requestWithURL:url
cachePolicy:NSURLRequestUseProtocolCachePolicy
@@ -2679,7 +2681,7 @@ - (IBAction)pushToCustomFolder:(id)sender
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
- informativeTextWithFormat:@"To make it available, manually copy ~/Library/Preferences/com.googlecode.iterm2.plist to your hosting provider to be served at %@", folder] runModal];
+ informativeTextWithFormat:@"To make it available, first quit iTerm2 and then manually copy ~/Library/Preferences/com.googlecode.iterm2.plist to your hosting provider."] runModal];
return;
}
isOk = [myDict writeToFile:filename atomically:YES];
@@ -92,8 +92,8 @@ - (void)applicationWillFinishLaunching:(NSNotification *)aNotification
// read preferences
[PreferencePanel migratePreferences];
- [ITAddressBookMgr sharedInstance];
[PreferencePanel sharedInstance];
+ [ITAddressBookMgr sharedInstance];
[self setFutureApplicationPresentationOptions:NSApplicationPresentationFullScreen unset:0];
}

0 comments on commit 247a06e

Please sign in to comment.