X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=b7b1469dae588ab502157de7f483a032d30163c7;hp=aadddff0600fef36d96480442d92e7bc7d8302d8;hb=56f70df273886f020699d296bcb7e3fbea237c09;hpb=f3d6f8088d8be6af9319a99fb8d2fee2837b540a diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index aadddff0..b7b1469d 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,12 @@ # include #endif +#ifdef HAVE_KF5 +# include +# include +# include +#endif + #ifdef Q_WS_X11 # include #endif @@ -146,8 +152,7 @@ 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 @@ -381,7 +386,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 +401,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 @@ -551,6 +556,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 +1004,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); @@ -1367,7 +1373,7 @@ void MainWin::showShortcutsDlg() KShortcutsDialog dlg(KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsDisallowed, this); foreach(KActionCollection *coll, QtUi::actionCollections()) dlg.addCollection(coll, coll->property("Category").toString()); - dlg.exec(); + dlg.configure(true); #else SettingsPageDlg dlg(new ShortcutsSettingsPage(QtUi::actionCollections(), this), this); dlg.exec(); @@ -1391,7 +1397,7 @@ void MainWin::onFullScreenToggled() if (!action) return; -#ifdef HAVE_KDE +#ifdef HAVE_KDE4 KToggleFullScreenAction *kAct = static_cast(action); kAct->setFullScreen(this, kAct->isChecked()); #else