diff --git a/src/core.cpp b/src/core.cpp index 5d738ec9f..d005a6157 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -1375,6 +1375,12 @@ void Core::pause_and_frame_step() { void Core::pause() { qDebug() << "Core::pause: current state:" << stateToString(); + if (pref->remember_on_pause) { + qDebug("Saving recents and position"); + pref->save(); + saveMediaInfo(); + } + if (proc->isRunning()) { // Pauses and unpauses if (state() == Paused) proc->setPause(false); else proc->setPause(true); diff --git a/src/preferences.cpp b/src/preferences.cpp index 40b7452e0..e86953a46 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -119,6 +119,7 @@ void Preferences::reset() { remember_media_settings = true; remember_time_pos = true; remember_stream_settings = false; + remember_on_pause = false; #if SIMPLE_TRACK_SELECTION alang = ""; @@ -704,6 +705,7 @@ void Preferences::save() { set->setValue("remember_media_settings", remember_media_settings); set->setValue("remember_time_pos", remember_time_pos); set->setValue("remember_stream_settings", remember_stream_settings); + set->setValue("remember_on_pause", remember_on_pause); #if SIMPLE_TRACK_SELECTION set->setValue("alang", alang); @@ -1302,6 +1304,7 @@ void Preferences::load() { remember_media_settings = set->value("remember_media_settings", remember_media_settings).toBool(); remember_time_pos = set->value("remember_time_pos", remember_time_pos).toBool(); remember_stream_settings = set->value("remember_stream_settings", remember_stream_settings).toBool(); + remember_on_pause = set->value("remember_on_pause", remember_on_pause).toBool(); #if SIMPLE_TRACK_SELECTION alang = set->value("alang", alang).toString(); diff --git a/src/preferences.h b/src/preferences.h index 97fe027f7..5c89fdec3 100644 --- a/src/preferences.h +++ b/src/preferences.h @@ -92,6 +92,7 @@ class Preferences { bool remember_media_settings; bool remember_time_pos; bool remember_stream_settings; + bool remember_on_pause; #if SIMPLE_TRACK_SELECTION QString alang; diff --git a/src/prefgeneral.cpp b/src/prefgeneral.cpp index 5cefa6c85..a7c5701eb 100644 --- a/src/prefgeneral.cpp +++ b/src/prefgeneral.cpp @@ -240,6 +240,7 @@ void PrefGeneral::setData(Preferences * pref) { setRememberSettings( pref->remember_media_settings ); setRememberTimePos( pref->remember_time_pos ); remember_streams_check->setChecked(pref->remember_stream_settings); + remember_on_pause_check->setChecked(pref->remember_on_pause); setFileSettingsMethod( pref->file_settings_method ); @@ -384,6 +385,7 @@ void PrefGeneral::getData(Preferences * pref) { TEST_AND_SET(pref->remember_media_settings, rememberSettings()); TEST_AND_SET(pref->remember_time_pos, rememberTimePos()); TEST_AND_SET(pref->remember_stream_settings, remember_streams_check->isChecked()); + TEST_AND_SET(pref->remember_on_pause, remember_on_pause_check->isChecked()); if (pref->file_settings_method != fileSettingsMethod()) { pref->file_settings_method = fileSettingsMethod(); diff --git a/src/prefgeneral.ui b/src/prefgeneral.ui index dc856a4a2..67fae48d9 100644 --- a/src/prefgeneral.ui +++ b/src/prefgeneral.ui @@ -7,14 +7,14 @@ 0 0 500 - 563 + 628 0 - + 0 @@ -58,7 +58,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -85,39 +85,7 @@ - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 61 - - - - - - - - false - - - - 0 - 0 - - - - Remember &time position - - - - + @@ -142,7 +110,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -154,6 +122,38 @@ + + + + Qt::Orientation::Horizontal + + + QSizePolicy::Policy::Preferred + + + + 20 + 61 + + + + + + + + false + + + + 0 + 0 + + + + Remember &time position + + + @@ -164,6 +164,13 @@ + + + + Save time position on pause + + + @@ -259,7 +266,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -287,16 +294,16 @@ - + 0 - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Preferred + QSizePolicy::Policy::Preferred @@ -319,7 +326,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -335,10 +342,10 @@ - Qt::Vertical + Qt::Orientation::Vertical - QSizePolicy::Expanding + QSizePolicy::Policy::Expanding @@ -396,7 +403,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -417,7 +424,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -426,7 +433,7 @@ 6 - + 0 @@ -439,7 +446,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -479,7 +486,7 @@ 6 - + 0 @@ -505,7 +512,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -555,7 +562,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -576,7 +583,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -617,7 +624,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -668,7 +675,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -719,7 +726,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -740,7 +747,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -756,7 +763,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -790,7 +797,7 @@ 6 - + 0 @@ -809,7 +816,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -826,7 +833,7 @@ 6 - + 0 @@ -852,7 +859,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -870,7 +877,7 @@ Volume - + 4 @@ -885,7 +892,7 @@ 6 - + 0 @@ -898,7 +905,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -955,7 +962,7 @@ Synchronization - + 4 @@ -970,10 +977,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Expanding + QSizePolicy::Policy::Expanding @@ -992,7 +999,7 @@ &Factor: - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter false @@ -1032,7 +1039,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -1076,10 +1083,10 @@ - Qt::Vertical + Qt::Orientation::Vertical - QSizePolicy::Expanding + QSizePolicy::Policy::Expanding @@ -1116,7 +1123,7 @@ For translators: don't translate this text, it will be replaced with another one - Qt::Horizontal + Qt::Orientation::Horizontal @@ -1126,12 +1133,12 @@ For translators: don't translate this text, it will be replaced with another one 0 - + 0 - + 0 @@ -1140,7 +1147,7 @@ For translators: don't translate this text, it will be replaced with another one - Qt::Horizontal + Qt::Orientation::Horizontal @@ -1153,7 +1160,7 @@ For translators: don't translate this text, it will be replaced with another one - Qt::Horizontal + Qt::Orientation::Horizontal @@ -1172,7 +1179,7 @@ For translators: don't translate this text, it will be replaced with another one &Audio: - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter false @@ -1191,7 +1198,7 @@ For translators: don't translate this text, it will be replaced with another one Su&btitles: - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter false @@ -1216,7 +1223,7 @@ For translators: don't translate this text, it will be replaced with another one - Qt::Horizontal + Qt::Orientation::Horizontal @@ -1226,12 +1233,12 @@ For translators: don't translate this text, it will be replaced with another one 0 - + 0 - + 0 @@ -1253,7 +1260,7 @@ For translators: don't translate this text, it will be replaced with another one Audi&o: - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter audio_track_spin @@ -1266,7 +1273,7 @@ For translators: don't translate this text, it will be replaced with another one &Subtitle: - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter subtitle_track_spin @@ -1276,7 +1283,7 @@ For translators: don't translate this text, it will be replaced with another one - Qt::Horizontal + Qt::Orientation::Horizontal @@ -1289,7 +1296,7 @@ For translators: don't translate this text, it will be replaced with another one - Qt::Horizontal + Qt::Orientation::Horizontal @@ -1321,7 +1328,7 @@ For translators: don't translate this text, it will be replaced with another one - Qt::Vertical + Qt::Orientation::Vertical @@ -1368,7 +1375,6 @@ For translators: don't translate this text, it will be replaced with another one vo_combo vo_user_defined_edit vdpau_button - wayland_check postprocessing_check autoq_spin deinterlace_combo