mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
GUI part of LocaleGuard optimization.
This commit is contained in:
parent
e59ab55831
commit
2f9d5077dc
2 changed files with 11 additions and 1 deletions
|
|
@ -677,6 +677,7 @@ ARDOUR_UI::save_ardour_state ()
|
||||||
a different lifetime model from add_instant_xml().
|
a different lifetime model from add_instant_xml().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
LocaleGuard lg; // one guard to rule them all
|
||||||
XMLNode* node = new XMLNode (keyboard->get_state());
|
XMLNode* node = new XMLNode (keyboard->get_state());
|
||||||
Config->add_extra_xml (*node);
|
Config->add_extra_xml (*node);
|
||||||
Config->add_extra_xml (get_transport_controllable_state());
|
Config->add_extra_xml (get_transport_controllable_state());
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
#include <pango/pangocairo.h> // for fontmap resolution control for GnomeCanvas
|
#include <pango/pangocairo.h> // for fontmap resolution control for GnomeCanvas
|
||||||
|
|
||||||
#include "pbd/gstdio_compat.h"
|
#include "pbd/gstdio_compat.h"
|
||||||
|
#include "pbd/unwind.h"
|
||||||
#include <glibmm/miscutils.h>
|
#include <glibmm/miscutils.h>
|
||||||
|
|
||||||
#include <gtkmm/settings.h>
|
#include <gtkmm/settings.h>
|
||||||
|
|
@ -248,7 +249,6 @@ UIConfiguration::load_defaults ()
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
/* reload color theme */
|
/* reload color theme */
|
||||||
load_color_theme (false);
|
load_color_theme (false);
|
||||||
ColorsChanged (); /* EMIT SIGNAL */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -260,6 +260,10 @@ UIConfiguration::load_color_theme (bool allow_own)
|
||||||
std::string cfile;
|
std::string cfile;
|
||||||
string basename;
|
string basename;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
/* ColorsChanged() will trigger a parameter_changed () which
|
||||||
|
* in turn calls save_state()
|
||||||
|
*/
|
||||||
|
PBD::Unwinder<uint32_t> uw (block_save, block_save + 1);
|
||||||
|
|
||||||
if (allow_own) {
|
if (allow_own) {
|
||||||
basename = "my-";
|
basename = "my-";
|
||||||
|
|
@ -357,6 +361,7 @@ UIConfiguration::store_color_theme ()
|
||||||
int
|
int
|
||||||
UIConfiguration::load_state ()
|
UIConfiguration::load_state ()
|
||||||
{
|
{
|
||||||
|
LocaleGuard lg; // a single guard for all 3 configs
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
std::string rcfile;
|
std::string rcfile;
|
||||||
|
|
@ -407,6 +412,9 @@ UIConfiguration::load_state ()
|
||||||
int
|
int
|
||||||
UIConfiguration::save_state()
|
UIConfiguration::save_state()
|
||||||
{
|
{
|
||||||
|
if (block_save != 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (_dirty) {
|
if (_dirty) {
|
||||||
std::string rcfile = Glib::build_filename (user_config_directory(), ui_config_file_name);
|
std::string rcfile = Glib::build_filename (user_config_directory(), ui_config_file_name);
|
||||||
|
|
@ -480,6 +488,7 @@ UIConfiguration::get_variables (std::string which_node)
|
||||||
int
|
int
|
||||||
UIConfiguration::set_state (const XMLNode& root, int /*version*/)
|
UIConfiguration::set_state (const XMLNode& root, int /*version*/)
|
||||||
{
|
{
|
||||||
|
LocaleGuard lg;
|
||||||
/* this can load a generic UI configuration file or a colors file */
|
/* this can load a generic UI configuration file or a colors file */
|
||||||
|
|
||||||
if (root.name() != "Ardour") {
|
if (root.name() != "Ardour") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue