mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
upload code
This commit is contained in:
24
ui/dialog_hotkey.cpp
Normal file
24
ui/dialog_hotkey.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "dialog_hotkey.h"
|
||||
#include "ui_dialog_hotkey.h"
|
||||
|
||||
#include "ui/mainwindow.h"
|
||||
|
||||
DialogHotkey::DialogHotkey(QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogHotkey) {
|
||||
ui->setupUi(this);
|
||||
ui->show_mainwindow->setKeySequence(NekoRay::dataStore->hotkey_mainwindow);
|
||||
ui->show_groups->setKeySequence(NekoRay::dataStore->hotkey_group);
|
||||
ui->show_routes->setKeySequence(NekoRay::dataStore->hotkey_route);
|
||||
GetMainWindow()->RegisterHotkey(true);
|
||||
}
|
||||
|
||||
DialogHotkey::~DialogHotkey() {
|
||||
if (result() == QDialog::Accepted) {
|
||||
NekoRay::dataStore->hotkey_mainwindow = ui->show_mainwindow->keySequence().toString();
|
||||
NekoRay::dataStore->hotkey_group = ui->show_groups->keySequence().toString();
|
||||
NekoRay::dataStore->hotkey_route = ui->show_routes->keySequence().toString();
|
||||
NekoRay::dataStore->Save();
|
||||
}
|
||||
GetMainWindow()->RegisterHotkey(false);
|
||||
delete ui;
|
||||
}
|
||||
Reference in New Issue
Block a user