This commit is contained in:
Rob Campbell 2008-07-18 11:35:13 -03:00
Родитель 48da4723b5
Коммит 9f83db47de
1 изменённых файлов: 21 добавлений и 41 удалений

Просмотреть файл

@ -70,7 +70,6 @@ BOOL gSomeMenuBarPainted = NO;
// these items are always strong ref'd by their owning menu bar (instance variable).
static nsIContent* sAboutItemContent = nsnull;
static nsIContent* sPrefItemContent = nsnull;
static nsIContent* sUpdateItemContent = nsnull;
static nsIContent* sQuitItemContent = nsnull;
// Special command IDs that we know Mac OS X does not use for anything else. We use
@ -80,8 +79,7 @@ enum {
eCommand_ID_About = 1,
eCommand_ID_Prefs = 2,
eCommand_ID_Quit = 3,
eCommand_ID_Update = 4,
eCommand_ID_Last = 5
eCommand_ID_Last = 4
};
@ -127,8 +125,6 @@ nsMenuBarX::~nsMenuBarX()
sQuitItemContent = nsnull;
if (sPrefItemContent == mPrefItemContent)
sPrefItemContent = nsnull;
if (sUpdateItemContent == mUpdateItemContent)
sUpdateItemContent = nsnull;
// make sure we unregister ourselves as a document observer
if (mDocument)
@ -417,20 +413,19 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
Menu Item DOM Node ID Notes
=======================
==================
= About This App = <- aboutName
=======================
==================
= Preferences... = <- menu_preferences
= Check for updates...=
=======================
==================
= Services > = <- menu_mac_services <- (do not define key equivalent)
=======================
==================
= Hide App = <- menu_mac_hide_app
= Hide Others = <- menu_mac_hide_others
= Show All = <- menu_mac_show_all
=======================
==================
= Quit = <- menu_FileQuitItem
=======================
==================
If any of them are ommitted from the application's DOM, we just don't add
them. We always add a "Quit" item, but if an app developer does not provide a
@ -470,17 +465,8 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
[sApplicationMenu addItem:itemBeingAdded];
[itemBeingAdded release];
itemBeingAdded = nil;
}
// Add the Check for updates menu item
itemBeingAdded = CreateNativeAppMenuItem(inMenu, NS_LITERAL_STRING("checkForUpdates"), @selector(menuItemHit:),
eCommand_ID_Update, nsMenuBarX::sNativeEventTarget);
if (itemBeingAdded) {
[sApplicationMenu addItem:itemBeingAdded];
[itemBeingAdded release];
itemBeingAdded = nil;
// Add separator after Check for updates menu item
// Add separator after Preferences menu
[sApplicationMenu addItem:[NSMenuItem separatorItem]];
}
@ -826,12 +812,6 @@ static BOOL gActOnSpecialCommands = YES;
mostSpecificContent = menuBar->mPrefItemContent;
nsMenuUtilsX::DispatchCommandTo(mostSpecificContent);
}
else if (tag == eCommand_ID_Update) {
nsIContent* mostSpecificContent = sPrefUpdateContent;
if (menuBar && menuBar->mUpdateItemContent)
mostSpecificContent = menuBar->mUpdateItemContent;
MenuHelpersX::DispatchCommandTo(mostSpecificContent);
}
else if (tag == eCommand_ID_Quit) {
nsIContent* mostSpecificContent = sQuitItemContent;
if (menuBar && menuBar->mQuitItemContent)