Changeset 846 for trunk/src/gui/kernel/qcocoamenuloader_mac.mm
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qcocoamenuloader_mac.mm
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 47 47 #include <private/qapplication_p.h> 48 48 #include <private/qt_mac_p.h> 49 #include <private/qmenubar_p.h> 49 50 #include <qmenubar.h> 51 #include <private/qt_cocoa_helpers_mac_p.h> 50 52 51 53 QT_FORWARD_DECLARE_CLASS(QCFString) 52 54 QT_FORWARD_DECLARE_CLASS(QString) 53 55 56 #ifndef QT_NO_TRANSLATION 57 QT_BEGIN_NAMESPACE 58 extern QString qt_mac_applicationmenu_string(int type); 59 QT_END_NAMESPACE 60 #endif 61 54 62 QT_USE_NAMESPACE 55 63 … … 58 66 - (void)awakeFromNib 59 67 { 68 servicesItem = [[appMenu itemWithTitle:@"Services"] retain]; 69 hideAllOthersItem = [[appMenu itemWithTitle:@"Hide Others"] retain]; 70 showAllItem = [[appMenu itemWithTitle:@"Show All"] retain]; 71 60 72 // Get the names in the nib to match the app name set by Qt. 61 73 NSString *appName = reinterpret_cast<const NSString*>(QCFString::toCFStringRef(qAppName())); … … 78 90 { 79 91 // The application menu is the menu in the menu bar that contains the 80 // 'Quit' item. When changing menu bar (e.g when swit hing between92 // 'Quit' item. When changing menu bar (e.g when switching between 81 93 // windows with different menu bars), we never recreate this menu, but 82 94 // instead pull it out the current menu bar and place into the new one: … … 119 131 - (void)dealloc 120 132 { 133 [servicesItem release]; 134 [hideAllOthersItem release]; 135 [showAllItem release]; 136 121 137 [lastAppSpecificItem release]; 122 138 [theMenu release]; … … 207 223 { 208 224 [NSApp hide:sender]; 225 } 226 227 - (void)qtUpdateMenubar 228 { 229 QMenuBarPrivate::macUpdateMenuBarImmediatly(); 230 } 231 232 - (void)qtTranslateApplicationMenu 233 { 234 #ifndef QT_NO_TRANSLATION 235 [servicesItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(0))]; 236 [hideItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(1).arg(qAppName()))]; 237 [hideAllOthersItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(2))]; 238 [showAllItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(3))]; 239 [preferencesItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(4))]; 240 [quitItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(5).arg(qAppName()))]; 241 [aboutItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(6).arg(qAppName()))]; 242 #endif 209 243 } 210 244 … … 222 256 } 223 257 } 258 259 - (void)orderFrontCharacterPalette:(id)sender 260 { 261 [NSApp orderFrontCharacterPalette:sender]; 262 } 224 263 @end 225 264 #endif // QT_MAC_USE_COCOA
Note:
See TracChangeset
for help on using the changeset viewer.