Skip to content

Commit

Permalink
Fixed a bug that stops one to create a bbookmark in an empty folder.
Browse files Browse the repository at this point in the history
git-svn-id: https://iterm.svn.sourceforge.net/svnroot/iterm/trunk@1657 a86d2aa4-6e2d-4ff4-9c10-3c044852e7c9
  • Loading branch information
yfabian committed Oct 2, 2008
1 parent 7368889 commit a6a7d73
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
3 changes: 3 additions & 0 deletions Changelog
@@ -1,6 +1,9 @@
2009-09-30 fabian

* Bookmark sort now an option.
* Folder name in bookmarks window is now editable.
* Double-clicking folder names to expand/collapse them.
* Fixed a bug that stops one to create a bbookmark in an empty folder.

2009-09-29 fabian

Expand Down
32 changes: 17 additions & 15 deletions iTermBookmarkController.m
Expand Up @@ -274,21 +274,23 @@ - (IBAction) addBookmark: (id) sender

if ([bookmarksView selectedRow]!=-1) {
id selectedItem = [bookmarksView itemAtRow: [bookmarksView selectedRow]];
NSString *terminalProfile = [[ITAddressBookMgr sharedInstance] objectForKey: KEY_TERMINAL_PROFILE inItem: selectedItem];
NSString *keyboardProfile = [[ITAddressBookMgr sharedInstance] objectForKey: KEY_KEYBOARD_PROFILE inItem: selectedItem];
NSString *displayProfile = [[ITAddressBookMgr sharedInstance] objectForKey: KEY_DISPLAY_PROFILE inItem: selectedItem];

if([bookmarkTerminalProfile indexOfItemWithTitle: terminalProfile] < 0)
terminalProfile = NSLocalizedStringFromTableInBundle(@"Default",@"iTerm", [NSBundle bundleForClass: [self class]], @"Terminal Profiles");
[bookmarkTerminalProfile selectItemWithTitle: terminalProfile];

if([bookmarkKeyboardProfile indexOfItemWithTitle: keyboardProfile] < 0)
keyboardProfile = NSLocalizedStringFromTableInBundle(@"Global",@"iTerm", [NSBundle bundleForClass: [self class]], @"Key Binding Profiles");
[bookmarkKeyboardProfile selectItemWithTitle: keyboardProfile];

if([bookmarkDisplayProfile indexOfItemWithTitle: displayProfile] < 0)
displayProfile = NSLocalizedStringFromTableInBundle(@"Default",@"iTerm", [NSBundle bundleForClass: [self class]], @"Display Profiles");
[bookmarkDisplayProfile selectItemWithTitle: displayProfile];
if ([selectedItem isLeaf]) {
NSString *terminalProfile = [[ITAddressBookMgr sharedInstance] objectForKey: KEY_TERMINAL_PROFILE inItem: selectedItem];
NSString *keyboardProfile = [[ITAddressBookMgr sharedInstance] objectForKey: KEY_KEYBOARD_PROFILE inItem: selectedItem];
NSString *displayProfile = [[ITAddressBookMgr sharedInstance] objectForKey: KEY_DISPLAY_PROFILE inItem: selectedItem];

if([bookmarkTerminalProfile indexOfItemWithTitle: terminalProfile] < 0)
terminalProfile = NSLocalizedStringFromTableInBundle(@"Default",@"iTerm", [NSBundle bundleForClass: [self class]], @"Terminal Profiles");
[bookmarkTerminalProfile selectItemWithTitle: terminalProfile];

if([bookmarkKeyboardProfile indexOfItemWithTitle: keyboardProfile] < 0)
keyboardProfile = NSLocalizedStringFromTableInBundle(@"Global",@"iTerm", [NSBundle bundleForClass: [self class]], @"Key Binding Profiles");
[bookmarkKeyboardProfile selectItemWithTitle: keyboardProfile];

if([bookmarkDisplayProfile indexOfItemWithTitle: displayProfile] < 0)
displayProfile = NSLocalizedStringFromTableInBundle(@"Default",@"iTerm", [NSBundle bundleForClass: [self class]], @"Display Profiles");
[bookmarkDisplayProfile selectItemWithTitle: displayProfile];
}
}

[NSApp beginSheet: editBookmarkPanel
Expand Down

0 comments on commit a6a7d73

Please sign in to comment.