X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=754d5b2b0f1ab244b7932e77f571b14f1abc4d85;hp=611f3da62822307dc1043944f944f6a079a60ed0;hb=26ff0a6f5b4ea19657f851a82a8d679f10d19edb;hpb=954fbc0a236ead64f568e9f591a5248c742084a0 diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index 611f3da..754d5b2 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -62,6 +62,18 @@ Mainwindow::Mainwindow(InformationManager* mgr) auto item = new QListWidgetItem(name.c_str(), listWidget); item->setBackground(QBrush(QColor(0xff, 0xdd, 0xdd))); }); + setGlobalHotkeys(); +} + +void Mainwindow::setGlobalHotkeys() { + QShortcut *shortcut = new QShortcut(QKeySequence("f"), this); + connect(shortcut, &QShortcut::activated, this, &Mainwindow::requestNewFunction); + + shortcut = new QShortcut(QKeySequence("r"), listWidget); + connect(shortcut, &QShortcut::activated, [=]() { + QListWidgetItem * item = listWidget->currentItem(); + if (item) renameFunction(item); + }); } void Mainwindow::quit()