Fix a stupid mistake.........
This commit is contained in:
parent
ab39b32ea5
commit
b71b0a0582
@ -1,5 +1,6 @@
|
|||||||
#include "hotkeying.hpp"
|
#include "hotkeying.hpp"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QHotkey>
|
#include <QHotkey>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <settings.hpp>
|
#include <settings.hpp>
|
||||||
@ -25,7 +26,7 @@ void hotkeying::load(QString seqName, std::function<void()> func)
|
|||||||
{
|
{
|
||||||
QHotkey *h;
|
QHotkey *h;
|
||||||
if (settings::settings().contains(seqName.prepend("hotkey_")))
|
if (settings::settings().contains(seqName.prepend("hotkey_")))
|
||||||
h = new QHotkey(QKeySequence(settings::settings().value(seqName.prepend("hotkey_")).toString()), true);
|
h = new QHotkey(QKeySequence(settings::settings().value(seqName).toString()), true);
|
||||||
else
|
else
|
||||||
h = new QHotkey;
|
h = new QHotkey;
|
||||||
QObject::connect(h, &QHotkey::activated, func);
|
QObject::connect(h, &QHotkey::activated, func);
|
||||||
@ -39,5 +40,5 @@ bool hotkeying::valid(QString seq)
|
|||||||
|
|
||||||
QString hotkeying::sequence(QString seqName)
|
QString hotkeying::sequence(QString seqName)
|
||||||
{
|
{
|
||||||
return hotkeys.contains(seqName) ? hotkeys.value(seqName)->shortcut().toString() : "";
|
return hotkeys.contains(seqName.prepend("hotkey_")) ? hotkeys.value(seqName)->shortcut().toString() : "";
|
||||||
}
|
}
|
||||||
|
@ -79,10 +79,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||||||
else
|
else
|
||||||
ui->delay->setValue(0.25);
|
ui->delay->setValue(0.25);
|
||||||
|
|
||||||
// keys are hot, wait what
|
|
||||||
hotkeying::load("fullscreen", [this] { on_actionFullscreen_triggered(); });
|
|
||||||
hotkeying::load("area", [this] { on_actionArea_triggered(); });
|
|
||||||
|
|
||||||
ui->hotkeys->setSelectionMode(QListWidget::SingleSelection);
|
ui->hotkeys->setSelectionMode(QListWidget::SingleSelection);
|
||||||
|
|
||||||
addHotkeyItem("Fullscreen image", "fullscreen", new std::function<void()>([&] { on_actionFullscreen_triggered(); }));
|
addHotkeyItem("Fullscreen image", "fullscreen", new std::function<void()>([&] { on_actionFullscreen_triggered(); }));
|
||||||
|
Loading…
Reference in New Issue
Block a user