X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=55bc86dd4fca2576bb9fa168ec82e2f8754f87c8;hp=611f3da62822307dc1043944f944f6a079a60ed0;hb=10d250c78f36a41d98a6dca768f4e2dafec64e57;hpb=954fbc0a236ead64f568e9f591a5248c742084a0 diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index 611f3da..55bc86d 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() @@ -126,7 +138,7 @@ void Mainwindow::renameFunction(QListWidgetItem * item) { RenameFunctionDialog dialog; int result = dialog.exec(); if (QDialog::Accepted == result) { - LOG4CXX_DEBUG(logger, "renaming Function" << item->text().toStdString() + LOG4CXX_DEBUG(logger, "renaming Function " << item->text().toStdString() << " to " << dialog.result().toStdString()); item->setText(dialog.result()); } else {