Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qcocoamenuloader_mac.mm

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4747#include <private/qapplication_p.h>
    4848#include <private/qt_mac_p.h>
     49#include <private/qmenubar_p.h>
    4950#include <qmenubar.h>
     51#include <private/qt_cocoa_helpers_mac_p.h>
    5052
    5153QT_FORWARD_DECLARE_CLASS(QCFString)
    5254QT_FORWARD_DECLARE_CLASS(QString)
    5355
     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
    5462QT_USE_NAMESPACE
    5563
     
    5866- (void)awakeFromNib
    5967{
     68    servicesItem = [[appMenu itemWithTitle:@"Services"] retain];
     69    hideAllOthersItem = [[appMenu itemWithTitle:@"Hide Others"] retain];
     70    showAllItem = [[appMenu itemWithTitle:@"Show All"] retain];
     71
    6072    // Get the names in the nib to match the app name set by Qt.
    6173    NSString *appName = reinterpret_cast<const NSString*>(QCFString::toCFStringRef(qAppName()));
     
    7890{
    7991    // The application menu is the menu in the menu bar that contains the
    80     // 'Quit' item. When changing menu bar (e.g when swithing between
     92    // 'Quit' item. When changing menu bar (e.g when switching between
    8193    // windows with different menu bars), we never recreate this menu, but
    8294    // instead pull it out the current menu bar and place into the new one:
     
    119131- (void)dealloc
    120132{
     133    [servicesItem release];
     134    [hideAllOthersItem release];
     135    [showAllItem release];
     136
    121137    [lastAppSpecificItem release];
    122138    [theMenu release];
     
    207223{
    208224    [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
    209243}
    210244
     
    222256    }
    223257}
     258
     259 - (void)orderFrontCharacterPalette:(id)sender
     260 {
     261     [NSApp orderFrontCharacterPalette:sender];
     262 }
    224263@end
    225264#endif // QT_MAC_USE_COCOA
Note: See TracChangeset for help on using the changeset viewer.