/***************************************************************************
- * 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 *
#include <QStatusBar>
#include <QToolBar>
-#ifdef HAVE_KDE
+#ifdef HAVE_KDE4
# include <KAction>
# include <KActionCollection>
# include <KHelpMenu>
# include <KWindowSystem>
#endif
+#ifdef HAVE_KF5
+# include <KConfigWidgets/KStandardAction>
+# include <KXmlGui/KHelpMenu>
+# include <KXmlGui/KShortcutsDialog>
+#endif
+
#ifdef Q_WS_X11
# include <QX11Info>
#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
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,
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
_settingsMenu->addAction(coll->action("ConfigureQuassel"));
_helpMenu = menuBar()->addMenu(tr("&Help"));
+
_helpMenu->addAction(coll->action("AboutQuassel"));
#ifndef HAVE_KDE
_helpMenu->addAction(coll->action("AboutQt"));
setUnifiedTitleAndToolBarOnMac(true);
#endif
-#ifdef HAVE_KDE
+#ifdef HAVE_KDE4
_mainToolBar = new KToolBar("MainToolBar", this, Qt::TopToolBarArea, false, true, true);
#else
_mainToolBar = new QToolBar(this);
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();
if (!action)
return;
-#ifdef HAVE_KDE
+#ifdef HAVE_KDE4
KToggleFullScreenAction *kAct = static_cast<KToggleFullScreenAction *>(action);
kAct->setFullScreen(this, kAct->isChecked());
#else