From 3ff1ec5b699a38e4a03deec4ea9576fade54cbbe Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Tue, 14 Feb 2012 22:05:35 +0100 Subject: [PATCH] Change shortcut for hiding the current buffer to a standard keysequence Ctrl+W is QKeySequence::Close, so use this to get the default key on weird platforms too. --- src/qtui/mainwin.cpp | 5 +++-- src/uisupport/bufferview.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index f40aa9c9..402f5eb2 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -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() { diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index 7bc359a8..18289284 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -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(); - + //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); -- 2.20.1