Commit fa9e5b8f authored by Jehan's avatar Jehan

app: do not hardcode default theme and icon theme all over the code.

Create GIMP_CONFIG_DEFAULT_(ICON_)?THEME in gimpguiconfig.h to set
defaults in a single place, except for libgimpwidgets/ which cannot
include from app/.
parent 3275ea4a
......@@ -39,9 +39,6 @@
#define DEFAULT_HELP_BROWSER GIMP_HELP_BROWSER_WEB_BROWSER
#endif
#define DEFAULT_THEME "Default"
#define DEFAULT_ICON_THEME "Default"
#define DEFAULT_USER_MANUAL_ONLINE_URI \
"http://docs.gimp.org/" GIMP_APP_VERSION_STRING
......@@ -228,7 +225,7 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
g_free (path);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_THEME,
"theme", THEME_BLURB,
DEFAULT_THEME,
GIMP_CONFIG_DEFAULT_THEME,
GIMP_PARAM_STATIC_STRINGS);
path = gimp_config_build_data_path ("icons");
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_ICON_THEME_PATH,
......@@ -239,7 +236,7 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
g_free (path);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_ICON_THEME,
"icon-theme", ICON_THEME_BLURB,
DEFAULT_ICON_THEME,
GIMP_CONFIG_DEFAULT_ICON_THEME,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_HELP,
"use-help", USE_HELP_BLURB,
......
......@@ -24,6 +24,10 @@
#include "config/gimpdisplayconfig.h"
#define GIMP_CONFIG_DEFAULT_THEME "Default"
#define GIMP_CONFIG_DEFAULT_ICON_THEME "Default"
#define GIMP_TYPE_GUI_CONFIG (gimp_gui_config_get_type ())
#define GIMP_GUI_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_GUI_CONFIG, GimpGuiConfig))
#define GIMP_GUI_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_GUI_CONFIG, GimpGuiConfigClass))
......
......@@ -199,7 +199,7 @@ icon_themes_get_theme_dir (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
if (! icon_theme_name)
icon_theme_name = "Default";
icon_theme_name = GIMP_CONFIG_DEFAULT_ICON_THEME;
return g_hash_table_lookup (icon_themes_hash, icon_theme_name);
}
......@@ -211,7 +211,7 @@ icons_apply_theme (Gimp *gimp,
g_return_if_fail (GIMP_IS_GIMP (gimp));
if (! icon_theme_name)
icon_theme_name = "Default";
icon_theme_name = GIMP_CONFIG_DEFAULT_ICON_THEME;
if (gimp->be_verbose)
g_print ("Loading icon theme '%s'\n", icon_theme_name);
......
......@@ -190,7 +190,7 @@ themes_get_theme_dir (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
if (! theme_name)
theme_name = "Default";
theme_name = GIMP_CONFIG_DEFAULT_THEME;
return g_hash_table_lookup (themes_hash, theme_name);
}
......
......@@ -48,8 +48,9 @@
**/
#define LIBGIMP_DOMAIN GETTEXT_PACKAGE "-libgimp"
#define GIMP_TOILET_PAPER "gimp-toilet-paper"
#define LIBGIMP_DOMAIN GETTEXT_PACKAGE "-libgimp"
#define GIMP_TOILET_PAPER "gimp-toilet-paper"
#define GIMP_DEFAULT_ICON_THEME "Default"
static GtkIconFactory *gimp_stock_factory = NULL;
......@@ -354,7 +355,8 @@ static void
gimp_icons_change_icon_theme (GFile *path)
{
if (! default_icon_theme_path)
default_icon_theme_path = gimp_data_directory_file ("icons", "Default",
default_icon_theme_path = gimp_data_directory_file ("icons",
GIMP_DEFAULT_ICON_THEME,
NULL);
if (! g_file_equal (path, icon_theme_path))
......@@ -420,7 +422,8 @@ gimp_icons_set_icon_theme (GFile *path)
if (path)
path = g_object_ref (path);
else
path = gimp_data_directory_file (gimp_data_directory (), "icons", "Default",
path = gimp_data_directory_file (gimp_data_directory (),
"icons", GIMP_DEFAULT_ICON_THEME,
NULL);
if (! g_file_query_exists (path, NULL))
......@@ -543,7 +546,8 @@ gimp_icons_init (void)
* themes.
*/
if (! default_icon_theme_path)
default_icon_theme_path = gimp_data_directory_file ("icons", "Default",
default_icon_theme_path = gimp_data_directory_file ("icons",
GIMP_DEFAULT_ICON_THEME,
NULL);
icons_dir = g_file_get_path (default_icon_theme_path);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment