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

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

charm(-qt5): new port for qt[45] (Thanks, Rene: see issue #46575)

File size: 5.0 KB
  • Charm/ApplicationCore.cpp

    diff --git Charm/ApplicationCore.cpp Charm/ApplicationCore.cpp
    index 17cd0fe..964d098 100644
    ApplicationCore::ApplicationCore( QObject* parent ) 
    158158             SLOT( slotQuitApplication() ) );
    159159
    160160    m_actionAboutDialog.setText( tr( "About Charm" ) );
     161    m_actionAboutDialog.setMenuRole(QAction::AboutRole);
    161162    connect( &m_actionAboutDialog, SIGNAL( triggered() ),
    162163             &mainView(),  SLOT( slotAboutDialog() ) );
    163164
    164165    m_actionPreferences.setText( tr( "Preferences" ) );
     166    m_actionPreferences.setMenuRole(QAction::PreferencesRole);
    165167    m_actionPreferences.setIcon( Data::configureIcon() );
    166168    connect( &m_actionPreferences, SIGNAL( triggered( bool ) ),
    167169             &mainView(),  SLOT( slotEditPreferences( bool ) ) );
    void ApplicationCore::createWindowMenu( QMenuBar *menuBar ) 
    260262    menu->addAction( &m_actionActivityReport );
    261263    menu->addAction( &m_actionWeeklyTimesheetReport );
    262264    menu->addAction( &m_actionMonthlyTimesheetReport );
    263 #ifndef Q_OS_OSX
     265#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    264266    menu->addSeparator();
    265267#endif
    266268    menu->addAction( &m_actionPreferences );
    void ApplicationCore::createFileMenu( QMenuBar *menuBar ) 
    277279    menu->addAction( &m_actionSyncTasks );
    278280    menu->addAction( &m_actionImportTasks );
    279281    menu->addAction( &m_actionExportTasks );
    280 #ifndef Q_OS_OSX
     282#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    281283    menu->addSeparator();
    282284#endif
    283285    menu->addAction( &m_actionQuit );
  • Charm/Charm.cpp

    diff --git Charm/Charm.cpp Charm/Charm.cpp
    index 4872e3a..951ba5a 100644
     
    1313
    1414static ApplicationCore* createApplicationCore()
    1515{
    16 #ifdef Q_OS_OSX
    17     return new MacApplicationCore;
    18 #endif
     16// #if defined(Q_OS_OSX) || defined(Q_OS_MAC)
     17//     // this seems to disable (menu) shortcuts...
     18//     return new MacApplicationCore;
     19// #endif
    1920    return new ApplicationCore;
    2021}
    2122
    int main ( int argc, char** argv ) 
    4647
    4748    try {
    4849        QApplication app( argc, argv );
     50#if defined(Q_OS_MAC) || defined(Q_OS_OSX)
     51        app.setAttribute(Qt::AA_DontShowIconsInMenus);
     52#endif
    4953        QScopedPointer<ApplicationCore> core( createApplicationCore() );
    5054        QObject::connect( &app, SIGNAL(commitDataRequest(QSessionManager&)), core.data(), SLOT(commitData(QSessionManager&)) );
    5155        QObject::connect( &app, SIGNAL(saveStateRequest(QSessionManager&)), core.data(), SLOT(saveState(QSessionManager&)) );
  • Charm/Data.cpp

    diff --git Charm/Data.cpp Charm/Data.cpp
    index ad8abfa..a7778b1 100644
    const QIcon& Data::charmTrayIcon() 
    1818    // On X11: pure-Qt apps get 22x22 from QSystemTrayIcon.
    1919    // KDE apps seem to get 24x24 in KSystemTrayIcon via KIconLoader, which is actually better.
    2020
    21 #ifdef Q_OS_OSX
     21#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    2222    static const QString iconPath = QLatin1String(":/Charm/charmtray_mac.png");
    2323#else
    2424    static const QString iconPath = QLatin1String(":/Charm/charmtray22.png");
    const QIcon& Data::charmTrayActiveIcon() 
    3737    // On X11: pure-Qt apps get 22x22 from QSystemTrayIcon.
    3838    // KDE apps seem to get 24x24 in KSystemTrayIcon via KIconLoader, which is actually better.
    3939
    40 #ifdef Q_OS_OSX
     40#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    4141    static const QString iconPath = QLatin1String(":/Charm/charmtrayactive_mac.png");
    4242#else
    4343    static const QString iconPath = QLatin1String(":/Charm/charmtrayactive22.png");
  • Charm/Idle/IdleDetector.cpp

    diff --git Charm/Idle/IdleDetector.cpp Charm/Idle/IdleDetector.cpp
    index 131e76e..47c575c 100644
    IdleDetector::IdleDetector( QObject* parent ) 
    2020IdleDetector* IdleDetector::createIdleDetector( QObject* parent )
    2121{
    2222#ifdef CHARM_IDLE_DETECTION
    23 #ifdef Q_OS_OSX
     23#if defined(Q_OS_OSX) || defined(Q_OS_MAC)
    2424    return new MacIdleDetector( parent );
    2525#endif
    2626
  • Charm/Widgets/CharmWindow.cpp

    diff --git Charm/Widgets/CharmWindow.cpp Charm/Widgets/CharmWindow.cpp
    index 375aedc..8bd7657 100644
    void CharmWindow::setWindowNumber( int number ) 
    8585    delete m_shortcut;
    8686    m_shortcut = new QShortcut( this );
    8787    QKeySequence sequence( tr( "Ctrl+%1" ).arg( number ) );
    88 #ifdef Q_OS_OSX
     88#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    8989    m_shortcut->setKey( sequence );
    9090#endif
    9191    m_shortcut->setContext( Qt::ApplicationShortcut );
  • Charm/Widgets/EventView.cpp

    diff --git Charm/Widgets/EventView.cpp Charm/Widgets/EventView.cpp
    index 2fb9ef4..2eae8aa 100644
    EventView::EventView( QToolBar* toolBar, QWidget* parent ) 
    9696    m_actionDeleteEvent.setText( tr( "Delete Event..." ) );
    9797    QList<QKeySequence> deleteShortcuts;
    9898    deleteShortcuts << QKeySequence::Delete;
    99 #ifdef Q_OS_OSX
     99#if !defined(Q_OS_OSX) && !defined(Q_OS_MAC)
    100100    deleteShortcuts << Qt::Key_Backspace;
    101101#endif
    102102    m_actionDeleteEvent.setShortcuts(deleteShortcuts);
Note: See TracBrowser for help on using the repository browser.