mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
GIU: job actions: split "when successful or with warnings" into separate options
Implements #2798.
This commit is contained in:
parent
78d525a774
commit
f31d039032
3
NEWS.md
3
NEWS.md
@ -4,6 +4,9 @@
|
||||
|
||||
* mkvmerge: for audio-only files mkvmerge will now write a cue entry every
|
||||
500ms instead of every 2s.
|
||||
* MKVToolNix GUI: job actions: split up the option "execute when the job
|
||||
finishes successfully or with warnings" into two separate options: "…when
|
||||
finishes successfully" and "…when exits with warnings". Implements #2798.
|
||||
|
||||
## Bug fixes
|
||||
|
||||
|
@ -31,7 +31,14 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbAfterJobSuccessful">
|
||||
<property name="text">
|
||||
<string>After a job completes &successfully or with warnings</string>
|
||||
<string>After a job completes &successfully</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbAfterJobWarnings">
|
||||
<property name="text">
|
||||
<string>After a job exits with &warnings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -316,6 +323,7 @@ p, li { white-space: pre-wrap; }
|
||||
<tabstop>leName</tabstop>
|
||||
<tabstop>cbType</tabstop>
|
||||
<tabstop>cbAfterJobSuccessful</tabstop>
|
||||
<tabstop>cbAfterJobWarnings</tabstop>
|
||||
<tabstop>cbAfterJobError</tabstop>
|
||||
<tabstop>cbAfterJobQueueStopped</tabstop>
|
||||
<tabstop>pbExecuteNow</tabstop>
|
||||
@ -325,6 +333,7 @@ p, li { white-space: pre-wrap; }
|
||||
<tabstop>tbUsageNotes</tabstop>
|
||||
<tabstop>leAudioFile</tabstop>
|
||||
<tabstop>pbBrowseAudioFile</tabstop>
|
||||
<tabstop>sbVolume</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../qt_resources.qrc"/>
|
||||
|
@ -468,7 +468,9 @@ Job::runProgramsAfterCompletion() {
|
||||
if (!mtx::included_in(p->status, DoneOk, DoneWarnings, Failed))
|
||||
return;
|
||||
|
||||
auto event = p->status == Failed ? Util::Settings::RunAfterJobCompletesWithErrors : Util::Settings::RunAfterJobCompletesSuccessfully;
|
||||
auto event = p->status == Failed ? Util::Settings::RunAfterJobCompletesWithErrors
|
||||
: p->status == DoneWarnings ? Util::Settings::RunAfterJobCompletesWithWarnings
|
||||
: Util::Settings::RunAfterJobCompletesSuccessfully;
|
||||
|
||||
App::programRunner().run(event, [this](ProgramRunner::VariableMap &variables) {
|
||||
runProgramSetupVariables(variables);
|
||||
|
@ -71,6 +71,7 @@ PrefsRunProgramWidget::setupUi(Util::Settings::RunProgramConfig const &cfg) {
|
||||
|
||||
p->flagsByCheckbox[p->ui->cbAfterJobQueueStopped] = Util::Settings::RunAfterJobQueueFinishes;
|
||||
p->flagsByCheckbox[p->ui->cbAfterJobSuccessful] = Util::Settings::RunAfterJobCompletesSuccessfully;
|
||||
p->flagsByCheckbox[p->ui->cbAfterJobWarnings] = Util::Settings::RunAfterJobCompletesWithWarnings;
|
||||
p->flagsByCheckbox[p->ui->cbAfterJobError] = Util::Settings::RunAfterJobCompletesWithErrors;
|
||||
|
||||
p->ui->cbConfigurationActive->setChecked(cfg.m_active);
|
||||
|
@ -270,6 +270,22 @@ Settings::convertOldSettings() {
|
||||
reg->setValue(s_valMergePredefinedSubtitleTrackNames, value.toStringList());
|
||||
}
|
||||
reg->endGroup();
|
||||
|
||||
// Update program runner event types: v46 splits "run if job
|
||||
// successful or with warnings" into two separate events.
|
||||
if (writtenByVersion <= version_number_t{"45.0.0.26"}) {
|
||||
reg->beginGroup(s_grpRunProgramConfigurations);
|
||||
|
||||
for (auto const &group : reg->childGroups()) {
|
||||
reg->beginGroup(group);
|
||||
auto forEvents = reg->value(s_valForEvents).toInt();
|
||||
if (forEvents & 2)
|
||||
reg->setValue(s_valForEvents, forEvents | 8);
|
||||
reg->endGroup();
|
||||
}
|
||||
|
||||
reg->endGroup(); // runProgramConfigurations
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -40,6 +40,7 @@ public:
|
||||
RunAfterJobQueueFinishes = 0x01,
|
||||
RunAfterJobCompletesSuccessfully = 0x02,
|
||||
RunAfterJobCompletesWithErrors = 0x04,
|
||||
RunAfterJobCompletesWithWarnings = 0x08,
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS(RunProgramForEvents, RunProgramForEvent)
|
||||
|
Loading…
Reference in New Issue
Block a user