X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=b64a0d93ebd5e0dac4d51105a0fc1cd19e6b654a;hb=2fabb938a014186c2aa7aa1a1b885c6afa353f1e;hp=aadddff0600fef36d96480442d92e7bc7d8302d8;hpb=f3d6f8088d8be6af9319a99fb8d2fee2837b540a;p=quassel.git diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index aadddff0..b64a0d93 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2014 by the Quassel Project * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -26,7 +26,7 @@ #include #include -#ifdef HAVE_KDE +#ifdef HAVE_KDE4 # include # include # include @@ -38,6 +38,11 @@ # include #endif +#ifdef HAVE_KF5 +# include +# include +#endif + #ifdef Q_WS_X11 # include #endif @@ -93,7 +98,7 @@ #include "topicwidget.h" #include "verticaldock.h" -#ifndef HAVE_KDE +#ifndef HAVE_KDE4 # ifdef HAVE_PHONON # include "phononnotificationbackend.h" # endif @@ -102,9 +107,9 @@ # endif # include "systraynotificationbackend.h" # include "taskbarnotificationbackend.h" -#else /* HAVE_KDE */ +#else /* HAVE_KDE4 */ # include "knotificationbackend.h" -#endif /* HAVE_KDE */ +#endif /* HAVE_KDE4 */ #ifdef HAVE_SSL # include "sslinfodlg.h" @@ -140,14 +145,13 @@ #include "settingspages/notificationssettingspage.h" #include "settingspages/topicwidgetsettingspage.h" -#ifndef HAVE_KDE +#ifndef HAVE_KDE4 # include "settingspages/shortcutssettingspage.h" #endif MainWin::MainWin(QWidget *parent) #ifdef HAVE_KDE - : KMainWindow(parent), - _kHelpMenu(new KHelpMenu(this, KGlobal::mainComponent().aboutData())), + : KMainWindow(parent), _kHelpMenu(new KHelpMenu(this)), #else : QMainWindow(parent), #endif @@ -214,7 +218,7 @@ void MainWin::init() setupTitleSetter(); setupHotList(); -#ifndef HAVE_KDE +#ifndef HAVE_KDE4 # ifdef HAVE_PHONON QtUi::registerNotificationBackend(new PhononNotificationBackend(this)); # endif @@ -226,9 +230,9 @@ void MainWin::init() QtUi::registerNotificationBackend(new TaskbarNotificationBackend(this)); -#else /* HAVE_KDE */ +#else /* HAVE_KDE4 */ QtUi::registerNotificationBackend(new KNotificationBackend(this)); -#endif /* HAVE_KDE */ +#endif /* HAVE_KDE4 */ #ifdef HAVE_INDICATEQT QtUi::registerNotificationBackend(new IndicatorNotificationBackend(this)); @@ -381,7 +385,7 @@ void MainWin::setupActions() coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll, 0, 0))->setCheckable(true); -#ifdef HAVE_KDE +#ifdef HAVE_KDE4 QAction *fullScreenAct = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll); #else QAction *fullScreenAct = new Action(QIcon::fromTheme("view-fullscreen"), tr("&Full Screen Mode"), coll, @@ -396,14 +400,14 @@ void MainWin::setupActions() configureShortcutsAct->setMenuRole(QAction::NoRole); coll->addAction("ConfigureShortcuts", configureShortcutsAct); - #ifdef Q_OS_MAC +#ifdef Q_OS_MAC QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll, this, SLOT(showSettingsDlg())); configureQuasselAct->setMenuRole(QAction::PreferencesRole); - #else +#else QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll, this, SLOT(showSettingsDlg()), QKeySequence(Qt::Key_F7)); - #endif +#endif coll->addAction("ConfigureQuassel", configureQuasselAct); // Help @@ -542,7 +546,7 @@ void MainWin::setupMenus() _viewMenu->addAction(coll->action("LockLayout")); _settingsMenu = menuBar()->addMenu(tr("&Settings")); -#ifdef HAVE_KDE +#ifdef HAVE_KDE4 _settingsMenu->addAction(KStandardAction::configureNotifications(this, SLOT(showNotificationsDlg()), this)); _settingsMenu->addAction(KStandardAction::keyBindings(this, SLOT(showShortcutsDlg()), this)); #else @@ -551,6 +555,7 @@ void MainWin::setupMenus() _settingsMenu->addAction(coll->action("ConfigureQuassel")); _helpMenu = menuBar()->addMenu(tr("&Help")); + _helpMenu->addAction(coll->action("AboutQuassel")); #ifndef HAVE_KDE _helpMenu->addAction(coll->action("AboutQt")); @@ -998,7 +1003,7 @@ void MainWin::setupToolBars() setUnifiedTitleAndToolBarOnMac(true); #endif -#ifdef HAVE_KDE +#ifdef HAVE_KDE4 _mainToolBar = new KToolBar("MainToolBar", this, Qt::TopToolBarArea, false, true, true); #else _mainToolBar = new QToolBar(this); @@ -1363,7 +1368,7 @@ void MainWin::showAboutDlg() void MainWin::showShortcutsDlg() { -#ifdef HAVE_KDE +#ifdef HAVE_KDE4 KShortcutsDialog dlg(KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsDisallowed, this); foreach(KActionCollection *coll, QtUi::actionCollections()) dlg.addCollection(coll, coll->property("Category").toString()); @@ -1391,7 +1396,7 @@ void MainWin::onFullScreenToggled() if (!action) return; -#ifdef HAVE_KDE +#ifdef HAVE_KDE4 KToggleFullScreenAction *kAct = static_cast(action); kAct->setFullScreen(this, kAct->isChecked()); #else