Browse Source

I sure hope it works now...

tags/v5.0.0
ArsenArsen 5 years ago
parent
commit
04db6898b2
  1. 2
      hotkeying.cpp
  2. 4
      mainwindow.cpp
  3. 3
      mainwindow.hpp
  4. 5
      settingsdialog.cpp
  5. 3
      settingsdialog.hpp
  6. 4
      uploaders/uploadersingleton.cpp
  7. 2
      uploaders/uploadersingleton.hpp

2
hotkeying.cpp

@ -5,6 +5,7 @@
#include <settings.hpp>
QMap<QString, QHotkey *> hotkeys;
QList<QString> regNames;
// func gets bound only on first set, or load
void hotkeying::hotkey(QString seqName, QKeySequence seq, std::function<void()> func) {
@ -23,6 +24,7 @@ void hotkeying::load(QString seqName, std::function<void()> 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

4
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);

3
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:

5
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);
}

3
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);

4
uploaders/uploadersingleton.cpp

@ -109,3 +109,7 @@ QString UploaderSingleton::selectedUploader() {
QList<std::runtime_error> UploaderSingleton::errors() {
return errs;
}
QString UploaderSingleton::currentUploader() {
return uploader;
}

2
uploaders/uploadersingleton.hpp

@ -20,6 +20,8 @@ public:
void set(QString uploader);
QString selectedUploader();
QList<std::runtime_error> errors();
QString currentUploader();
signals:
void newUploader(Uploader *u);

Loading…
Cancel
Save