mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-22 22:56:32 +01:00
change all GUI config files (GTK RC and our own XML config files) to use product-neutral names
This commit is contained in:
parent
32c154dd76
commit
aa8bbf6a03
10 changed files with 47 additions and 69 deletions
|
|
@ -364,11 +364,7 @@ ThemeManager::on_dark_theme_button_toggled()
|
||||||
{
|
{
|
||||||
if (!dark_button.get_active()) return;
|
if (!dark_button.get_active()) return;
|
||||||
|
|
||||||
if (HACK_PROFILE_IS_SAE()){
|
ARDOUR_UI::config()->set_ui_rc_file("ui_dark.rc");
|
||||||
ARDOUR_UI::config()->set_ui_rc_file("ardour3_ui_dark_sae.rc");
|
|
||||||
} else {
|
|
||||||
ARDOUR_UI::config()->set_ui_rc_file("ardour3_ui_dark.rc");
|
|
||||||
}
|
|
||||||
ARDOUR_UI::config()->set_dirty ();
|
ARDOUR_UI::config()->set_dirty ();
|
||||||
|
|
||||||
load_rc_file (ARDOUR_UI::config()->get_ui_rc_file(), true);
|
load_rc_file (ARDOUR_UI::config()->get_ui_rc_file(), true);
|
||||||
|
|
@ -379,12 +375,7 @@ ThemeManager::on_light_theme_button_toggled()
|
||||||
{
|
{
|
||||||
if (!light_button.get_active()) return;
|
if (!light_button.get_active()) return;
|
||||||
|
|
||||||
if (HACK_PROFILE_IS_SAE()){
|
ARDOUR_UI::config()->set_ui_rc_file("ui_light.rc");
|
||||||
ARDOUR_UI::config()->set_ui_rc_file("ardour3_ui_light_sae.rc");
|
|
||||||
} else {
|
|
||||||
ARDOUR_UI::config()->set_ui_rc_file("ardour3_ui_light.rc");
|
|
||||||
}
|
|
||||||
|
|
||||||
load_rc_file (ARDOUR_UI::config()->get_ui_rc_file(), true);
|
load_rc_file (ARDOUR_UI::config()->get_ui_rc_file(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -461,9 +452,9 @@ ThemeManager::setup_theme ()
|
||||||
rcfile = ARDOUR_UI::config()->get_ui_rc_file();
|
rcfile = ARDOUR_UI::config()->get_ui_rc_file();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rcfile == "ardour3_ui_dark.rc" || rcfile == "ardour3_ui_dark_sae.rc") {
|
if (rcfile == "ui_dark.rc") {
|
||||||
dark_button.set_active();
|
dark_button.set_active();
|
||||||
} else if (rcfile == "ardour3_ui_light.rc" || rcfile == "ardour3_ui_light_sae.rc") {
|
} else if (rcfile == "ui_light.rc") {
|
||||||
light_button.set_active();
|
light_button.set_active();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,9 @@ using namespace std;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
||||||
|
static const char* ui_config_file_name = "ui_config";
|
||||||
|
static const char* default_ui_config_file_name = "default_ui_config";
|
||||||
|
|
||||||
UIConfiguration::UIConfiguration ()
|
UIConfiguration::UIConfiguration ()
|
||||||
:
|
:
|
||||||
#undef UI_CONFIG_VARIABLE
|
#undef UI_CONFIG_VARIABLE
|
||||||
|
|
@ -76,25 +79,15 @@ int
|
||||||
UIConfiguration::load_defaults ()
|
UIConfiguration::load_defaults ()
|
||||||
{
|
{
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
std::string default_ui_rc_file;
|
|
||||||
std::string rcfile;
|
std::string rcfile;
|
||||||
|
|
||||||
if (getenv ("ARDOUR_SAE")) {
|
if (find_file (ardour_config_search_path(), default_ui_config_file_name, rcfile) ) {
|
||||||
rcfile = "ardour3_ui_sae.conf";
|
|
||||||
} else {
|
|
||||||
rcfile = "ardour3_ui_default.conf";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (find_file (ardour_config_search_path(), rcfile, default_ui_rc_file) ) {
|
|
||||||
XMLTree tree;
|
XMLTree tree;
|
||||||
found = 1;
|
found = 1;
|
||||||
|
|
||||||
string rcfile = default_ui_rc_file;
|
|
||||||
|
|
||||||
// info << string_compose (_("Loading default ui configuration file %1"), rcfile) << endl;
|
// info << string_compose (_("Loading default ui configuration file %1"), rcfile) << endl;
|
||||||
|
|
||||||
if (!tree.read (rcfile.c_str())) {
|
if (!tree.read (default_ui_config_file_name)) {
|
||||||
error << string_compose(_("cannot read default ui configuration file \"%1\""), rcfile) << endmsg;
|
error << string_compose(_("cannot read default ui configuration file \"%1\""), rcfile) << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -115,14 +108,12 @@ UIConfiguration::load_state ()
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
std::string default_ui_rc_file;
|
std::string rcfile;
|
||||||
|
|
||||||
if ( find_file (ardour_config_search_path(), "ardour3_ui_default.conf", default_ui_rc_file)) {
|
if ( find_file (ardour_config_search_path(), default_ui_config_file_name, rcfile)) {
|
||||||
XMLTree tree;
|
XMLTree tree;
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
string rcfile = default_ui_rc_file;
|
|
||||||
|
|
||||||
// info << string_compose (_("Loading default ui configuration file %1"), rcfile) << endl;
|
// info << string_compose (_("Loading default ui configuration file %1"), rcfile) << endl;
|
||||||
|
|
||||||
if (!tree.read (rcfile.c_str())) {
|
if (!tree.read (rcfile.c_str())) {
|
||||||
|
|
@ -136,14 +127,10 @@ UIConfiguration::load_state ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string user_ui_rc_file;
|
if (find_file (ardour_config_search_path(), ui_config_file_name, rcfile)) {
|
||||||
|
|
||||||
if (find_file (ardour_config_search_path(), "ardour3_ui.conf", user_ui_rc_file)) {
|
|
||||||
XMLTree tree;
|
XMLTree tree;
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
string rcfile = user_ui_rc_file;
|
|
||||||
|
|
||||||
// info << string_compose (_("Loading user ui configuration file %1"), rcfile) << endmsg;
|
// info << string_compose (_("Loading user ui configuration file %1"), rcfile) << endmsg;
|
||||||
|
|
||||||
if (!tree.read (rcfile)) {
|
if (!tree.read (rcfile)) {
|
||||||
|
|
@ -173,7 +160,7 @@ UIConfiguration::save_state()
|
||||||
XMLTree tree;
|
XMLTree tree;
|
||||||
|
|
||||||
std::string rcfile(user_config_directory());
|
std::string rcfile(user_config_directory());
|
||||||
rcfile = Glib::build_filename (rcfile, "ardour3_ui.conf");
|
rcfile = Glib::build_filename (rcfile, ui_config_file_name);
|
||||||
|
|
||||||
// this test seems bogus?
|
// this test seems bogus?
|
||||||
if (rcfile.length()) {
|
if (rcfile.length()) {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
UI_CONFIG_VARIABLE(std::string, icon_set, "icon-set", "default")
|
UI_CONFIG_VARIABLE(std::string, icon_set, "icon-set", "default")
|
||||||
UI_CONFIG_VARIABLE(std::string, ui_rc_file, "ui-rc-file", "ardour3_ui_dark.rc")
|
UI_CONFIG_VARIABLE(std::string, ui_rc_file, "ui-rc-file", "ui_dark.rc")
|
||||||
UI_CONFIG_VARIABLE(bool, flat_buttons, "flat-buttons", false)
|
UI_CONFIG_VARIABLE(bool, flat_buttons, "flat-buttons", false)
|
||||||
UI_CONFIG_VARIABLE(float, waveform_gradient_depth, "waveform-gradient-depth", 0)
|
UI_CONFIG_VARIABLE(float, waveform_gradient_depth, "waveform-gradient-depth", 0)
|
||||||
UI_CONFIG_VARIABLE(float, timeline_item_gradient_depth, "timeline-item-gradient-depth", 0.5)
|
UI_CONFIG_VARIABLE(float, timeline_item_gradient_depth, "timeline-item-gradient-depth", 0.5)
|
||||||
|
|
|
||||||
|
|
@ -351,6 +351,6 @@ style "status_bar_box"
|
||||||
bg[NORMAL] = { 0.149, 0.149, 0.149 }
|
bg[NORMAL] = { 0.149, 0.149, 0.149 }
|
||||||
}
|
}
|
||||||
|
|
||||||
##include ardour3_dark_fonts.rc
|
##include dark_fonts.rc
|
||||||
##include ardour3_dark_styles.rc
|
##include dark_styles.rc
|
||||||
##include ardour3_widgets.rc
|
##include widgets.rc
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Ardour>
|
<Ardour>
|
||||||
<UI>
|
<UI>
|
||||||
<Option name="ui-rc-file" value="ardour3_ui_dark.rc"/>
|
<Option name="ui-rc-file" value="ui_dark.rc"/>
|
||||||
<Option name="flat-buttons" value="00000000"/>
|
<Option name="flat-buttons" value="00000000"/>
|
||||||
<Option name="waveform-gradient-depth" value="0"/>
|
<Option name="waveform-gradient-depth" value="0"/>
|
||||||
<Option name="timeline-item-gradient-depth" value="00000.5"/>
|
<Option name="timeline-item-gradient-depth" value="00000.5"/>
|
||||||
|
|
@ -361,6 +361,6 @@ style "status_bar_box"
|
||||||
bg[NORMAL] = { 0.149, 0.149, 0.149 }
|
bg[NORMAL] = { 0.149, 0.149, 0.149 }
|
||||||
}
|
}
|
||||||
|
|
||||||
##include ardour3_light_fonts.rc
|
##include light_fonts.rc
|
||||||
##include ardour3_light_styles.rc
|
##include light_styles.rc
|
||||||
##include ardour3_widgets.rc
|
##include widgets.rc
|
||||||
|
|
@ -642,70 +642,70 @@ def build(bld):
|
||||||
|
|
||||||
# RC files
|
# RC files
|
||||||
dark_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
|
dark_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
|
||||||
'gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
|
'gtk2_ardour/ui_dark.rc.in', 'ARDOUR_DARK')
|
||||||
dark_rc_subst_dict['COLPREFIX'] = 'ARDOUR_DARK'
|
dark_rc_subst_dict['COLPREFIX'] = 'ARDOUR_DARK'
|
||||||
light_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
|
light_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
|
||||||
'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
|
'gtk2_ardour/ui_light.rc.in', 'ARDOUR_LIGHT')
|
||||||
light_rc_subst_dict['COLPREFIX'] = 'ARDOUR_LIGHT'
|
light_rc_subst_dict['COLPREFIX'] = 'ARDOUR_LIGHT'
|
||||||
|
|
||||||
obj = bld(features = 'subst')
|
obj = bld(features = 'subst')
|
||||||
obj.source = [ 'ardour3_ui_dark.rc.in' ]
|
obj.source = [ 'ui_dark.rc.in' ]
|
||||||
obj.target = 'ardour3_ui_dark.rc.pre'
|
obj.target = 'ui_dark.rc.pre'
|
||||||
obj.install_path = None
|
obj.install_path = None
|
||||||
set_subst_dict(obj, dark_rc_subst_dict)
|
set_subst_dict(obj, dark_rc_subst_dict)
|
||||||
|
|
||||||
obj = bld(features = 'subst')
|
obj = bld(features = 'subst')
|
||||||
obj.source = [ 'ardour3_ui_light.rc.in' ]
|
obj.source = [ 'ui_light.rc.in' ]
|
||||||
obj.target = 'ardour3_ui_light.rc.pre'
|
obj.target = 'ui_light.rc.pre'
|
||||||
obj.install_path = None
|
obj.install_path = None
|
||||||
set_subst_dict(obj, light_rc_subst_dict)
|
set_subst_dict(obj, light_rc_subst_dict)
|
||||||
|
|
||||||
obj = bld(features = 'subst')
|
obj = bld(features = 'subst')
|
||||||
obj.source = [ 'ardour3_styles.rc.in' ]
|
obj.source = [ 'styles.rc.in' ]
|
||||||
obj.target = 'ardour3_dark_styles.rc'
|
obj.target = 'dark_styles.rc'
|
||||||
obj.install_path = None
|
obj.install_path = None
|
||||||
set_subst_dict(obj, dark_rc_subst_dict)
|
set_subst_dict(obj, dark_rc_subst_dict)
|
||||||
|
|
||||||
obj = bld(features = 'subst')
|
obj = bld(features = 'subst')
|
||||||
obj.source = [ 'ardour3_styles.rc.in' ]
|
obj.source = [ 'styles.rc.in' ]
|
||||||
obj.target = 'ardour3_light_styles.rc'
|
obj.target = 'light_styles.rc'
|
||||||
obj.install_path = None
|
obj.install_path = None
|
||||||
set_subst_dict(obj, light_rc_subst_dict)
|
set_subst_dict(obj, light_rc_subst_dict)
|
||||||
|
|
||||||
obj = bld(features = 'subst')
|
obj = bld(features = 'subst')
|
||||||
obj.source = [ 'ardour3_fonts.rc.in' ]
|
obj.source = [ 'fonts.rc.in' ]
|
||||||
obj.target = 'ardour3_dark_fonts.rc'
|
obj.target = 'dark_fonts.rc'
|
||||||
obj.install_path = None
|
obj.install_path = None
|
||||||
set_subst_dict(obj, dark_rc_subst_dict)
|
set_subst_dict(obj, dark_rc_subst_dict)
|
||||||
|
|
||||||
obj = bld(features = 'subst')
|
obj = bld(features = 'subst')
|
||||||
obj.source = [ 'ardour3_fonts.rc.in' ]
|
obj.source = [ 'fonts.rc.in' ]
|
||||||
obj.target = 'ardour3_light_fonts.rc'
|
obj.target = 'light_fonts.rc'
|
||||||
obj.install_path = None
|
obj.install_path = None
|
||||||
set_subst_dict(obj, light_rc_subst_dict)
|
set_subst_dict(obj, light_rc_subst_dict)
|
||||||
|
|
||||||
obj = bld(rule = copyfile)
|
obj = bld(rule = copyfile)
|
||||||
obj.source = [ 'ardour3_widget_list.rc' ]
|
obj.source = [ 'widget_list.rc' ]
|
||||||
obj.target = 'ardour3_widgets.rc'
|
obj.target = 'widgets.rc'
|
||||||
obj.install_path = None
|
obj.install_path = None
|
||||||
|
|
||||||
obj = bld (rule = include_processor)
|
obj = bld (rule = include_processor)
|
||||||
obj.source = [ 'ardour3_ui_dark.rc.pre' ]
|
obj.source = [ 'ui_dark.rc.pre' ]
|
||||||
# find and add all ##include dependencies as sources
|
# find and add all ##include dependencies as sources
|
||||||
obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_dark.rc.in').srcpath(), True)
|
obj.source += _doPyp (bld.path.find_resource ('ui_dark.rc.in').srcpath(), True)
|
||||||
obj.target = 'ardour3_ui_dark.rc'
|
obj.target = 'ui_dark.rc'
|
||||||
obj.install_path = bld.env['CONFDIR']
|
obj.install_path = bld.env['CONFDIR']
|
||||||
|
|
||||||
obj = bld (rule = include_processor)
|
obj = bld (rule = include_processor)
|
||||||
obj.source = [ 'ardour3_ui_light.rc.pre' ]
|
obj.source = [ 'ui_light.rc.pre' ]
|
||||||
# find and add all ##include dependencies as sources
|
# find and add all ##include dependencies as sources
|
||||||
obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_light.rc.in').srcpath(), True)
|
obj.source += _doPyp (bld.path.find_resource ('ui_light.rc.in').srcpath(), True)
|
||||||
obj.target = 'ardour3_ui_light.rc'
|
obj.target = 'ui_light.rc'
|
||||||
obj.install_path = bld.env['CONFDIR']
|
obj.install_path = bld.env['CONFDIR']
|
||||||
|
|
||||||
obj = bld(features = 'subst')
|
obj = bld(features = 'subst')
|
||||||
obj.source = [ 'ardour3_ui_default.conf.in' ]
|
obj.source = [ 'ui_default.conf.in' ]
|
||||||
obj.target = 'ardour3_ui_default.conf'
|
obj.target = 'ui_default.conf'
|
||||||
obj.install_path = None
|
obj.install_path = None
|
||||||
set_subst_dict(obj, ui_conf_dict)
|
set_subst_dict(obj, ui_conf_dict)
|
||||||
|
|
||||||
|
|
@ -758,7 +758,7 @@ def build(bld):
|
||||||
bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
|
bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
|
||||||
|
|
||||||
# Default UI configuration
|
# Default UI configuration
|
||||||
bld.install_files(bld.env['CONFDIR'], 'ardour3_ui_default.conf')
|
bld.install_files(bld.env['CONFDIR'], 'ui_default.conf')
|
||||||
|
|
||||||
# Default export stuff
|
# Default export stuff
|
||||||
bld.install_files(os.path.join (bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
|
bld.install_files(os.path.join (bld.env['CONFDIR'], 'export'), bld.path.ant_glob('export/*.format'))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue