Making the codified theme file name mandatory (#3446)

...which mean that TooWaBlue.css can't be loaded until it has been
reworked and renamed to the new mechanism. The default theme will be
loaded instead.
This commit is contained in:
Hombre 2016-11-20 12:33:47 +01:00
parent 55759c04e3
commit 17ff228177
3 changed files with 5 additions and 2 deletions

View File

@ -310,8 +310,9 @@ int main(int argc, char **argv)
Gtk::Settings::get_for_screen(screen)->property_gtk_theme_name() = "Adwaita";
Gtk::Settings::get_for_screen(screen)->property_gtk_application_prefer_dark_theme() = true;
Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create(THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS);
Glib::ustring filename = Glib::build_filename(argv0, "themes", options.theme + ".css");
if (!Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
if (!regex->match(options.theme) || !Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
options.theme = "RawTherapee-GTK";
// We're not testing GTK_MAJOR_VERSION == 3 here, since this branch requires Gtk3 only
if (GTK_MINOR_VERSION < 20) {

View File

@ -27,6 +27,8 @@
#define STARTUPDIR_CUSTOM 2
#define STARTUPDIR_LAST 3
#define THEMEREGEXSTR "^(.+)-GTK3-(\\d{1,2})?_(\\d{1,2})?\\.css$"
// Default bundled profile name to use for Raw images
#ifdef WIN32
#define DEFPROFILE_RAW "${G}\\Default"

View File

@ -41,7 +41,7 @@ Preferences::Preferences (RTWindow *rtwindow)
, parent (rtwindow)
, splash (nullptr)
{
regex = Glib::Regex::create("^(.+)-GTK3-(\\d{1,2})?_(\\d{1,2})?\\.css$", Glib::RegexCompileFlags::REGEX_CASELESS);
regex = Glib::Regex::create(THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS);
moptions.copyFrom (&options);