Skip to content
Snippets Groups Projects
Commit 65eceab2 authored by George Nachman's avatar George Nachman
Browse files

Improved BookmarkListView interface. Add toolbelt menu item. Add pref to show...

Improved BookmarkListView interface. Add toolbelt menu item. Add pref to show drawer. Add modifier + click to profiles. Save toolbelt prefs.
parent 402cf0e1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -78,8 +78,13 @@
@end
 
@protocol BookmarkTableDelegate
@optional
- (void)bookmarkTableSelectionDidChange:(id)bookmarkTable;
@optional
- (void)bookmarkTableSelectionWillChange:(id)bookmarkTable;
@optional
- (void)bookmarkTableRowSelected:(id)bookmarkTable;
 
@optional
Loading
Loading
@@ -96,7 +101,7 @@
NSTableColumn* shortcutColumn_;
NSTableColumn* starColumn_;
NSTableColumn* tagsColumn_;
id<BookmarkTableDelegate> delegate_;
NSObject<BookmarkTableDelegate> *delegate_;
BOOL showGraphic_;
NSSet* selectedGuids_;
BOOL debug;
Loading
Loading
@@ -106,7 +111,7 @@
- (void)awakeFromNib;
- (id)initWithFrame:(NSRect)frameRect;
- (id)initWithFrame:(NSRect)frameRect model:(BookmarkModel*)dataSource;
- (void)setDelegate:(id<BookmarkTableDelegate>)delegate;
- (void)setDelegate:(NSObject<BookmarkTableDelegate> *)delegate;
- (void)dealloc;
- (BookmarkModelWrapper*)dataSource;
- (void)setUnderlyingDatasource:(BookmarkModel*)dataSource;
Loading
Loading
Loading
Loading
@@ -516,7 +516,7 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
[super dealloc];
}
 
- (void)setDelegate:(id<BookmarkTableDelegate>)delegate
- (void)setDelegate:(NSObject<BookmarkTableDelegate> *)delegate
{
delegate_ = delegate;
}
Loading
Loading
@@ -669,7 +669,7 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
 
