Change shortcut for hiding the current buffer to a standard keysequence
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 14 Feb 2012 21:05:35 +0000 (22:05 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 14 Feb 2012 21:05:35 +0000 (22:05 +0100)
Ctrl+W is QKeySequence::Close, so use this to get the default key on weird platforms too.

src/qtui/mainwin.cpp
src/uisupport/bufferview.cpp

index f40aa9c..402f5eb 100644 (file)
@@ -390,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"));
 
@@ -456,8 +459,6 @@ 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() {
index 7bc359a..1828928 100644 (file)
@@ -489,9 +489,9 @@ void BufferView::hideCurrentBuffer() {
   QModelIndex index = selectionModel()->currentIndex();
   if(index.data(NetworkModel::ItemTypeRole) != NetworkModel::BufferItemType)
     return;
-  
+
   BufferId bufferId = index.data(NetworkModel::BufferIdRole).value<BufferId>();
-  
+
   //The check above means we won't be looking at a network, which should always be the first row, so we can just go backwards.
   changeBuffer(Backward);