From 43284ced8b8a0c30295e69482f89c13ec813fb99 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 18 Apr 2019 02:39:11 +1000 Subject: [PATCH] cherrypicked relevant commits from master --- global/config.cpp | 7 ++++++- global/config.h | 5 +++++ ui/mainwindow.cpp | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/global/config.cpp b/global/config.cpp index cd22f52a0..917bc66cc 100644 --- a/global/config.cpp +++ b/global/config.cpp @@ -82,7 +82,8 @@ Config::Config() playback_bit_depth(olive::PIX_FMT_RGBA16F), export_bit_depth(olive::PIX_FMT_RGBA32F), dont_use_proxies_on_export(true), - maximum_recent_projects(10) + maximum_recent_projects(10), + locked_panels(false) {} void Config::load(QString path) { @@ -267,6 +268,9 @@ void Config::load(QString path) { } else if (stream.name() == "DontUseProxiesOnExport") { stream.readNext(); dont_use_proxies_on_export = (stream.text() == "1"); + } else if (stream.name() == "LockedPanels") { + stream.readNext(); + locked_panels = (stream.text() == "1"); } } } @@ -349,6 +353,7 @@ void Config::save(QString path) { stream.writeTextElement("PlaybackBitDepth", QString::number(playback_bit_depth)); stream.writeTextElement("ExportBitDepth", QString::number(export_bit_depth)); stream.writeTextElement("DontUseProxiesOnExport", QString::number(dont_use_proxies_on_export)); + stream.writeTextElement("LockedPanels", QString::number(locked_panels)); stream.writeEndElement(); // configuration stream.writeEndDocument(); // doc diff --git a/global/config.h b/global/config.h index 0291a5e3a..293bcdcca 100644 --- a/global/config.h +++ b/global/config.h @@ -614,6 +614,11 @@ struct Config { */ int maximum_recent_projects; + /** + * @brief Sets whether panels should load locked or not + */ + bool locked_panels; + /** * @brief Load config from file * diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index cade09482..cbe7acb3a 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -285,6 +285,9 @@ MainWindow::MainWindow(QWidget *parent) : olive::Global->check_for_autorecovery_file(); + // lock panels if the config says so + set_panels_locked(olive::config.locked_panels); + // set up output audio device init_audio(); @@ -1193,6 +1196,8 @@ void MainWindow::set_panels_locked(bool locked) panel->setTitleBarWidget(nullptr); } } + + olive::config.locked_panels = locked; } void MainWindow::fileMenu_About_To_Be_Shown() {