reimplemented text field

This commit is contained in:
itsmattkc
2019-03-13 01:10:17 +11:00
parent df2c5be7a7
commit d01e868d60
5 changed files with 53 additions and 21 deletions
+13 -3
View File
@@ -24,6 +24,7 @@
#include "io/config.h"
#include "io/path.h"
#include "rendering/audio.h"
#include "panels/panels.h"
#include "mainwindow.h"
#include <QMenuBar>
@@ -74,7 +75,7 @@ QString KeySequenceEditor::export_shortcut() {
if (ks != action->property("default")) {
return action->property("id").toString() + "\t" + keySequence().toString();
}
return 0;
return nullptr;
}
PreferencesDialog::PreferencesDialog(QWidget *parent) :
@@ -173,6 +174,7 @@ void PreferencesDialog::save() {
bool restart_after_saving = false;
bool reinit_audio = false;
bool reload_language = false;
bool reload_effects = false;
// Validate whether the specified CSS file exists
if (!custom_css_fn->text().isEmpty() && !QFileInfo::exists(custom_css_fn->text())) {
@@ -184,9 +186,13 @@ void PreferencesDialog::save() {
return;
}
// Validate whether the effects panel should refresh itself
if (olive::CurrentConfig.effect_textbox_lines != effect_textbox_lines_field->value()) {
reload_effects = true;
}
// Check if any settings will require a restart of Olive
if (olive::CurrentConfig.effect_textbox_lines != effect_textbox_lines_field->value()
|| olive::CurrentConfig.use_software_fallback != use_software_fallbacks_checkbox->isChecked()
if (olive::CurrentConfig.use_software_fallback != use_software_fallbacks_checkbox->isChecked()
|| olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value()
|| olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()) {
@@ -290,6 +296,10 @@ void PreferencesDialog::save() {
init_audio();
}
if (reload_effects) {
panel_effect_controls->Reload();
}
// reload language file if it changed
if (reload_language) {
olive::Global->load_translation_from_config();