From: Yordan Karadzhov <ykaradzhov@vmware.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH v2 2/6] kernel-shark-qt: Cosmetic modifications in KsQuickContextMenu
Date: Wed, 9 Jan 2019 15:09:41 +0200 [thread overview]
Message-ID: <20190109130945.28519-3-ykaradzhov@vmware.com> (raw)
In-Reply-To: <20190109130945.28519-1-ykaradzhov@vmware.com>
The following minor modifications in KsQuickContextMenu are introduced:
1. Removes the "Apply to list/graph" check-boxes.
2. Swaps the position of the Show / Hide actions
3. Adds "clear all filters" action.
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
| 63 +++++++---------------
| 4 +-
2 files changed, 23 insertions(+), 44 deletions(-)
--git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp
index 6c9c9ef..728ecbd 100644
--- a/kernel-shark-qt/src/KsQuickContextMenu.cpp
+++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp
@@ -62,7 +62,7 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row,
_addTaskPlotAction(this),
_removeCPUPlotAction(this),
_removeTaskPlotAction(this),
- _deselectAction(this)
+ _clearAllFilters(this)
{
typedef void (KsQuickContextMenu::*mfp)();
QString taskName, parentName, descr;
@@ -87,37 +87,14 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row,
parentName = parent->metaObject()->className();
- addSection("Pointer menu");
+ addSection("Pointer filter menu");
- if (parentName == "KsTraceViewer") {
- _graphSyncCBox =
- KsUtils::addCheckBoxToMenu(this, "Apply filters to Graph");
-
- connect(_graphSyncCBox, &QCheckBox::stateChanged,
- &KsUtils::graphFilterSync);
-
- /*
- * By defauls the filters will be append to the List (Table)
- * only.
- */
- KsUtils::listFilterSync(true);
- KsUtils::graphFilterSync(false);
- _graphSyncCBox->setChecked(false);
- }
-
- if (parentName == "KsTraceGraph" &&
- (graphs = dynamic_cast<KsTraceGraph *>(parent))) {
- _listSyncCBox =
- KsUtils::addCheckBoxToMenu(this, "Apply filters to List");
-
- connect(_listSyncCBox, &QCheckBox::stateChanged,
- &KsUtils::listFilterSync);
-
- /* By defauls the filters will be append to the Graph only. */
- KsUtils::graphFilterSync(true);
- KsUtils::listFilterSync(false);
- _listSyncCBox->setChecked(false);
- }
+ descr = "Show task [";
+ descr += taskName;
+ descr += "-";
+ descr += QString("%1").arg(pid);
+ descr += "] only";
+ lamAddAction(&_showTaskAction, &KsQuickContextMenu::_showTask);
descr = "Hide task [";
descr += taskName;
@@ -126,30 +103,30 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row,
descr += "]";
lamAddAction(&_hideTaskAction, &KsQuickContextMenu::_hideTask);
- descr = "Show task [";
- descr += taskName;
- descr += "-";
- descr += QString("%1").arg(pid);
+ descr = "Show event [";
+ descr += kshark_get_event_name_easy(_data->rows()[_row]);
descr += "] only";
- lamAddAction(&_showTaskAction, &KsQuickContextMenu::_showTask);
+ lamAddAction(&_showEventAction, &KsQuickContextMenu::_showEvent);
descr = "Hide event [";
descr += kshark_get_event_name_easy(_data->rows()[_row]);
descr += "]";
lamAddAction(&_hideEventAction, &KsQuickContextMenu::_hideEvent);
- descr = "Show event [";
- descr += kshark_get_event_name_easy(_data->rows()[_row]);
- descr += "] only";
- lamAddAction(&_showEventAction, &KsQuickContextMenu::_showEvent);
+ if (parentName == "KsTraceViewer") {
+ descr = QString("Show CPU [%1] only").arg(cpu);
+ lamAddAction(&_showCPUAction, &KsQuickContextMenu::_showCPU);
+ }
descr = QString("Hide CPU [%1]").arg(_data->rows()[_row]->cpu);
lamAddAction(&_hideCPUAction, &KsQuickContextMenu::_hideCPU);
- if (parentName == "KsTraceViewer") {
- descr = QString("Show CPU [%1] only").arg(cpu);
- lamAddAction(&_showCPUAction, &KsQuickContextMenu::_showCPU);
+ descr = "Clear all filters";
+ lamAddAction(&_clearAllFilters, &KsQuickContextMenu::_clearFilters);
+ addSection("Pointer plot menu");
+
+ if (parentName == "KsTraceViewer") {
descr = "Add [";
descr += taskName;
descr += "-";
--git a/kernel-shark-qt/src/KsQuickContextMenu.hpp b/kernel-shark-qt/src/KsQuickContextMenu.hpp
index f5a2a78..df8a65b 100644
--- a/kernel-shark-qt/src/KsQuickContextMenu.hpp
+++ b/kernel-shark-qt/src/KsQuickContextMenu.hpp
@@ -85,6 +85,8 @@ private:
QVector<int> _getFilterVector(tracecmd_filter_id *filter, int newId);
+ void _clearFilters() {_data->clearAllFilters();}
+
KsDataStore *_data;
size_t _row;
@@ -105,7 +107,7 @@ private:
QAction _removeTaskPlotAction;
- QAction _deselectAction;
+ QAction _clearAllFilters;
};
/**
--
2.17.1
next prev parent reply other threads:[~2019-01-09 13:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-09 13:09 [PATCH v2 0/6] Modifications toward KS 1.0 Yordan Karadzhov
2019-01-09 13:09 ` [PATCH v2 1/6] kernel-shark-qt: Rearrange the "Filter" top menu Yordan Karadzhov
2019-01-09 13:09 ` Yordan Karadzhov [this message]
2019-01-09 16:33 ` [PATCH v2 2/6] kernel-shark-qt: Cosmetic modifications in KsQuickContextMenu Steven Rostedt
2019-01-09 16:38 ` Yordan Karadzhov
2019-01-09 16:47 ` Steven Rostedt
2019-01-09 13:09 ` [PATCH v2 3/6] kernel-shark-qt: Make the selection in the Table less touchy Yordan Karadzhov
2019-01-09 13:09 ` [PATCH v2 4/6] kernel-shark-qt: Do not auto-scrolling when the marker switches Yordan Karadzhov
2019-01-09 13:09 ` [PATCH v2 5/6] kernel-shark-qt: Add the CPU filters to the filter clearing method Yordan Karadzhov
2019-01-09 13:09 ` [PATCH v2 6/6] kernel-shark-qt: Fix bug in plugin actions execution Yordan Karadzhov
2019-01-09 16:52 ` Steven Rostedt
2019-03-15 0:01 ` Steven Rostedt
2019-03-15 0:05 ` Steven Rostedt
2019-03-15 6:20 ` Yordan Karadzhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190109130945.28519-3-ykaradzhov@vmware.com \
--to=ykaradzhov@vmware.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).