From patchwork Wed Nov 28 15:16:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760033 Return-Path: Received: from mail-eopbgr710075.outbound.protection.outlook.com ([40.107.71.75]:2944 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728732AbeK2CS3 (ORCPT ); Wed, 28 Nov 2018 21:18:29 -0500 From: Yordan Karadzhov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 10/17] kernel-shark-qt: Add keyboard shortcuts for deselecting the marker Date: Wed, 28 Nov 2018 15:16:19 +0000 Message-ID: <20181128151530.21965-11-ykaradzhov@vmware.com> References: <20181128151530.21965-1-ykaradzhov@vmware.com> In-Reply-To: <20181128151530.21965-1-ykaradzhov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 2212 The active marker can now be deselected by pressing "Ctrl + D". Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/KsMainWindow.cpp | 7 ++++++- kernel-shark-qt/src/KsMainWindow.hpp | 2 ++ kernel-shark-qt/src/KsQuickContextMenu.cpp | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel-shark-qt/src/KsMainWindow.cpp b/kernel-shark-qt/src/KsMainWindow.cpp index 5c9a0fa..f4804bd 100644 --- a/kernel-shark-qt/src/KsMainWindow.cpp +++ b/kernel-shark-qt/src/KsMainWindow.cpp @@ -65,7 +65,8 @@ KsMainWindow::KsMainWindow(QWidget *parent) _colorPhaseSlider(Qt::Horizontal, this), _fullScreenModeAction("Full Screen Mode", this), _aboutAction("About", this), - _contentsAction("Contents", this) + _contentsAction("Contents", this), + _deselectShortcut(this) { setWindowTitle("Kernel Shark"); _createActions(); @@ -114,6 +115,10 @@ KsMainWindow::KsMainWindow(QWidget *parent) connect(&_plugins, &KsPluginManager::dataReload, &_data, &KsDataStore::reload); + _deselectShortcut.setKey(Qt::CTRL + Qt::Key_D); + connect(&_deselectShortcut, &QShortcut::activated, + this, &KsMainWindow::_deselect); + _resizeEmpty(); } diff --git a/kernel-shark-qt/src/KsMainWindow.hpp b/kernel-shark-qt/src/KsMainWindow.hpp index b9b681f..5938a25 100644 --- a/kernel-shark-qt/src/KsMainWindow.hpp +++ b/kernel-shark-qt/src/KsMainWindow.hpp @@ -147,6 +147,8 @@ private: QAction _contentsAction; + QShortcut _deselectShortcut; + void _open(); void _restorSession(); diff --git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp index 0a8e527..16b8d19 100644 --- a/kernel-shark-qt/src/KsQuickContextMenu.cpp +++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp @@ -26,6 +26,8 @@ KsQuickMarkerMenu::KsQuickMarkerMenu(KsDualMarkerSM *dm, QWidget *parent) if (dm->activeMarker()._isSet) { addSection("Marker menu"); _deselectAction.setText("Deselect"); + _deselectAction.setShortcut(tr("Ctrl+D")); + _deselectAction.setStatusTip(tr("Deselect marker")); connect(&_deselectAction, &QAction::triggered, this, &KsQuickMarkerMenu::deselect);