X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=379216759a4911badc12ae0953bf646c85ccfdf8;hb=faa66f7e00aeeea661b46f01bdfc715567eef669;hp=b732a2c6aa1d6ce1dd91affcc569a99df8f266cb;hpb=2fd8e1c1d5a04b167ffa73e9c011fd34faebe1fc;p=quassel.git diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index b732a2c6..37921675 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -353,6 +353,15 @@ void MainWin::restoreStateFromSettings(UiSettings &s) show(); } +QMenu *MainWin::createPopupMenu() +{ + QMenu *popupMenu = QMainWindow::createPopupMenu(); + popupMenu->addSeparator(); + ActionCollection *coll = QtUi::actionCollection("General"); + popupMenu->addAction(coll->action("ToggleMenuBar")); + return popupMenu; +} + void MainWin::updateIcon() { @@ -397,7 +406,7 @@ void MainWin::setupActions() coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll, this, SLOT(showAwayLog()))); coll->addAction("ToggleMenuBar", new Action(QIcon::fromTheme("show-menu"), tr("Show &Menubar"), coll, - 0, 0, QKeySequence(Qt::CTRL + Qt::Key_M)))->setCheckable(true); + 0, 0))->setCheckable(true); coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll, 0, 0))->setCheckable(true); @@ -459,6 +468,9 @@ void MainWin::setupActions() coll->addAction("JumpHotBuffer", new Action(tr("Jump to hot chat"), coll, this, SLOT(on_jumpHotBuffer_triggered()), QKeySequence(Qt::META + Qt::Key_A))); + coll->addAction("ActivateBufferFilter", new Action(tr("Activate the buffer search"), coll, + this, SLOT(on_bufferSearch_triggered()), QKeySequence(Qt::CTRL + Qt::Key_S))); + // Jump keys #ifdef Q_OS_MAC const int bindModifier = Qt::ControlModifier | Qt::AltModifier; @@ -1653,6 +1665,16 @@ void MainWin::on_jumpHotBuffer_triggered() Client::bufferModel()->switchToBuffer(_bufferHotList->hottestBuffer()); } +void MainWin::on_bufferSearch_triggered() +{ + if (_activeBufferViewIndex < 0 || _activeBufferViewIndex >= _bufferViews.count()) { + qWarning() << "Tried to activate filter on invalid bufferview:" << _activeBufferViewIndex; + return; + } + + _bufferViews[_activeBufferViewIndex]->activateFilter(); +} + void MainWin::onJumpKey() {