diff --git a/hotkeying.cpp b/hotkeying.cpp index e09eff6..dd4ec7c 100644 --- a/hotkeying.cpp +++ b/hotkeying.cpp @@ -5,6 +5,7 @@ #include QMap hotkeys; +QList regNames; // func gets bound only on first set, or load void hotkeying::hotkey(QString seqName, QKeySequence seq, std::function func) { @@ -23,6 +24,7 @@ void hotkeying::load(QString seqName, std::function func, QString def) { QHotkey *h; QString name = seqName; name.prepend("hotkey_"); + if (hotkeys.contains(seqName)) return; if (settings::settings().contains(name)) h = new QHotkey(QKeySequence(settings::settings().value(name).toString()), true); else diff --git a/mainwindow.cpp b/mainwindow.cpp index 20af60c..2cb1c1d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -134,6 +134,10 @@ void MainWindow::on_actionStop_triggered() { controller->end(); } +void MainWindow::on_actionColor_Picker_triggered() { + ColorPickerScene::showPicker(); +} + void MainWindow::on_actionSettings_triggered() { SettingsDialog *dialog = new SettingsDialog(this); dialog->setAttribute(Qt::WA_DeleteOnClose); diff --git a/mainwindow.hpp b/mainwindow.hpp index 90c091d..cc52b30 100644 --- a/mainwindow.hpp +++ b/mainwindow.hpp @@ -25,9 +25,8 @@ private slots: void on_actionArea_triggered(); void on_actionStart_triggered(); void on_actionStop_triggered(); - void on_actionSettings_triggered(); - + void on_actionColor_Picker_triggered(); void on_actionAbout_triggered(); public: diff --git a/settingsdialog.cpp b/settingsdialog.cpp index 89f8d91..595f755 100644 --- a/settingsdialog.cpp +++ b/settingsdialog.cpp @@ -80,6 +80,7 @@ void SettingsDialog::newUploader(Uploader *u) { QListWidgetItem *uploader = new QListWidgetItem(u->name(), ui->uploaderList); uploader->setToolTip(u->description()); ui->uploaderList->addItem(uploader); + if (UploaderSingleton::inst().currentUploader() == u->name()) ui->uploaderList->setCurrentItem(uploader); } void SettingsDialog::on_uploaderList_clicked(const QModelIndex &) { @@ -120,10 +121,6 @@ void SettingsDialog::on_hideToTray_clicked(bool checked) { settings::settings().setValue("hideOnClose", checked); } -void SettingsDialog::on_actionColor_Picker_triggered() { - ColorPickerScene::showPicker(); -} - void SettingsDialog::on_captureCursor_clicked(bool checked) { settings::settings().setValue("captureCursor", checked); } diff --git a/settingsdialog.hpp b/settingsdialog.hpp index 978a045..3916b68 100644 --- a/settingsdialog.hpp +++ b/settingsdialog.hpp @@ -18,14 +18,13 @@ public: void setScheme(QString scheme); void newUploader(Uploader *u); +public slots: void on_uploaderList_clicked(const QModelIndex &); - void on_nameScheme_textEdited(const QString &arg1); void on_delay_valueChanged(double arg1); void on_hotkeys_doubleClicked(const QModelIndex &index); void on_settingsButton_clicked(); void on_quickMode_clicked(bool checked); void on_hideToTray_clicked(bool checked); - void on_actionColor_Picker_triggered(); void on_captureCursor_clicked(bool checked); void on_formatBox_currentIndexChanged(int index); void on_imageFormatBox_currentIndexChanged(int index); diff --git a/uploaders/uploadersingleton.cpp b/uploaders/uploadersingleton.cpp index 2ed24a9..dcc13e6 100644 --- a/uploaders/uploadersingleton.cpp +++ b/uploaders/uploadersingleton.cpp @@ -109,3 +109,7 @@ QString UploaderSingleton::selectedUploader() { QList UploaderSingleton::errors() { return errs; } + +QString UploaderSingleton::currentUploader() { + return uploader; +} diff --git a/uploaders/uploadersingleton.hpp b/uploaders/uploadersingleton.hpp index 95b84e1..6f3efe5 100644 --- a/uploaders/uploadersingleton.hpp +++ b/uploaders/uploadersingleton.hpp @@ -20,6 +20,8 @@ public: void set(QString uploader); QString selectedUploader(); QList errors(); + QString currentUploader(); + signals: void newUploader(Uploader *u);