Skip to content

Commit

Permalink
exportdialog: ignore preset combobox change when loading presets
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmattkc committed Oct 6, 2022
1 parent b2b3280 commit 2076d0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/dialog/export/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ namespace olive {
ExportDialog::ExportDialog(ViewerOutput *viewer_node, bool stills_only_mode, QWidget *parent) :
super(parent),
viewer_node_(viewer_node),
stills_only_mode_(stills_only_mode)
stills_only_mode_(stills_only_mode),
loading_presets_(false)
{
QHBoxLayout* layout = new QHBoxLayout(this);

Expand Down Expand Up @@ -432,6 +433,10 @@ void ExportDialog::SavePreset()

void ExportDialog::PresetComboBoxChanged()
{
if (loading_presets_) {
return;
}

QComboBox *c = static_cast<QComboBox *>(sender());

int preset_number = c->currentData().toInt();
Expand Down Expand Up @@ -536,6 +541,8 @@ void ExportDialog::ResolutionChanged()

void ExportDialog::LoadPresets()
{
loading_presets_ = true;

preset_combobox_->clear();
presets_.clear();

Expand All @@ -562,6 +569,8 @@ void ExportDialog::LoadPresets()
f.close();
}
}

loading_presets_ = false;
}

void ExportDialog::SetDefaultFilename()
Expand Down
2 changes: 2 additions & 0 deletions app/dialog/export/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public slots:

bool stills_only_mode_;

bool loading_presets_;

private slots:
void BrowseFilename();

Expand Down

0 comments on commit 2076d0b

Please sign in to comment.