X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=402f5eb235d47d985d5e65cad6553dd07e7cde4b;hp=3e9783510bd9bd9fcc2aaa3616f256a480a3cf2d;hb=3ff1ec5b699a38e4a03deec4ea9576fade54cbbe;hpb=d5f5ce565bf61a020029f52c16fd3ea4f494d23e diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 3e978351..402f5eb2 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -26,6 +26,7 @@ # include # include # include +# include # include # include #endif @@ -340,20 +341,42 @@ void MainWin::setupActions() { coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll, 0, 0))->setCheckable(true); - coll->addAction("ToggleFullscreen", new Action(SmallIcon("window_fullscreen"), tr("&Fullscreen mode"), coll, - this, SLOT(toggleFullscreen()), QKeySequence(Qt::Key_F11))); + +#ifdef HAVE_KDE + QAction *fullScreenAct = KStandardAction::fullScreen(this, SLOT(toggleFullscreen()), this, coll); +#else + QAction *fullScreenAct = new Action(SmallIcon("view-fullscreen"), tr("&Full Screen Mode"), coll, + this, SLOT(toggleFullscreen()), QKeySequence(Qt::Key_F11)); + fullScreenAct->setCheckable(true); +#endif + coll->addAction("ToggleFullscreen", fullScreenAct); // Settings - coll->addAction("ConfigureShortcuts", new Action(SmallIcon("configure-shortcuts"), tr("Configure &Shortcuts..."), coll, - this, SLOT(showShortcutsDlg()))); - coll->addAction("ConfigureQuassel", new Action(SmallIcon("configure"), tr("&Configure Quassel..."), coll, - this, SLOT(showSettingsDlg()), QKeySequence(Qt::Key_F7))); + QAction *configureShortcutsAct = new Action(SmallIcon("configure-shortcuts"), tr("Configure &Shortcuts..."), coll, + this, SLOT(showShortcutsDlg())); + configureShortcutsAct->setMenuRole(QAction::NoRole); + coll->addAction("ConfigureShortcuts", configureShortcutsAct); + + #ifdef Q_WS_MAC + QAction *configureQuasselAct = new Action(SmallIcon("configure"), tr("&Configure Quassel..."), coll, + this, SLOT(showSettingsDlg())); + configureQuasselAct->setMenuRole(QAction::PreferencesRole); + #else + QAction *configureQuasselAct = new Action(SmallIcon("configure"), tr("&Configure Quassel..."), coll, + this, SLOT(showSettingsDlg()), QKeySequence(Qt::Key_F7)); + #endif + coll->addAction("ConfigureQuassel", configureQuasselAct); // Help - coll->addAction("AboutQuassel", new Action(SmallIcon("quassel"), tr("&About Quassel"), coll, - this, SLOT(showAboutDlg()))); - coll->addAction("AboutQt", new Action(QIcon(":/pics/qt-logo.png"), tr("About &Qt"), coll, - qApp, SLOT(aboutQt()))); + QAction *aboutQuasselAct = new Action(SmallIcon("quassel"), tr("&About Quassel"), coll, + this, SLOT(showAboutDlg())); + aboutQuasselAct->setMenuRole(QAction::AboutRole); + coll->addAction("AboutQuassel", aboutQuasselAct); + + QAction *aboutQtAct = new Action(QIcon(":/pics/qt-logo.png"), tr("About &Qt"), coll, + qApp, SLOT(aboutQt())); + aboutQtAct->setMenuRole(QAction::AboutQtRole); + coll->addAction("AboutQt", aboutQtAct); coll->addAction("DebugNetworkModel", new Action(SmallIcon("tools-report-bug"), tr("Debug &NetworkModel"), coll, this, SLOT(on_actionDebugNetworkModel_triggered()))); coll->addAction("DebugBufferViewOverlay", new Action(SmallIcon("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll, @@ -367,6 +390,9 @@ void MainWin::setupActions() { coll->addAction("ReloadStyle", new Action(SmallIcon("view-refresh"), tr("Reload Stylesheet"), coll, QtUi::style(), SLOT(reload()), QKeySequence::Refresh)); + coll->addAction("HideCurrentBuffer", new Action(tr("Hide Current Buffer"), coll, + this, SLOT(hideCurrentBuffer()), QKeySequence::Close)); + // Navigation coll = QtUi::actionCollection("Navigation", tr("Navigation")); @@ -690,6 +716,12 @@ void MainWin::previousBuffer() { view->previousBuffer(); } +void MainWin::hideCurrentBuffer() { + BufferView *view = activeBufferView(); + if(view) + view->hideCurrentBuffer(); +} + void MainWin::showNotificationsDlg() { SettingsPageDlg dlg(new NotificationsSettingsPage(this), this); dlg.exec(); @@ -1177,18 +1209,10 @@ void MainWin::showShortcutsDlg() { } void MainWin::toggleFullscreen() { - QAction *action = QtUi::actionCollection("General")->action("ToggleFullscreen"); - - if(isFullScreen()) { + if(isFullScreen()) showNormal(); - action->setIcon(SmallIcon("window_fullscreen")); - action->setText(tr("&Fullscreen mode")); - } - else { + else showFullScreen(); - action->setIcon(SmallIcon("window_nofullscreen")); - action->setText(tr("&Normal mode")); - } } /********************************************************************************************************/