- (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView
{
if (delegate_) {
if (delegate_ && [delegate_ respondsToSelector:@selector(bookmarkTableSelectionWillChange:)]) {
[delegate_ bookmarkTableSelectionWillChange:self];
}
return YES;
Loading
Loading
@@ -678,7 +678,7 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
- (void)tableViewSelectionIsChanging:(NSNotification *)aNotification
{
// Mouse is being dragged across rows
if (delegate_) {
if (delegate_ && [delegate_ respondsToSelector:@selector(bookmarkTableSelectionDidChange:)]) {
[delegate_ bookmarkTableSelectionDidChange:self];
}
[selectedGuids_ release];
Loading
Loading
@@ -699,7 +699,7 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
{
// There was a click on a row
if (delegate_) {
if (delegate_ && [delegate_ respondsToSelector:@selector(bookmarkTableSelectionDidChange:)]) {
[delegate_ bookmarkTableSelectionDidChange:self];
}
[selectedGuids_ release];
Loading
Loading
@@ -723,7 +723,9 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
[selectedGuids_ release];
selectedGuids_ = [self selectedGuids];
[selectedGuids_ retain];
[delegate_ bookmarkTableSelectionDidChange:self];
if ([delegate_ respondsToSelector:@selector(bookmarkTableSelectionDidChange:)]) {
[delegate_ bookmarkTableSelectionDidChange:self];
}
}
}
 
Loading
Loading
@@ -888,7 +890,7 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
 
- (void)onDoubleClick:(id)sender
{
if (delegate_) {
if (delegate_ && [delegate_ respondsToSelector:@selector(bookmarkTableRowSelected:)]) {
[delegate_ bookmarkTableRowSelected:self];
}
}
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="81"/>
<integer value="1296"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Loading
Loading
@@ -1108,6 +1108,39 @@
</object>
</object>
</object>
<object class="NSMenuItem" id="993218471">
<reference key="NSMenu" ref="748181631"/>
<string key="NSTitle">Toolbelt</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="643967552"/>
<reference key="NSMixedImage" ref="326707852"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="995507743">
<string key="NSTitle">Toolbelt</string>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMenuItem" id="84547479">
<reference key="NSMenu" ref="995507743"/>
<string key="NSTitle">Show Toolbelt</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="643967552"/>
<reference key="NSMixedImage" ref="326707852"/>
</object>
<object class="NSMenuItem" id="619463907">
<reference key="NSMenu" ref="995507743"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="643967552"/>
<reference key="NSMixedImage" ref="326707852"/>
</object>
</object>
</object>
</object>
<object class="NSMenuItem" id="914464345">
<reference key="NSMenu" ref="748181631"/>
<string key="NSTitle">Window</string>
Loading
Loading
@@ -2917,6 +2950,30 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
</object>
<int key="connectionID">1294</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">toolbeltMenu</string>
<reference key="source" ref="608955146"/>
<reference key="destination" ref="995507743"/>
</object>
<int key="connectionID">1299</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">toggleToolbelt:</string>
<reference key="source" ref="608955146"/>
<reference key="destination" ref="84547479"/>
</object>
<int key="connectionID">1300</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">showToolbeltItem</string>
<reference key="source" ref="608955146"/>
<reference key="destination" ref="84547479"/>
</object>
<int key="connectionID">1301</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Loading
Loading
@@ -2959,6 +3016,7 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<reference ref="549291896"/>
<reference ref="1015666104"/>
<reference ref="800408560"/>
<reference ref="993218471"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">MainMenu</string>
Loading
Loading
@@ -4088,6 +4146,35 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<reference key="object" ref="353438768"/>
<reference key="parent" ref="360861402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1295</int>
<reference key="object" ref="993218471"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="995507743"/>
</object>
<reference key="parent" ref="748181631"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1296</int>
<reference key="object" ref="995507743"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="84547479"/>
<reference ref="619463907"/>
</object>
<reference key="parent" ref="993218471"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1297</int>
<reference key="object" ref="84547479"/>
<reference key="parent" ref="995507743"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1298</int>
<reference key="object" ref="619463907"/>
<reference key="parent" ref="995507743"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
Loading
Loading
@@ -4098,6 +4185,7 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>-2.IBPluginDependency</string>
<string>-3.IBPluginDependency</string>
<string>103.IBPluginDependency</string>
<string>106.IBEditorWindowLastContentRect</string>
<string>106.IBPluginDependency</string>
<string>1061.IBPluginDependency</string>
<string>1063.IBPluginDependency</string>
Loading
Loading
@@ -4162,6 +4250,11 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>1289.IBPluginDependency</string>
<string>129.IBPluginDependency</string>
<string>1291.IBPluginDependency</string>
<string>1295.IBPluginDependency</string>
<string>1296.IBEditorWindowLastContentRect</string>
<string>1296.IBPluginDependency</string>
<string>1297.IBPluginDependency</string>
<string>1298.IBPluginDependency</string>
<string>130.IBPluginDependency</string>
<string>131.IBPluginDependency</string>
<string>134.IBPluginDependency</string>
Loading
Loading
@@ -4292,6 +4385,7 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{367, 802}, {155, 23}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
Loading
Loading
@@ -4357,6 +4451,11 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{296, 792}, {148, 33}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
Loading
Loading
@@ -4386,7 +4485,7 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>{{296, 482}, {298, 343}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{0, 825}, {428, 20}}</string>
<string>{{0, 825}, {502, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{247, 159}, {354, 164}}</string>
Loading
Loading
@@ -4497,11 +4596,19 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">1294</int>
<int key="maxID">1301</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">BottomBarView</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="129658084">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Headers/iTerm/PseudoTerminal.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">FakeWindow</string>
<string key="superclassName">NSObject</string>
Loading
Loading
@@ -4771,6 +4878,13 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string key="minorKey">PSMTabBarControl/source/PSMTabBarControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">FutureMethods.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="694607604">
Loading
Loading
@@ -5399,10 +5513,95 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Headers/iTerm/PseudoTerminal.h</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>commandField</string>
<string>currentTime</string>
<string>earliestTime</string>
<string>instantReplaySubview</string>
<string>irSlider</string>
<string>latestTime</string>
<string>parameterName</string>
<string>parameterPanel</string>
<string>parameterPrompt</string>
<string>parameterValue</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>NSTextField</string>
<string>NSTextField</string>
<string>BottomBarView</string>
<string>NSSlider</string>
<string>NSTextField</string>
<string>NSTextField</string>
<string>NSPanel</string>
<string>NSTextField</string>
<string>NSTextField</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>commandField</string>
<string>currentTime</string>
<string>earliestTime</string>
<string>instantReplaySubview</string>
<string>irSlider</string>
<string>latestTime</string>
<string>parameterName</string>
<string>parameterPanel</string>
<string>parameterPrompt</string>
<string>parameterValue</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">commandField</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">currentTime</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">earliestTime</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">instantReplaySubview</string>
<string key="candidateClassName">BottomBarView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">irSlider</string>
<string key="candidateClassName">NSSlider</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">latestTime</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">parameterName</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">parameterPanel</string>
<string key="candidateClassName">NSPanel</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">parameterPrompt</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">parameterValue</string>
<string key="candidateClassName">NSTextField</string>
</object>
</object>
</object>
<reference key="sourceIdentifier" ref="129658084"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">iTermAboutWindow</string>
Loading
Loading
@@ -5452,6 +5651,7 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>smallerFont:</string>
<string>toggleFullScreenTabBar:</string>
<string>toggleSecureInput:</string>
<string>toggleToolbelt:</string>
<string>toggleUseTransparency:</string>
</object>
<object class="NSMutableArray" key="dict.values">
Loading
Loading
@@ -5479,6 +5679,7 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
Loading
Loading
@@ -5507,6 +5708,7 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>smallerFont:</string>
<string>toggleFullScreenTabBar:</string>
<string>toggleSecureInput:</string>
<string>toggleToolbelt:</string>
<string>toggleUseTransparency:</string>
</object>
<object class="NSMutableArray" key="dict.values">
Loading
Loading
@@ -5599,6 +5801,10 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string key="name">toggleSecureInput:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">toggleToolbelt:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">toggleUseTransparency:</string>
<string key="candidateClassName">id</string>
Loading
Loading
@@ -5627,7 +5833,9 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>sendInputToAllPanes</string>
<string>sendInputToAllSessions</string>
<string>showFullScreenTabs</string>
<string>showToolbeltItem</string>
<string>toggleBookmarksView</string>
<string>toolbeltMenu</string>
<string>useTransparency</string>
<string>windowArrangements_</string>
</object>
Loading
Loading
@@ -5653,6 +5861,8 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenu</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
</object>
</object>
Loading
Loading
@@ -5678,7 +5888,9 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string>sendInputToAllPanes</string>
<string>sendInputToAllSessions</string>
<string>showFullScreenTabs</string>
<string>showToolbeltItem</string>
<string>toggleBookmarksView</string>
<string>toolbeltMenu</string>
<string>useTransparency</string>
<string>windowArrangements_</string>
</object>
Loading
Loading
@@ -5756,10 +5968,18 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string key="name">showFullScreenTabs</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">showToolbeltItem</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">toggleBookmarksView</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">toolbeltMenu</string>
<string key="candidateClassName">NSMenu</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">useTransparency</string>
<string key="candidateClassName">NSMenuItem</string>
Loading
Loading
@@ -6367,6 +6587,14 @@ dy5hbmR5bWF0dXNjaGFrLm9yZy9wYWdlcy9zcGFya2xlCgoKCgoKCgoKCgoKCgoKCg</bytes>
<string key="minorKey">AppKit.framework/Headers/NSScroller.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSSlider</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSSlider.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTableView</string>
<string key="superclassName">NSControl</string>
Loading
Loading
Loading
Loading
@@ -441,6 +441,7 @@ typedef enum {
// Does any session want to be prompted for closing?
- (BOOL)promptOnClose;
 
- (ToolbeltView *)toolbelt;
////////////////////////////////////////////////////////////////////////////////
// NSTextField Delegate Methods
 
Loading
Loading
Loading
Loading
@@ -437,7 +437,10 @@ NSString *sessionsKey = @"sessions";
selector:@selector(_scrollerStyleChanged:)
name:@"NSPreferredScrollerStyleDidChangeNotification"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_updateDrawerVisibility:)
name:@"iTermToolbeltVisibilityChanged"
object:nil];
[self setWindowInited: YES];
useTransparency_ = YES;
fullscreenTabs_ = [[NSUserDefaults standardUserDefaults] objectForKey:@"ShowFullScreenTabBar"] ?
Loading
Loading
@@ -462,21 +465,32 @@ NSString *sessionsKey = @"sessions";
[[self window] setCollectionBehavior:[[self window] collectionBehavior] & ~NSWindowCollectionBehaviorParticipatesInCycle];
}
 
{
drawer_ = [[NSDrawer alloc] initWithContentSize:NSMakeSize(200, self.window.frame.size.height + 100)
preferredEdge:CGRectMaxXEdge];
[drawer_ setParentWindow:self.window];
NSSize contentSize = [drawer_ contentSize];
NSRect toolbeltFrame = NSMakeRect(0, 0, contentSize.width, contentSize.height);;
toolbelt_ = [[[ToolbeltView alloc] initWithFrame:toolbeltFrame
delegate:self] autorelease];
[drawer_ setContentView:toolbelt_];
drawer_ = [[NSDrawer alloc] initWithContentSize:NSMakeSize(200, self.window.frame.size.height + 100)
preferredEdge:CGRectMaxXEdge];
[drawer_ setParentWindow:self.window];
NSSize contentSize = [drawer_ contentSize];
NSRect toolbeltFrame = NSMakeRect(0, 0, contentSize.width, contentSize.height);;
toolbelt_ = [[[ToolbeltView alloc] initWithFrame:toolbeltFrame
delegate:self] autorelease];
[drawer_ setContentView:toolbelt_];
if ([[[iTermApplication sharedApplication] delegate] showToolbelt]) {
[drawer_ open];
}
return self;
}
 
- (void)_updateDrawerVisibility:(id)sender
{
if (windowType_ == WINDOW_TYPE_NORMAL) {
if ([[[iTermApplication sharedApplication] delegate] showToolbelt]) {
[drawer_ open];
} else {
[drawer_ close];
}
}
}
- (PseudoTerminal *)terminalDraggedFromAnotherWindowAtPoint:(NSPoint)point
{
PseudoTerminal *term;
Loading
Loading
@@ -1298,6 +1312,11 @@ NSString *sessionsKey = @"sessions";
return NO;
}
 
- (ToolbeltView *)toolbelt
{
return toolbelt_;
}
- (int)numRunningSessions
{
int n = 0;
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@
#import "ToolbeltView.h"
#import "BookmarkListView.h"
 
@interface ToolProfiles : NSView <ToolbeltTool> {
@interface ToolProfiles : NSView <ToolbeltTool, BookmarkTableDelegate> {
BookmarkListView *listView_;
NSPopUpButton *popup_;
}
Loading
Loading
Loading
Loading
@@ -17,10 +17,11 @@
self = [super initWithFrame:frame];
if (self) {
const int kVerticalMargin = 8;
const int kMargin = 14;
const int kMargin = 0;
const int kPopupHeight = 26;
listView_ = [[BookmarkListView alloc] initWithFrame:NSMakeRect(kMargin, 0, frame.size.width - kMargin * 2, frame.size.height - kPopupHeight - kVerticalMargin)];
[listView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[listView_ setDelegate:self];
[self addSubview:listView_];
popup_ = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(kMargin, frame.size.height - kPopupHeight, frame.size.width - kMargin * 2, kPopupHeight)];
[[popup_ menu] addItemWithTitle:@"New Tab"
Loading
Loading
@@ -83,7 +84,21 @@
PseudoTerminal* terminal = [[iTermController sharedInstance] currentTerminal];
for (NSString* guid in [listView_ selectedGuids]) {
[terminal splitVertically:YES withBookmarkGuid:guid];
}
}
}
- (void)bookmarkTableRowSelected:(id)bookmarkTable
{
NSEvent *event = [[NSApplication sharedApplication] currentEvent];
if ([event modifierFlags] & (NSControlKeyMask)) {
[self toolProfilesNewHorizontalSplit:nil];
} else if ([event modifierFlags] & (NSAlternateKeyMask)) {
[self toolProfilesNewVerticalSplit:nil];
} else if ([event modifierFlags] & (NSShiftKeyMask)) {
[self toolProfilesNewWindow:nil];
} else {
[self toolProfilesNewTab:nil];
}
}
 
@end
Loading
Loading
@@ -18,11 +18,25 @@
@interface ToolbeltView : NSView {
id<ToolbeltDelegate> delegate_;
NSSplitView *splitter_;
NSDictionary *tools_;
NSMutableDictionary *tools_;
}
 
+ (void)registerToolWithName:(NSString *)name withClass:(Class)c;
+ (void)populateMenu:(NSMenu *)menu;
+ (void)toggleShouldShowTool:(NSString *)theName;
+ (int)numberOfVisibleTools;
 
- (id)initWithFrame:(NSRect)frame delegate:(id<ToolbeltDelegate>)delegate;
 
// Is the tool visible?
- (BOOL)showingToolWithName:(NSString *)theName;
- (void)toggleToolWithName:(NSString *)theName;
// Do prefs say the tool is visible?
+ (BOOL)shouldShowTool:(NSString *)name;
- (BOOL)haveMultipleTools;
@end
Loading
Loading
@@ -9,17 +9,21 @@
#import "ToolbeltView.h"
#import "ToolProfiles.h"
#import "ToolPasteHistory.h"
#import "ToolWrapper.h"
 
@interface ToolbeltView (Private)
 
+ (NSDictionary *)toolsDictionary;
- (void)addTool:(NSView<ToolbeltTool> *)theTool;
- (void)addTool:(NSView<ToolbeltTool> *)theTool toWrapper:(ToolWrapper *)wrapper;
- (void)addToolWithName:(NSString *)theName;
- (void)setHaveMultipleTools:(BOOL)value;
 
@end
 
@implementation ToolbeltView
 
static NSMutableDictionary *gRegisteredTools;
static NSString *kToolbeltPrefKey = @"ToolbeltTools";
 
+ (void)initialize
{
Loading
Loading
@@ -33,19 +37,25 @@ static NSMutableDictionary *gRegisteredTools;
self = [super initWithFrame:frame];
if (self) {
delegate_ = delegate;
NSArray *items = [[NSUserDefaults standardUserDefaults] objectForKey:kToolbeltPrefKey];
if (!items) {
items = [gRegisteredTools allKeys];
[[NSUserDefaults standardUserDefaults] setObject:items forKey:kToolbeltPrefKey];
}
splitter_ = [[NSSplitView alloc] initWithFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)];
[splitter_ setVertical:NO];
[splitter_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[splitter_ setDividerStyle:NSSplitViewDividerStyleThin];
[splitter_ setDelegate:self];
[self addSubview:splitter_];
tools_ = [[ToolbeltView toolsDictionary] retain];
NSArray *items = [[NSUserDefaults standardUserDefaults] objectForKey:@"ToolbeltItems"];
if (!items) {
items = [gRegisteredTools allKeys];
}
for (NSString *toolName in items) {
Class c = [gRegisteredTools objectForKey:toolName];
[self addTool:[[[c alloc] initWithFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)] autorelease]];
tools_ = [[NSMutableDictionary alloc] init];
for (NSString *theName in items) {
if ([ToolbeltView shouldShowTool:theName]) {
[self addToolWithName:theName];
}
}
}
return self;
Loading
Loading
@@ -54,6 +64,7 @@ static NSMutableDictionary *gRegisteredTools;
- (void)dealloc
{
[splitter_ release];
[tools_ release];
[super dealloc];
}
 
Loading
Loading
@@ -72,11 +83,100 @@ static NSMutableDictionary *gRegisteredTools;
return dict;
}
 
- (void)addTool:(NSView<ToolbeltTool> *)theTool
+ (BOOL)shouldShowTool:(NSString *)name
{
return [[[NSUserDefaults standardUserDefaults] objectForKey:kToolbeltPrefKey] indexOfObject:name] != NSNotFound;
}
+ (void)toggleShouldShowTool:(NSString *)theName
{
[splitter_ addSubview:theTool];
NSMutableArray *tools = [[[[NSUserDefaults standardUserDefaults] objectForKey:kToolbeltPrefKey] mutableCopy] autorelease];
if (!tools) {
tools = [[[gRegisteredTools allKeys] mutableCopy] autorelease];
}
if ([tools indexOfObject:theName] == NSNotFound) {
[tools addObject:theName];
} else {
[tools removeObject:theName];
}
[[NSUserDefaults standardUserDefaults] setObject:tools forKey:kToolbeltPrefKey];
[[NSNotificationCenter defaultCenter] postNotificationName:@"iTermToolToggled"
object:theName
userInfo:nil];
}
+ (int)numberOfVisibleTools
{
NSArray *tools = [[NSUserDefaults standardUserDefaults] objectForKey:kToolbeltPrefKey];
if (!tools) {
tools = [gRegisteredTools allKeys];
}
return [tools count];
}
- (void)toggleToolWithName:(NSString *)theName
{
ToolWrapper *wrapper = [tools_ objectForKey:theName];
if (wrapper) {
[wrapper removeFromSuperview];
[tools_ removeObjectForKey:theName];
} else {
[self addToolWithName:theName];
}
[self setHaveMultipleTools:[self haveMultipleTools]];
}
- (BOOL)showingToolWithName:(NSString *)theName
{
return [tools_ objectForKey:theName] != nil;
}
+ (void)populateMenu:(NSMenu *)menu
{
NSArray *names = [[gRegisteredTools allKeys] sortedArrayUsingSelector:@selector(compare:)];
for (NSString *theName in names) {
NSMenuItem *i = [[[NSMenuItem alloc] initWithTitle:theName action:@selector(toggleToolbeltTool:) keyEquivalent:@""] autorelease];
[i setState:[ToolbeltView shouldShowTool:theName] ? NSOnState : NSOffState];
[menu addItem:i];
}
}
- (void)addTool:(NSView<ToolbeltTool> *)theTool toWrapper:(ToolWrapper *)wrapper
{
[splitter_ addSubview:wrapper];
[wrapper release];
[wrapper.container addSubview:theTool];
[wrapper setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[theTool setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[splitter_ adjustSubviews];
[wrapper bindCloseButton];
[tools_ setObject:wrapper forKey:wrapper.name];
}
- (void)addToolWithName:(NSString *)toolName
{
ToolWrapper *wrapper = [[ToolWrapper alloc] initWithFrame:NSMakeRect(0, 0, self.frame.size.width, self.frame.size.height)];
wrapper.name = toolName;
Class c = [gRegisteredTools objectForKey:toolName];
[self addTool:[[[c alloc] initWithFrame:NSMakeRect(0, 0, wrapper.container.frame.size.width, wrapper.container.frame.size.height)] autorelease]
toWrapper:wrapper];
[self setHaveMultipleTools:[self haveMultipleTools]];
}
- (BOOL)isFlipped
{
return YES;
}
- (void)setHaveMultipleTools:(BOOL)value
{
// For KVO
}
- (BOOL)haveMultipleTools
{
return [[splitter_ subviews] count] > 1;
}
 
@end
Loading
Loading
@@ -12,6 +12,9 @@
1D1158CE13444D29009B366F /* iTerm2 Help in Resources */ = {isa = PBXBuildFile; fileRef = 1D1158C913444D29009B366F /* iTerm2 Help */; };
1D13EADC12113A2D00909F9C /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D13EADB12113A2D00909F9C /* libncurses.dylib */; };
1D173859126C820A004622DC /* FakeWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D173857126C820A004622DC /* FakeWindow.h */; };
1D19C3291415979E00617E08 /* HoverButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D19C3271415979E00617E08 /* HoverButton.h */; };
1D19C32A1415979E00617E08 /* HoverButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D19C3281415979E00617E08 /* HoverButton.m */; };
1D19C3631415998E00617E08 /* closebutton.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1D19C3621415998E00617E08 /* closebutton.tif */; };
1D237D28131D8741004DD60C /* FindView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D237D26131D8741004DD60C /* FindView.h */; };
1D237D29131D8741004DD60C /* FindView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D237D27131D8741004DD60C /* FindView.m */; };
1D237D90131D8BEE004DD60C /* FindView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1D237D8E131D8BEE004DD60C /* FindView.xib */; };
Loading
Loading
@@ -243,6 +246,8 @@
1DE8DC8E1415546000F83147 /* ToolProfiles.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE8DC8C1415546000F83147 /* ToolProfiles.m */; };
1DE8DDAD1415648600F83147 /* ToolPasteHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DE8DDAB1415648600F83147 /* ToolPasteHistory.h */; };
1DE8DDAE1415648600F83147 /* ToolPasteHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE8DDAC1415648600F83147 /* ToolPasteHistory.m */; };
1DE8DF361415799700F83147 /* ToolWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DE8DF341415799700F83147 /* ToolWrapper.h */; };
1DE8DF371415799700F83147 /* ToolWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE8DF351415799700F83147 /* ToolWrapper.m */; };
1DEE9FDD11FCA60F009E18C9 /* credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 1DEE9FDB11FCA60F009E18C9 /* credits.rtf */; };
1DF0895B13DBAE1F00A52AD8 /* NSBitmapImageRep+CoreImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DF0895713DBAE1F00A52AD8 /* NSBitmapImageRep+CoreImage.h */; };
1DF0895C13DBAE1F00A52AD8 /* NSBitmapImageRep+CoreImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DF0895813DBAE1F00A52AD8 /* NSBitmapImageRep+CoreImage.m */; };
Loading
Loading
@@ -324,6 +329,9 @@
1D13EADB12113A2D00909F9C /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = usr/lib/libncurses.dylib; sourceTree = SDKROOT; };
1D173857126C820A004622DC /* FakeWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeWindow.h; sourceTree = "<group>"; };
1D173858126C820A004622DC /* FakeWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FakeWindow.m; sourceTree = "<group>"; };
1D19C3271415979E00617E08 /* HoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HoverButton.h; sourceTree = "<group>"; };
1D19C3281415979E00617E08 /* HoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HoverButton.m; sourceTree = "<group>"; };
1D19C3621415998E00617E08 /* closebutton.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = closebutton.tif; path = images/closebutton.tif; sourceTree = "<group>"; };
1D237D26131D8741004DD60C /* FindView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindView.h; sourceTree = "<group>"; };
1D237D27131D8741004DD60C /* FindView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FindView.m; sourceTree = "<group>"; };
1D237D8F131D8BEE004DD60C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/FindView.xib; sourceTree = "<group>"; };
Loading
Loading
@@ -437,6 +445,8 @@
1DE8DC8C1415546000F83147 /* ToolProfiles.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ToolProfiles.m; sourceTree = "<group>"; };
1DE8DDAB1415648600F83147 /* ToolPasteHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToolPasteHistory.h; sourceTree = "<group>"; };
1DE8DDAC1415648600F83147 /* ToolPasteHistory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ToolPasteHistory.m; sourceTree = "<group>"; };
1DE8DF341415799700F83147 /* ToolWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToolWrapper.h; sourceTree = "<group>"; };
1DE8DF351415799700F83147 /* ToolWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ToolWrapper.m; sourceTree = "<group>"; };
1DEB29301288885700B2CB9F /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; };
1DEB29371288887100B2CB9F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
1DEB293D1288899A00B2CB9F /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
Loading
Loading
@@ -670,6 +680,8 @@
0464AB0E006CD2EC7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
1D19C3271415979E00617E08 /* HoverButton.h */,
1D19C3281415979E00617E08 /* HoverButton.m */,
1D9F6AB7140C9DC4009B5CD4 /* FutureMethods.m */,
1D2560A913EE60E4006B35CD /* ArrangementPreviewView.m */,
1DE214E0128212EE004E3ADF /* Autocomplete.m */,
Loading
Loading
@@ -724,6 +736,7 @@
1D29732A14082A52004C5DBE /* SplitSelectionView.m */,
1DF8AF5713FD781700C8A435 /* SplitPanel.m */,
1DE8DC881415513A00F83147 /* ToolbeltView.m */,
1DE8DF351415799700F83147 /* ToolWrapper.m */,
1DE8DC8C1415546000F83147 /* ToolProfiles.m */,
1DE8DDAC1415648600F83147 /* ToolPasteHistory.m */,
1D06A04F134CDBED00C414EF /* Trouter.m */,
Loading
Loading
@@ -739,6 +752,7 @@
isa = PBXGroup;
children = (
1DE214DF128212EE004E3ADF /* Autocomplete.h */,
1DE8DF341415799700F83147 /* ToolWrapper.h */,
1D9F6AB6140C9DC4009B5CD4 /* FutureMethods.h */,
1D2560A813EE60E4006B35CD /* ArrangementPreviewView.h */,
1DE8DDAB1415648600F83147 /* ToolPasteHistory.h */,
Loading
Loading
@@ -874,6 +888,7 @@
1D093C131217412B0029F9AD /* Resources */ = {
isa = PBXGroup;
children = (
1D19C3621415998E00617E08 /* closebutton.tif */,
1DCA5ECB13EE4DA800B7725E /* arrangement.png */,
1D6A5FDE140D7AA000DE19F8 /* IBarCursorXMR.png */,
1D8F396A13EB7A2C0025B80B /* BroadcastInput.png */,
Loading
Loading
@@ -1197,6 +1212,8 @@
1DE8DC891415513A00F83147 /* ToolbeltView.h in Headers */,
1DE8DC8D1415546000F83147 /* ToolProfiles.h in Headers */,
1DE8DDAD1415648600F83147 /* ToolPasteHistory.h in Headers */,
1DE8DF361415799700F83147 /* ToolWrapper.h in Headers */,
1D19C3291415979E00617E08 /* HoverButton.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Loading
Loading
@@ -1374,6 +1391,7 @@
1DCA5ECC13EE4DA800B7725E /* arrangement.png in Resources */,
1D844C8D13FD8B7700CD4F85 /* SplitPanel.xib in Resources */,
1D6A5FDF140D7AA000DE19F8 /* IBarCursorXMR.png in Resources */,
1D19C3631415998E00617E08 /* closebutton.tif in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Loading
Loading
@@ -1493,6 +1511,8 @@
1DE8DC8A1415513A00F83147 /* ToolbeltView.m in Sources */,
1DE8DC8E1415546000F83147 /* ToolProfiles.m in Sources */,
1DE8DDAE1415648600F83147 /* ToolPasteHistory.m in Sources */,
1DE8DF371415799700F83147 /* ToolWrapper.m in Sources */,
1D19C32A1415979E00617E08 /* HoverButton.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Loading
Loading
Loading
Loading
@@ -30,6 +30,7 @@
 
#import <Cocoa/Cocoa.h>
 
@class iTermApplicationDelegate;
 
@interface iTermApplication : NSApplication {
 
Loading
Loading
@@ -37,5 +38,6 @@
 
+ (BOOL)isTextFieldInFocus:(NSTextField *)textField;
- (void)sendEvent:(NSEvent *)anEvent;
- (iTermApplicationDelegate *)delegate;
 
@end
Loading
Loading
@@ -205,5 +205,10 @@
return [[self delegate] uriToken];
}
 
- (iTermApplicationDelegate *)delegate
{
return [super delegate];
}
@end
 
Loading
Loading
@@ -60,9 +60,11 @@ void DebugLog(NSString* value);
NSWindowController *aboutController;
IBOutlet id ABOUT;
IBOutlet NSTextView *AUTHORS;
// Menu items
IBOutlet NSMenu *bookmarkMenu;
IBOutlet NSMenu *toolbeltMenu;
IBOutlet NSMenuItem *showToolbeltItem;
IBOutlet NSMenuItem *selectTab;
IBOutlet NSMenuItem *previousTerminal;
IBOutlet NSMenuItem *nextTerminal;
Loading
Loading
@@ -110,6 +112,7 @@ void DebugLog(NSString* value);
- (void)applicationDidBecomeActive:(NSNotification *)aNotification;
- (void)applicationDidResignActive:(NSNotification *)aNotification;
 
- (IBAction)toggleToolbelt:(id)sender;
- (IBAction)toggleFullScreenTabBar:(id)sender;
- (IBAction)maximizePane:(id)sender;
- (IBAction)toggleUseTransparency:(id)sender;
Loading
Loading
@@ -164,6 +167,8 @@ void DebugLog(NSString* value);
 
- (void)updateBroadcastMenuState;
 
- (BOOL)showToolbelt;
@end
 
// Scripting support
Loading
Loading
Loading
Loading
@@ -56,6 +56,12 @@ BOOL gDebugLogging = NO;
int gDebugLogFile = -1;
static BOOL hasBecomeActive = NO;
 
@interface iTermApplicationDelegate ()
- (void)_updateToolbeltMenuItem;
@end
@implementation iTermAboutWindow
 
- (IBAction)closeCurrentSession:(id)sender
Loading
Loading
@@ -89,6 +95,8 @@ static BOOL hasBecomeActive = NO;
[PreferencePanel sharedInstance];
[ITAddressBookMgr sharedInstance];
 
[ToolbeltView populateMenu:toolbeltMenu];
[self _updateToolbeltMenuItem];
[self setFutureApplicationPresentationOptions:NSApplicationPresentationFullScreen unset:0];
}
 
Loading
Loading
@@ -482,6 +490,10 @@ static BOOL hasBecomeActive = NO;
selector:@selector(windowArrangementsDidChange:)
name:@"iTermSavedArrangementChanged"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(toolDidToggle:)
name:@"iTermToolToggled"
object:nil];
 
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self
andSelector:@selector(getUrl:withReplyEvent:)
Loading
Loading
@@ -509,6 +521,49 @@ static BOOL hasBecomeActive = NO;
secureInputDesired_ = [[[NSUserDefaults standardUserDefaults] objectForKey:@"Secure Input"] boolValue];
}
 
- (BOOL)showToolbelt
{
NSNumber *n = [[NSUserDefaults standardUserDefaults] objectForKey:@"Show Toolbelt"];
if (!n) {
n = [NSNumber numberWithBool:NO];
}
return [n boolValue];
}
- (IBAction)toggleToolbelt:(id)sender
{
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:![self showToolbelt]]
forKey:@"Show Toolbelt"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"iTermToolbeltVisibilityChanged"
object:nil];
[self _updateToolbeltMenuItem];
}
- (void)_updateToolbeltMenuItem
{
[showToolbeltItem setState:[self showToolbelt] ? NSOnState : NSOffState];
}
- (IBAction)toggleToolbeltTool:(NSMenuItem *)menuItem
{
if ([ToolbeltView numberOfVisibleTools] == 1 && [menuItem state] == NSOnState) {
return;
}
[ToolbeltView toggleShouldShowTool:[menuItem title]];
}
- (void)toolDidToggle:(NSNotification *)notification
{
NSString *theName = [notification object];
for (PseudoTerminal *term in [[iTermController sharedInstance] terminals]) {
[[term toolbelt] toggleToolWithName:theName];
}
NSMenuItem *menuItem = [toolbeltMenu itemWithTitle:theName];
NSInteger newState = ([menuItem state] == NSOnState) ? NSOffState : NSOnState;
[menuItem setState:newState];
}
- (NSDictionary *)dictForQueryString:(NSString *)query
{
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment