1
0
Fork 0

Added context menu icons for thread view (#1796)

* Added context menu icons for thread view

* Added thread setname icon
This commit is contained in:
fearless 2017-11-04 23:51:41 +00:00 committed by Duncan Ogilvie
parent 6d45928375
commit 2207ad9311
2 changed files with 16 additions and 16 deletions

View File

@ -24,31 +24,31 @@ void ThreadView::setupContextMenu()
{
mMenuBuilder = new MenuBuilder(this);
//Switch thread menu
mMenuBuilder->addAction(makeCommandAction(new QAction(tr("Switch Thread"), this), "switchthread $"));
mMenuBuilder->addAction(makeCommandAction(new QAction(DIcon("thread-switch.png"), tr("Switch Thread"), this), "switchthread $"));
//Suspend thread menu
mMenuBuilder->addAction(makeCommandAction(new QAction(tr("Suspend Thread"), this), "suspendthread $"));
mMenuBuilder->addAction(makeCommandAction(new QAction(DIcon("thread-pause.png"), tr("Suspend Thread"), this), "suspendthread $"));
//Resume thread menu
mMenuBuilder->addAction(makeCommandAction(new QAction(tr("Resume Thread"), this), "resumethread $"));
mMenuBuilder->addAction(makeCommandAction(new QAction(DIcon("thread-resume.png"), tr("Resume Thread"), this), "resumethread $"));
mMenuBuilder->addAction(makeCommandAction(new QAction(tr("Suspend All Threads"), this), "suspendallthreads"));
mMenuBuilder->addAction(makeCommandAction(new QAction(DIcon("thread-pause.png"), tr("Suspend All Threads"), this), "suspendallthreads"));
mMenuBuilder->addAction(makeCommandAction(new QAction(tr("Resume All Threads"), this), "resumeallthreads"));
mMenuBuilder->addAction(makeCommandAction(new QAction(DIcon("thread-resume.png"), tr("Resume All Threads"), this), "resumeallthreads"));
//Kill thread menu
mMenuBuilder->addAction(makeCommandAction(new QAction(tr("Kill Thread"), this), "killthread $"));
mMenuBuilder->addAction(makeCommandAction(new QAction(DIcon("thread-kill.png"), tr("Kill Thread"), this), "killthread $"));
mMenuBuilder->addSeparator();
// Set name
mMenuBuilder->addAction(makeAction(tr("Set Name"), SLOT(SetNameSlot())));
mMenuBuilder->addAction(makeAction(DIcon("thread-setname.png"), tr("Set Name"), SLOT(SetNameSlot())));
// Set priority
QAction* mSetPriorityIdle = makeCommandAction(new QAction(tr("Idle"), this), "setprioritythread $, Idle");
QAction* mSetPriorityAboveNormal = makeCommandAction(new QAction(tr("Above Normal"), this), "setprioritythread $, AboveNormal");
QAction* mSetPriorityBelowNormal = makeCommandAction(new QAction(tr("Below Normal"), this), "setprioritythread $, BelowNormal");
QAction* mSetPriorityHighest = makeCommandAction(new QAction(tr("Highest"), this), "setprioritythread $, Highest");
QAction* mSetPriorityLowest = makeCommandAction(new QAction(tr("Lowest"), this), "setprioritythread $, Lowest");
QAction* mSetPriorityNormal = makeCommandAction(new QAction(tr("Normal"), this), "setprioritythread $, Normal");
QAction* mSetPriorityTimeCritical = makeCommandAction(new QAction(tr("Time Critical"), this), "setprioritythread $, TimeCritical");
QAction* mSetPriorityIdle = makeCommandAction(new QAction(DIcon("thread-priority-idle.png"), tr("Idle"), this), "setprioritythread $, Idle");
QAction* mSetPriorityAboveNormal = makeCommandAction(new QAction(DIcon("thread-priority-above-normal.png"), tr("Above Normal"), this), "setprioritythread $, AboveNormal");
QAction* mSetPriorityBelowNormal = makeCommandAction(new QAction(DIcon("thread-priority-below-normal.png"), tr("Below Normal"), this), "setprioritythread $, BelowNormal");
QAction* mSetPriorityHighest = makeCommandAction(new QAction(DIcon("thread-priority-highest.png"), tr("Highest"), this), "setprioritythread $, Highest");
QAction* mSetPriorityLowest = makeCommandAction(new QAction(DIcon("thread-priority-lowest.png"), tr("Lowest"), this), "setprioritythread $, Lowest");
QAction* mSetPriorityNormal = makeCommandAction(new QAction(DIcon("thread-priority-normal.png"), tr("Normal"), this), "setprioritythread $, Normal");
QAction* mSetPriorityTimeCritical = makeCommandAction(new QAction(DIcon("thread-priority-timecritical.png"), tr("Time Critical"), this), "setprioritythread $, TimeCritical");
MenuBuilder* mSetPriority = new MenuBuilder(this, [this, mSetPriorityIdle, mSetPriorityAboveNormal, mSetPriorityBelowNormal,
mSetPriorityHighest, mSetPriorityLowest, mSetPriorityNormal, mSetPriorityTimeCritical](QMenu*)
{
@ -92,10 +92,10 @@ void ThreadView::setupContextMenu()
mSetPriority->addAction(mSetPriorityBelowNormal);
mSetPriority->addAction(mSetPriorityLowest);
mSetPriority->addAction(mSetPriorityIdle);
mMenuBuilder->addMenu(makeMenu(tr("Set Priority")), mSetPriority);
mMenuBuilder->addMenu(makeMenu(DIcon("thread-setpriority_alt.png"), tr("Set Priority")), mSetPriority);
// GoToThreadEntry
mMenuBuilder->addAction(makeAction(tr("Go to Thread Entry"), SLOT(GoToThreadEntry())), [this](QMenu * menu)
mMenuBuilder->addAction(makeAction(DIcon("thread-entry.png"), tr("Go to Thread Entry"), SLOT(GoToThreadEntry())), [this](QMenu * menu)
{
bool ok;
ULONGLONG entry = getCellContent(getInitialSelection(), 2).toULongLong(&ok, 16);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB