source: trunk/dports/office/charm/files/adapt-to-osx-macports.patch @ 133829

Last change on this file since 133829 was 133829, checked in by mk@…, 4 years ago

charm: update to latest git faaf49e9 (which fixes some Cocoa issues)

File size: 5.0 KB
  • Charm/ApplicationCore.cpp

    diff --git Charm/ApplicationCore.cpp Charm/ApplicationCore.cpp
    index bf4832f..29f6a81 100644
    ApplicationCore::ApplicationCore( QObject* parent ) 
    173173             SLOT(slotQuitApplication()) );
    174174
    175175    m_actionAboutDialog.setText( tr( "About Charm" ) );
     176    m_actionAboutDialog.setMenuRole(QAction::AboutRole);
    176177    connect( &m_actionAboutDialog, SIGNAL(triggered()),
    177178             &mainView(),  SLOT(slotAboutDialog()) );
    178179
    179180    m_actionPreferences.setText( tr( "Preferences" ) );
    180181    m_actionPreferences.setIcon( Data::configureIcon() );
     182    m_actionPreferences.setMenuRole(QAction::PreferencesRole);
    181183    connect( &m_actionPreferences, SIGNAL(triggered(bool)),
    182184             &mainView(),  SLOT(slotEditPreferences(bool)) );
    183185    m_actionPreferences.setEnabled( true );
    void ApplicationCore::createWindowMenu( QMenuBar *menuBar ) 
    275277    menu->addAction( &m_actionActivityReport );
    276278    menu->addAction( &m_actionWeeklyTimesheetReport );
    277279    menu->addAction( &m_actionMonthlyTimesheetReport );
    278 #ifndef Q_OS_OSX
     280#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    279281    menu->addSeparator();
    280282#endif
    281283    menu->addAction( &m_actionPreferences );
    void ApplicationCore::createFileMenu( QMenuBar *menuBar ) 
    292294    menu->addAction( &m_actionSyncTasks );
    293295    menu->addAction( &m_actionImportTasks );
    294296    menu->addAction( &m_actionExportTasks );
    295 #ifndef Q_OS_OSX
     297#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    296298    menu->addSeparator();
    297299#endif
    298300    menu->addAction( &m_actionQuit );
  • Charm/Charm.cpp

    diff --git Charm/Charm.cpp Charm/Charm.cpp
    index cc05cbe..19e03f7 100644
     
    3838
    3939static ApplicationCore* createApplicationCore()
    4040{
    41 #ifdef Q_OS_OSX
    42     return new MacApplicationCore;
    43 #endif
     41// #if defined(Q_OS_OSX) || defined(Q_OS_MAC)
     42//     // this seems to disable (menu) shortcuts...
     43//     return new MacApplicationCore;
     44// #endif
    4445    return new ApplicationCore;
    4546}
    4647
    int main ( int argc, char** argv ) 
    7172
    7273    try {
    7374        QApplication app( argc, argv );
     75#if defined(Q_OS_MAC) || defined(Q_OS_OSX)
     76        app.setAttribute(Qt::AA_DontShowIconsInMenus);
     77#endif
    7478        QScopedPointer<ApplicationCore> core( createApplicationCore() );
    7579        QObject::connect( &app, SIGNAL(commitDataRequest(QSessionManager&)), core.data(), SLOT(commitData(QSessionManager&)) );
    7680        QObject::connect( &app, SIGNAL(saveStateRequest(QSessionManager&)), core.data(), SLOT(saveState(QSessionManager&)) );
  • Charm/Data.cpp

    diff --git Charm/Data.cpp Charm/Data.cpp
    index b5cf19e..b823d09 100644
    const QIcon& Data::charmTrayIcon() 
    4646    // On X11: pure-Qt apps get 22x22 from QSystemTrayIcon.
    4747    // KDE apps seem to get 24x24 in KSystemTrayIcon via KIconLoader, which is actually better.
    4848
    49 #ifdef Q_OS_OSX
     49#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    5050    static const QString iconPath = QLatin1String(":/Charm/charmtray_mac.png");
    5151#else
    5252    static const QString iconPath = QLatin1String(":/Charm/charmtray22.png");
    const QIcon& Data::charmTrayActiveIcon() 
    6565    // On X11: pure-Qt apps get 22x22 from QSystemTrayIcon.
    6666    // KDE apps seem to get 24x24 in KSystemTrayIcon via KIconLoader, which is actually better.
    6767
    68 #ifdef Q_OS_OSX
     68#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    6969    static const QString iconPath = QLatin1String(":/Charm/charmtrayactive_mac.png");
    7070#else
    7171    static const QString iconPath = QLatin1String(":/Charm/charmtrayactive22.png");
  • Charm/Idle/IdleDetector.cpp

    diff --git Charm/Idle/IdleDetector.cpp Charm/Idle/IdleDetector.cpp
    index 4da8dd3..6380bb7 100644
    IdleDetector::IdleDetector( QObject* parent ) 
    4646IdleDetector* IdleDetector::createIdleDetector( QObject* parent )
    4747{
    4848#ifdef CHARM_IDLE_DETECTION
    49 #ifdef Q_OS_OSX
     49#if defined(Q_OS_OSX) || defined(Q_OS_MAC)
    5050    return new MacIdleDetector( parent );
    5151#endif
    5252
  • Charm/Widgets/CharmWindow.cpp

    diff --git Charm/Widgets/CharmWindow.cpp Charm/Widgets/CharmWindow.cpp
    index 565d751..dcb9fcb 100644
    void CharmWindow::setWindowNumber( int number ) 
    108108    delete m_shortcut;
    109109    m_shortcut = new QShortcut( this );
    110110    QKeySequence sequence( tr( "Ctrl+%1" ).arg( number ) );
    111 #ifdef Q_OS_OSX
     111#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    112112    m_shortcut->setKey( sequence );
    113113#endif
    114114    m_shortcut->setContext( Qt::ApplicationShortcut );
  • Charm/Widgets/EventView.cpp

    diff --git Charm/Widgets/EventView.cpp Charm/Widgets/EventView.cpp
    index e295d9d..76a4789 100644
    EventView::EventView( QToolBar* toolBar, QWidget* parent ) 
    119119    m_actionDeleteEvent.setText( tr( "Delete Event..." ) );
    120120    QList<QKeySequence> deleteShortcuts;
    121121    deleteShortcuts << QKeySequence::Delete;
    122 #ifdef Q_OS_OSX
     122#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    123123    deleteShortcuts << Qt::Key_Backspace;
    124124#endif
    125125    m_actionDeleteEvent.setShortcuts(deleteShortcuts);
Note: See TracBrowser for help on using the repository browser.