Add a shortcut for hiding current buffer.
[quassel.git] / src / qtui / mainwin.cpp
index 5d50acc..f40aa9c 100644 (file)
@@ -456,6 +456,8 @@ void MainWin::setupActions() {
                                            this, SLOT(nextBuffer()), QKeySequence(Qt::ALT + Qt::Key_Down)));
   coll->addAction("PreviousBuffer", new Action(SmallIcon("go-up"), tr("Go to Previous Chat"), coll,
                                                this, SLOT(previousBuffer()), QKeySequence(Qt::ALT + Qt::Key_Up)));
+  coll->addAction("HideCurrentBuffer", new Action(tr("Hide Current Buffer"), coll,
+                                                  this, SLOT(hideCurrentBuffer()), QKeySequence(Qt::ControlModifier + Qt::Key_W)));
 }
 
 void MainWin::setupMenus() {
@@ -713,6 +715,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();