зеркало из https://github.com/mozilla/pjs.git
Fix for bug 152975. Add a Show/Hide Sidebar menu item with key shortcut Command-/. Patch from Prachi Guariar.
This commit is contained in:
Родитель
bba7bb2bd7
Коммит
dee8dd79ef
|
@ -265,5 +265,8 @@ class nsIDOMNode;
|
|||
// cache the toolbar defaults we parse from a plist
|
||||
+ (NSArray*) toolbarDefaults;
|
||||
|
||||
// Accessor to get the sidebar drawer
|
||||
- (NSDrawer *)sidebarDrawer;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1449,6 +1449,11 @@ static NSArray* sToolbarDefaults = nil;
|
|||
[[mBrowserView getBrowserView] setActive:newResponderIsGecko];
|
||||
}
|
||||
|
||||
- (NSDrawer *)sidebarDrawer
|
||||
{
|
||||
return mSidebarDrawer;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
smallerTextSize = id;
|
||||
toggleBookmarksToolbar = id;
|
||||
toggleOfflineMode = id;
|
||||
toggleSidebar = id;
|
||||
viewSource = id;
|
||||
};
|
||||
CLASS = MainController;
|
||||
|
@ -56,7 +57,7 @@
|
|||
mCreateBookmarksSeparatorMenuItem = NSMenuItem;
|
||||
mFilterList = NSPopUpButton;
|
||||
mFilterView = NSView;
|
||||
mOfflineMenuItem = NSMenuItem;
|
||||
mToggleSidebarMenuItem = NSMenuItem;
|
||||
};
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>71 163 356 240 0 0 1280 1002 </string>
|
||||
<string>60 23 477 485 0 0 1280 1002 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>266</key>
|
||||
<string>23 342 277 90 0 0 1152 746 </string>
|
||||
<string>483 623 277 90 0 0 1280 1002 </string>
|
||||
<key>29</key>
|
||||
<string>8 958 446 44 0 0 1280 1002 </string>
|
||||
<string>8 957 446 44 0 0 1280 1002 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
|
|
Двоичный файл не отображается.
|
@ -49,34 +49,35 @@ class BookmarksService;
|
|||
IBOutlet NSApplication* mApplication;
|
||||
|
||||
// The following two items are used by the filter list when saving files.
|
||||
IBOutlet NSView* mFilterView;
|
||||
IBOutlet NSPopUpButton* mFilterList;
|
||||
IBOutlet NSView* mFilterView;
|
||||
IBOutlet NSPopUpButton* mFilterList;
|
||||
|
||||
IBOutlet NSMenuItem* mOfflineMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseWindowMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseTabMenuItem;
|
||||
// IBOutlet NSMenuItem* mOfflineMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseWindowMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseTabMenuItem;
|
||||
IBOutlet NSMenuItem* mToggleSidebarMenuItem;
|
||||
|
||||
// The bookmarks menu.
|
||||
IBOutlet NSMenu* mBookmarksMenu;
|
||||
IBOutlet NSMenu* mBookmarksMenu;
|
||||
|
||||
IBOutlet NSMenuItem* mBookmarksToolbarMenuItem;
|
||||
IBOutlet NSMenuItem* mBookmarksToolbarMenuItem;
|
||||
IBOutlet NSMenuItem* mAddBookmarkMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksFolderMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksFolderMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem;
|
||||
|
||||
BOOL mOffline;
|
||||
BOOL mOffline;
|
||||
|
||||
CHSplashScreenWindow* mSplashScreen;
|
||||
CHSplashScreenWindow* mSplashScreen;
|
||||
|
||||
CHPreferenceManager* mPreferenceManager;
|
||||
CHPreferenceManager* mPreferenceManager;
|
||||
|
||||
BookmarksService* mMenuBookmarks;
|
||||
BookmarksService* mMenuBookmarks;
|
||||
|
||||
FindDlgController* mFindDialog;
|
||||
FindDlgController* mFindDialog;
|
||||
|
||||
MVPreferencesController* preferencesController;
|
||||
|
||||
NSString* mStartURL;
|
||||
NSString* mStartURL;
|
||||
}
|
||||
|
||||
-(void)dealloc;
|
||||
|
@ -103,6 +104,7 @@ class BookmarksService;
|
|||
-(IBAction) nextTab:(id)aSender;
|
||||
|
||||
// View menu actions.
|
||||
-(IBAction) toggleSidebar:(id)sender;
|
||||
-(IBAction) toggleBookmarksToolbar:(id)aSender;
|
||||
-(IBAction) doReload:(id)aSender;
|
||||
-(IBAction) doStop:(id)aSender;
|
||||
|
|
|
@ -146,8 +146,10 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
|
||||
// Set the menu item's text to "Go Online" if we're currently
|
||||
// offline.
|
||||
/*
|
||||
if (mOffline)
|
||||
[mOfflineMenuItem setTitle: @"Go Online"]; // XXX localize me
|
||||
*/
|
||||
}
|
||||
|
||||
-(IBAction)newWindow:(id)aSender
|
||||
|
@ -278,10 +280,12 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
// Update the menu item text.
|
||||
// Set the menu item's text to "Go Online" if we're currently
|
||||
// offline.
|
||||
/*
|
||||
if (mOffline)
|
||||
[mOfflineMenuItem setTitle: @"Go Online"];
|
||||
else
|
||||
[mOfflineMenuItem setTitle: @"Work Offline"];
|
||||
*/
|
||||
|
||||
// Indicate that we are working offline.
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"offlineModeChanged" object:nil];
|
||||
|
@ -439,7 +443,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
// them or we may get this event at startup before we've had time to load
|
||||
// our window.
|
||||
BrowserWindowController* controller = [self getMainWindowBrowserController];
|
||||
if (reuseWindow && controller && [controller canMakeNewTabs]) {
|
||||
if (reuseWindow && controller && [controller newTabsAllowed]) {
|
||||
[controller openNewTabWithURL:inURLString referrer:aReferrer loadInBackground:loadInBackground];
|
||||
}
|
||||
else {
|
||||
|
@ -717,6 +721,25 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
return NO;
|
||||
}
|
||||
|
||||
if (action == @selector(toggleSidebar:)) {
|
||||
if (browserController) {
|
||||
NSDrawer *sidebar = [browserController sidebarDrawer];
|
||||
if (sidebar) {
|
||||
int sidebarState = [sidebar state];
|
||||
if (sidebarState == NSDrawerOpenState)
|
||||
[mToggleSidebarMenuItem setTitle: NSLocalizedString(@"Hide Sidebar",@"")];
|
||||
else
|
||||
[mToggleSidebarMenuItem setTitle: NSLocalizedString(@"Show Sidebar",@"")];
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
// only activate if we've got multiple tabs open.
|
||||
if ((action == @selector(closeTab:) ||
|
||||
action == @selector (nextTab:) ||
|
||||
|
@ -750,6 +773,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
return YES;
|
||||
}
|
||||
|
||||
-(IBAction) toggleSidebar:(id)sender
|
||||
{
|
||||
BrowserWindowController *browserController = [self getMainWindowBrowserController];
|
||||
if (!browserController) return;
|
||||
|
||||
[browserController toggleSidebar:sender];
|
||||
}
|
||||
|
||||
-(IBAction) toggleBookmarksToolbar:(id)aSender
|
||||
{
|
||||
BrowserWindowController* browserController = [self getMainWindowBrowserController];
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
smallerTextSize = id;
|
||||
toggleBookmarksToolbar = id;
|
||||
toggleOfflineMode = id;
|
||||
toggleSidebar = id;
|
||||
viewSource = id;
|
||||
};
|
||||
CLASS = MainController;
|
||||
|
@ -56,7 +57,7 @@
|
|||
mCreateBookmarksSeparatorMenuItem = NSMenuItem;
|
||||
mFilterList = NSPopUpButton;
|
||||
mFilterView = NSView;
|
||||
mOfflineMenuItem = NSMenuItem;
|
||||
mToggleSidebarMenuItem = NSMenuItem;
|
||||
};
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>71 163 356 240 0 0 1280 1002 </string>
|
||||
<string>60 23 477 485 0 0 1280 1002 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>266</key>
|
||||
<string>23 342 277 90 0 0 1152 746 </string>
|
||||
<string>483 623 277 90 0 0 1280 1002 </string>
|
||||
<key>29</key>
|
||||
<string>8 958 446 44 0 0 1280 1002 </string>
|
||||
<string>8 957 446 44 0 0 1280 1002 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
|
|
Двоичный файл не отображается.
|
@ -41,6 +41,7 @@
|
|||
smallerTextSize = id;
|
||||
toggleBookmarksToolbar = id;
|
||||
toggleOfflineMode = id;
|
||||
toggleSidebar = id;
|
||||
viewSource = id;
|
||||
};
|
||||
CLASS = MainController;
|
||||
|
@ -56,7 +57,7 @@
|
|||
mCreateBookmarksSeparatorMenuItem = NSMenuItem;
|
||||
mFilterList = NSPopUpButton;
|
||||
mFilterView = NSView;
|
||||
mOfflineMenuItem = NSMenuItem;
|
||||
mToggleSidebarMenuItem = NSMenuItem;
|
||||
};
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>71 163 356 240 0 0 1280 1002 </string>
|
||||
<string>60 23 477 485 0 0 1280 1002 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>266</key>
|
||||
<string>23 342 277 90 0 0 1152 746 </string>
|
||||
<string>483 623 277 90 0 0 1280 1002 </string>
|
||||
<key>29</key>
|
||||
<string>8 958 446 44 0 0 1280 1002 </string>
|
||||
<string>8 957 446 44 0 0 1280 1002 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
|
|
Двоичный файл не отображается.
|
@ -49,34 +49,35 @@ class BookmarksService;
|
|||
IBOutlet NSApplication* mApplication;
|
||||
|
||||
// The following two items are used by the filter list when saving files.
|
||||
IBOutlet NSView* mFilterView;
|
||||
IBOutlet NSPopUpButton* mFilterList;
|
||||
IBOutlet NSView* mFilterView;
|
||||
IBOutlet NSPopUpButton* mFilterList;
|
||||
|
||||
IBOutlet NSMenuItem* mOfflineMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseWindowMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseTabMenuItem;
|
||||
// IBOutlet NSMenuItem* mOfflineMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseWindowMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseTabMenuItem;
|
||||
IBOutlet NSMenuItem* mToggleSidebarMenuItem;
|
||||
|
||||
// The bookmarks menu.
|
||||
IBOutlet NSMenu* mBookmarksMenu;
|
||||
IBOutlet NSMenu* mBookmarksMenu;
|
||||
|
||||
IBOutlet NSMenuItem* mBookmarksToolbarMenuItem;
|
||||
IBOutlet NSMenuItem* mBookmarksToolbarMenuItem;
|
||||
IBOutlet NSMenuItem* mAddBookmarkMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksFolderMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksFolderMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem;
|
||||
|
||||
BOOL mOffline;
|
||||
BOOL mOffline;
|
||||
|
||||
CHSplashScreenWindow* mSplashScreen;
|
||||
CHSplashScreenWindow* mSplashScreen;
|
||||
|
||||
CHPreferenceManager* mPreferenceManager;
|
||||
CHPreferenceManager* mPreferenceManager;
|
||||
|
||||
BookmarksService* mMenuBookmarks;
|
||||
BookmarksService* mMenuBookmarks;
|
||||
|
||||
FindDlgController* mFindDialog;
|
||||
FindDlgController* mFindDialog;
|
||||
|
||||
MVPreferencesController* preferencesController;
|
||||
|
||||
NSString* mStartURL;
|
||||
NSString* mStartURL;
|
||||
}
|
||||
|
||||
-(void)dealloc;
|
||||
|
@ -103,6 +104,7 @@ class BookmarksService;
|
|||
-(IBAction) nextTab:(id)aSender;
|
||||
|
||||
// View menu actions.
|
||||
-(IBAction) toggleSidebar:(id)sender;
|
||||
-(IBAction) toggleBookmarksToolbar:(id)aSender;
|
||||
-(IBAction) doReload:(id)aSender;
|
||||
-(IBAction) doStop:(id)aSender;
|
||||
|
|
|
@ -146,8 +146,10 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
|
||||
// Set the menu item's text to "Go Online" if we're currently
|
||||
// offline.
|
||||
/*
|
||||
if (mOffline)
|
||||
[mOfflineMenuItem setTitle: @"Go Online"]; // XXX localize me
|
||||
*/
|
||||
}
|
||||
|
||||
-(IBAction)newWindow:(id)aSender
|
||||
|
@ -278,10 +280,12 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
// Update the menu item text.
|
||||
// Set the menu item's text to "Go Online" if we're currently
|
||||
// offline.
|
||||
/*
|
||||
if (mOffline)
|
||||
[mOfflineMenuItem setTitle: @"Go Online"];
|
||||
else
|
||||
[mOfflineMenuItem setTitle: @"Work Offline"];
|
||||
*/
|
||||
|
||||
// Indicate that we are working offline.
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"offlineModeChanged" object:nil];
|
||||
|
@ -439,7 +443,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
// them or we may get this event at startup before we've had time to load
|
||||
// our window.
|
||||
BrowserWindowController* controller = [self getMainWindowBrowserController];
|
||||
if (reuseWindow && controller && [controller canMakeNewTabs]) {
|
||||
if (reuseWindow && controller && [controller newTabsAllowed]) {
|
||||
[controller openNewTabWithURL:inURLString referrer:aReferrer loadInBackground:loadInBackground];
|
||||
}
|
||||
else {
|
||||
|
@ -717,6 +721,25 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
return NO;
|
||||
}
|
||||
|
||||
if (action == @selector(toggleSidebar:)) {
|
||||
if (browserController) {
|
||||
NSDrawer *sidebar = [browserController sidebarDrawer];
|
||||
if (sidebar) {
|
||||
int sidebarState = [sidebar state];
|
||||
if (sidebarState == NSDrawerOpenState)
|
||||
[mToggleSidebarMenuItem setTitle: NSLocalizedString(@"Hide Sidebar",@"")];
|
||||
else
|
||||
[mToggleSidebarMenuItem setTitle: NSLocalizedString(@"Show Sidebar",@"")];
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
// only activate if we've got multiple tabs open.
|
||||
if ((action == @selector(closeTab:) ||
|
||||
action == @selector (nextTab:) ||
|
||||
|
@ -750,6 +773,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
return YES;
|
||||
}
|
||||
|
||||
-(IBAction) toggleSidebar:(id)sender
|
||||
{
|
||||
BrowserWindowController *browserController = [self getMainWindowBrowserController];
|
||||
if (!browserController) return;
|
||||
|
||||
[browserController toggleSidebar:sender];
|
||||
}
|
||||
|
||||
-(IBAction) toggleBookmarksToolbar:(id)aSender
|
||||
{
|
||||
BrowserWindowController* browserController = [self getMainWindowBrowserController];
|
||||
|
|
|
@ -265,5 +265,8 @@ class nsIDOMNode;
|
|||
// cache the toolbar defaults we parse from a plist
|
||||
+ (NSArray*) toolbarDefaults;
|
||||
|
||||
// Accessor to get the sidebar drawer
|
||||
- (NSDrawer *)sidebarDrawer;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1449,6 +1449,11 @@ static NSArray* sToolbarDefaults = nil;
|
|||
[[mBrowserView getBrowserView] setActive:newResponderIsGecko];
|
||||
}
|
||||
|
||||
- (NSDrawer *)sidebarDrawer
|
||||
{
|
||||
return mSidebarDrawer;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -265,5 +265,8 @@ class nsIDOMNode;
|
|||
// cache the toolbar defaults we parse from a plist
|
||||
+ (NSArray*) toolbarDefaults;
|
||||
|
||||
// Accessor to get the sidebar drawer
|
||||
- (NSDrawer *)sidebarDrawer;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1449,6 +1449,11 @@ static NSArray* sToolbarDefaults = nil;
|
|||
[[mBrowserView getBrowserView] setActive:newResponderIsGecko];
|
||||
}
|
||||
|
||||
- (NSDrawer *)sidebarDrawer
|
||||
{
|
||||
return mSidebarDrawer;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
smallerTextSize = id;
|
||||
toggleBookmarksToolbar = id;
|
||||
toggleOfflineMode = id;
|
||||
toggleSidebar = id;
|
||||
viewSource = id;
|
||||
};
|
||||
CLASS = MainController;
|
||||
|
@ -56,7 +57,7 @@
|
|||
mCreateBookmarksSeparatorMenuItem = NSMenuItem;
|
||||
mFilterList = NSPopUpButton;
|
||||
mFilterView = NSView;
|
||||
mOfflineMenuItem = NSMenuItem;
|
||||
mToggleSidebarMenuItem = NSMenuItem;
|
||||
};
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>71 163 356 240 0 0 1280 1002 </string>
|
||||
<string>60 23 477 485 0 0 1280 1002 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>266</key>
|
||||
<string>23 342 277 90 0 0 1152 746 </string>
|
||||
<string>483 623 277 90 0 0 1280 1002 </string>
|
||||
<key>29</key>
|
||||
<string>8 958 446 44 0 0 1280 1002 </string>
|
||||
<string>8 957 446 44 0 0 1280 1002 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
|
|
Двоичный файл не отображается.
|
@ -49,34 +49,35 @@ class BookmarksService;
|
|||
IBOutlet NSApplication* mApplication;
|
||||
|
||||
// The following two items are used by the filter list when saving files.
|
||||
IBOutlet NSView* mFilterView;
|
||||
IBOutlet NSPopUpButton* mFilterList;
|
||||
IBOutlet NSView* mFilterView;
|
||||
IBOutlet NSPopUpButton* mFilterList;
|
||||
|
||||
IBOutlet NSMenuItem* mOfflineMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseWindowMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseTabMenuItem;
|
||||
// IBOutlet NSMenuItem* mOfflineMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseWindowMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseTabMenuItem;
|
||||
IBOutlet NSMenuItem* mToggleSidebarMenuItem;
|
||||
|
||||
// The bookmarks menu.
|
||||
IBOutlet NSMenu* mBookmarksMenu;
|
||||
IBOutlet NSMenu* mBookmarksMenu;
|
||||
|
||||
IBOutlet NSMenuItem* mBookmarksToolbarMenuItem;
|
||||
IBOutlet NSMenuItem* mBookmarksToolbarMenuItem;
|
||||
IBOutlet NSMenuItem* mAddBookmarkMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksFolderMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksFolderMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem;
|
||||
|
||||
BOOL mOffline;
|
||||
BOOL mOffline;
|
||||
|
||||
CHSplashScreenWindow* mSplashScreen;
|
||||
CHSplashScreenWindow* mSplashScreen;
|
||||
|
||||
CHPreferenceManager* mPreferenceManager;
|
||||
CHPreferenceManager* mPreferenceManager;
|
||||
|
||||
BookmarksService* mMenuBookmarks;
|
||||
BookmarksService* mMenuBookmarks;
|
||||
|
||||
FindDlgController* mFindDialog;
|
||||
FindDlgController* mFindDialog;
|
||||
|
||||
MVPreferencesController* preferencesController;
|
||||
|
||||
NSString* mStartURL;
|
||||
NSString* mStartURL;
|
||||
}
|
||||
|
||||
-(void)dealloc;
|
||||
|
@ -103,6 +104,7 @@ class BookmarksService;
|
|||
-(IBAction) nextTab:(id)aSender;
|
||||
|
||||
// View menu actions.
|
||||
-(IBAction) toggleSidebar:(id)sender;
|
||||
-(IBAction) toggleBookmarksToolbar:(id)aSender;
|
||||
-(IBAction) doReload:(id)aSender;
|
||||
-(IBAction) doStop:(id)aSender;
|
||||
|
|
|
@ -146,8 +146,10 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
|
||||
// Set the menu item's text to "Go Online" if we're currently
|
||||
// offline.
|
||||
/*
|
||||
if (mOffline)
|
||||
[mOfflineMenuItem setTitle: @"Go Online"]; // XXX localize me
|
||||
*/
|
||||
}
|
||||
|
||||
-(IBAction)newWindow:(id)aSender
|
||||
|
@ -278,10 +280,12 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
// Update the menu item text.
|
||||
// Set the menu item's text to "Go Online" if we're currently
|
||||
// offline.
|
||||
/*
|
||||
if (mOffline)
|
||||
[mOfflineMenuItem setTitle: @"Go Online"];
|
||||
else
|
||||
[mOfflineMenuItem setTitle: @"Work Offline"];
|
||||
*/
|
||||
|
||||
// Indicate that we are working offline.
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"offlineModeChanged" object:nil];
|
||||
|
@ -439,7 +443,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
// them or we may get this event at startup before we've had time to load
|
||||
// our window.
|
||||
BrowserWindowController* controller = [self getMainWindowBrowserController];
|
||||
if (reuseWindow && controller && [controller canMakeNewTabs]) {
|
||||
if (reuseWindow && controller && [controller newTabsAllowed]) {
|
||||
[controller openNewTabWithURL:inURLString referrer:aReferrer loadInBackground:loadInBackground];
|
||||
}
|
||||
else {
|
||||
|
@ -717,6 +721,25 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
return NO;
|
||||
}
|
||||
|
||||
if (action == @selector(toggleSidebar:)) {
|
||||
if (browserController) {
|
||||
NSDrawer *sidebar = [browserController sidebarDrawer];
|
||||
if (sidebar) {
|
||||
int sidebarState = [sidebar state];
|
||||
if (sidebarState == NSDrawerOpenState)
|
||||
[mToggleSidebarMenuItem setTitle: NSLocalizedString(@"Hide Sidebar",@"")];
|
||||
else
|
||||
[mToggleSidebarMenuItem setTitle: NSLocalizedString(@"Show Sidebar",@"")];
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
// only activate if we've got multiple tabs open.
|
||||
if ((action == @selector(closeTab:) ||
|
||||
action == @selector (nextTab:) ||
|
||||
|
@ -750,6 +773,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
return YES;
|
||||
}
|
||||
|
||||
-(IBAction) toggleSidebar:(id)sender
|
||||
{
|
||||
BrowserWindowController *browserController = [self getMainWindowBrowserController];
|
||||
if (!browserController) return;
|
||||
|
||||
[browserController toggleSidebar:sender];
|
||||
}
|
||||
|
||||
-(IBAction) toggleBookmarksToolbar:(id)aSender
|
||||
{
|
||||
BrowserWindowController* browserController = [self getMainWindowBrowserController];
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
smallerTextSize = id;
|
||||
toggleBookmarksToolbar = id;
|
||||
toggleOfflineMode = id;
|
||||
toggleSidebar = id;
|
||||
viewSource = id;
|
||||
};
|
||||
CLASS = MainController;
|
||||
|
@ -56,7 +57,7 @@
|
|||
mCreateBookmarksSeparatorMenuItem = NSMenuItem;
|
||||
mFilterList = NSPopUpButton;
|
||||
mFilterView = NSView;
|
||||
mOfflineMenuItem = NSMenuItem;
|
||||
mToggleSidebarMenuItem = NSMenuItem;
|
||||
};
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>71 163 356 240 0 0 1280 1002 </string>
|
||||
<string>60 23 477 485 0 0 1280 1002 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>266</key>
|
||||
<string>23 342 277 90 0 0 1152 746 </string>
|
||||
<string>483 623 277 90 0 0 1280 1002 </string>
|
||||
<key>29</key>
|
||||
<string>8 958 446 44 0 0 1280 1002 </string>
|
||||
<string>8 957 446 44 0 0 1280 1002 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
|
|
Двоичный файл не отображается.
|
@ -41,6 +41,7 @@
|
|||
smallerTextSize = id;
|
||||
toggleBookmarksToolbar = id;
|
||||
toggleOfflineMode = id;
|
||||
toggleSidebar = id;
|
||||
viewSource = id;
|
||||
};
|
||||
CLASS = MainController;
|
||||
|
@ -56,7 +57,7 @@
|
|||
mCreateBookmarksSeparatorMenuItem = NSMenuItem;
|
||||
mFilterList = NSPopUpButton;
|
||||
mFilterView = NSView;
|
||||
mOfflineMenuItem = NSMenuItem;
|
||||
mToggleSidebarMenuItem = NSMenuItem;
|
||||
};
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>71 163 356 240 0 0 1280 1002 </string>
|
||||
<string>60 23 477 485 0 0 1280 1002 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>266</key>
|
||||
<string>23 342 277 90 0 0 1152 746 </string>
|
||||
<string>483 623 277 90 0 0 1280 1002 </string>
|
||||
<key>29</key>
|
||||
<string>8 958 446 44 0 0 1280 1002 </string>
|
||||
<string>8 957 446 44 0 0 1280 1002 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
|
|
Двоичный файл не отображается.
|
@ -49,34 +49,35 @@ class BookmarksService;
|
|||
IBOutlet NSApplication* mApplication;
|
||||
|
||||
// The following two items are used by the filter list when saving files.
|
||||
IBOutlet NSView* mFilterView;
|
||||
IBOutlet NSPopUpButton* mFilterList;
|
||||
IBOutlet NSView* mFilterView;
|
||||
IBOutlet NSPopUpButton* mFilterList;
|
||||
|
||||
IBOutlet NSMenuItem* mOfflineMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseWindowMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseTabMenuItem;
|
||||
// IBOutlet NSMenuItem* mOfflineMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseWindowMenuItem;
|
||||
IBOutlet NSMenuItem* mCloseTabMenuItem;
|
||||
IBOutlet NSMenuItem* mToggleSidebarMenuItem;
|
||||
|
||||
// The bookmarks menu.
|
||||
IBOutlet NSMenu* mBookmarksMenu;
|
||||
IBOutlet NSMenu* mBookmarksMenu;
|
||||
|
||||
IBOutlet NSMenuItem* mBookmarksToolbarMenuItem;
|
||||
IBOutlet NSMenuItem* mBookmarksToolbarMenuItem;
|
||||
IBOutlet NSMenuItem* mAddBookmarkMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksFolderMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksFolderMenuItem;
|
||||
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem;
|
||||
|
||||
BOOL mOffline;
|
||||
BOOL mOffline;
|
||||
|
||||
CHSplashScreenWindow* mSplashScreen;
|
||||
CHSplashScreenWindow* mSplashScreen;
|
||||
|
||||
CHPreferenceManager* mPreferenceManager;
|
||||
CHPreferenceManager* mPreferenceManager;
|
||||
|
||||
BookmarksService* mMenuBookmarks;
|
||||
BookmarksService* mMenuBookmarks;
|
||||
|
||||
FindDlgController* mFindDialog;
|
||||
FindDlgController* mFindDialog;
|
||||
|
||||
MVPreferencesController* preferencesController;
|
||||
|
||||
NSString* mStartURL;
|
||||
NSString* mStartURL;
|
||||
}
|
||||
|
||||
-(void)dealloc;
|
||||
|
@ -103,6 +104,7 @@ class BookmarksService;
|
|||
-(IBAction) nextTab:(id)aSender;
|
||||
|
||||
// View menu actions.
|
||||
-(IBAction) toggleSidebar:(id)sender;
|
||||
-(IBAction) toggleBookmarksToolbar:(id)aSender;
|
||||
-(IBAction) doReload:(id)aSender;
|
||||
-(IBAction) doStop:(id)aSender;
|
||||
|
|
|
@ -146,8 +146,10 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
|
||||
// Set the menu item's text to "Go Online" if we're currently
|
||||
// offline.
|
||||
/*
|
||||
if (mOffline)
|
||||
[mOfflineMenuItem setTitle: @"Go Online"]; // XXX localize me
|
||||
*/
|
||||
}
|
||||
|
||||
-(IBAction)newWindow:(id)aSender
|
||||
|
@ -278,10 +280,12 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
// Update the menu item text.
|
||||
// Set the menu item's text to "Go Online" if we're currently
|
||||
// offline.
|
||||
/*
|
||||
if (mOffline)
|
||||
[mOfflineMenuItem setTitle: @"Go Online"];
|
||||
else
|
||||
[mOfflineMenuItem setTitle: @"Work Offline"];
|
||||
*/
|
||||
|
||||
// Indicate that we are working offline.
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"offlineModeChanged" object:nil];
|
||||
|
@ -439,7 +443,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
// them or we may get this event at startup before we've had time to load
|
||||
// our window.
|
||||
BrowserWindowController* controller = [self getMainWindowBrowserController];
|
||||
if (reuseWindow && controller && [controller canMakeNewTabs]) {
|
||||
if (reuseWindow && controller && [controller newTabsAllowed]) {
|
||||
[controller openNewTabWithURL:inURLString referrer:aReferrer loadInBackground:loadInBackground];
|
||||
}
|
||||
else {
|
||||
|
@ -717,6 +721,25 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
return NO;
|
||||
}
|
||||
|
||||
if (action == @selector(toggleSidebar:)) {
|
||||
if (browserController) {
|
||||
NSDrawer *sidebar = [browserController sidebarDrawer];
|
||||
if (sidebar) {
|
||||
int sidebarState = [sidebar state];
|
||||
if (sidebarState == NSDrawerOpenState)
|
||||
[mToggleSidebarMenuItem setTitle: NSLocalizedString(@"Hide Sidebar",@"")];
|
||||
else
|
||||
[mToggleSidebarMenuItem setTitle: NSLocalizedString(@"Show Sidebar",@"")];
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
// only activate if we've got multiple tabs open.
|
||||
if ((action == @selector(closeTab:) ||
|
||||
action == @selector (nextTab:) ||
|
||||
|
@ -750,6 +773,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
|||
return YES;
|
||||
}
|
||||
|
||||
-(IBAction) toggleSidebar:(id)sender
|
||||
{
|
||||
BrowserWindowController *browserController = [self getMainWindowBrowserController];
|
||||
if (!browserController) return;
|
||||
|
||||
[browserController toggleSidebar:sender];
|
||||
}
|
||||
|
||||
-(IBAction) toggleBookmarksToolbar:(id)aSender
|
||||
{
|
||||
BrowserWindowController* browserController = [self getMainWindowBrowserController];
|
||||
|
|
|
@ -265,5 +265,8 @@ class nsIDOMNode;
|
|||
// cache the toolbar defaults we parse from a plist
|
||||
+ (NSArray*) toolbarDefaults;
|
||||
|
||||
// Accessor to get the sidebar drawer
|
||||
- (NSDrawer *)sidebarDrawer;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1449,6 +1449,11 @@ static NSArray* sToolbarDefaults = nil;
|
|||
[[mBrowserView getBrowserView] setActive:newResponderIsGecko];
|
||||
}
|
||||
|
||||
- (NSDrawer *)sidebarDrawer
|
||||
{
|
||||
return mSidebarDrawer;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче