Qt... Why though...

This commit is contained in:
ArsenArsen 2017-06-22 23:21:15 +02:00
parent da717c9886
commit f7524e7c52
2 changed files with 7 additions and 9 deletions

View File

@ -35,10 +35,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::Se
for (Uploader *u : UploaderSingleton::inst().uploaderList()) newUploader(u); for (Uploader *u : UploaderSingleton::inst().uploaderList()) newUploader(u);
// Set filename scheme // Set filename scheme
if ((settings::settings().contains("fileFormat"))) setScheme(settings::settings().value("fileFormat", "Screenshot %(yyyy-MM-dd HH:mm:ss)date.ext").toString());
setScheme(settings::settings().value("fileFormat").toString());
else
setScheme("Screenshot %(yyyy-MM-dd HH:mm:ss)date.ext");
// Set delay // Set delay
if ((settings::settings().contains("delay"))) if ((settings::settings().contains("delay")))
@ -95,6 +93,10 @@ void SettingsDialog::on_nameScheme_textEdited(const QString &arg1) {
settings::settings().setValue("fileFormat", arg1); settings::settings().setValue("fileFormat", arg1);
} }
void SettingsDialog::on_nameScheme_textChanged(const QString &arg1) {
settings::settings().setValue("fileFormat", arg1);
}
void SettingsDialog::on_delay_valueChanged(double arg1) { void SettingsDialog::on_delay_valueChanged(double arg1) {
settings::settings().setValue("delay", arg1); settings::settings().setValue("delay", arg1);
} }
@ -143,7 +145,3 @@ void SettingsDialog::on_pushButton_clicked() {
a->setAttribute(Qt::WA_DeleteOnClose); a->setAttribute(Qt::WA_DeleteOnClose);
a->show(); a->show();
} }
void SettingsDialog::on_nameScheme_textChanged(QString txt) {
settings::settings().setValue("fileFormat", txt);
}

View File

@ -30,7 +30,7 @@ public:
void on_formatBox_currentIndexChanged(int index); void on_formatBox_currentIndexChanged(int index);
void on_imageFormatBox_currentIndexChanged(int index); void on_imageFormatBox_currentIndexChanged(int index);
void on_pushButton_clicked(); void on_pushButton_clicked();
void on_nameScheme_textChanged(QString txt); void on_nameScheme_textChanged(const QString &arg1);
private: private:
Ui::SettingsDialog *ui; Ui::SettingsDialog *ui;