diff options
author | Julien Lavergne <gilir@ubuntu.com> | 2012-07-15 15:01:55 +0200 |
---|---|---|
committer | Julien Lavergne <gilir@ubuntu.com> | 2012-07-15 15:01:55 +0200 |
commit | f586c5020c3f32c365705b1442061cc6309f2265 (patch) | |
tree | 963e85d34249ca392321a5791268fd8920de0e50 | |
parent | 7ad0d0308fb043fbc3d535d7017e5cb69d7ec01e (diff) | |
download | lightdm-gtk-greeter-f586c5020c3f32c365705b1442061cc6309f2265.tar.gz |
Add the possibilty to specify another greeter.ui path in the configuration file
-rw-r--r-- | data/lightdm-gtk-greeter.conf | 2 | ||||
-rw-r--r-- | src/lightdm-gtk-greeter.c | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/data/lightdm-gtk-greeter.conf b/data/lightdm-gtk-greeter.conf index f8b9def..4e2fdd9 100644 --- a/data/lightdm-gtk-greeter.conf +++ b/data/lightdm-gtk-greeter.conf @@ -7,6 +7,7 @@ # xft-dpi = Resolution for Xft in dots per inch (e.g. 96) # xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull) # xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr) +# ui-path = Specify the path for another greeter.ui definition # [greeter] #background= @@ -17,3 +18,4 @@ #xft-dpi= #xft-hintstyle= #xft-rgba= +#ui-path= diff --git a/src/lightdm-gtk-greeter.c b/src/lightdm-gtk-greeter.c index bdb5cba..58c2d48 100644 --- a/src/lightdm-gtk-greeter.c +++ b/src/lightdm-gtk-greeter.c @@ -824,8 +824,18 @@ main (int argc, char **argv) gchar **path; gtk_icon_theme_get_search_path (gtk_icon_theme_get_default (), &path, NULL); + /* Load UI file */ builder = gtk_builder_new (); - if (!gtk_builder_add_from_file (builder, GREETER_DATA_DIR "/greeter.ui", &error)) + value = g_key_file_get_value (config, "greeter", "ui-path", NULL); + if (value) + { + if (!gtk_builder_add_from_file (builder, value, &error)) + { + g_warning ("Error loading specific UI: %s", error->message); + return EXIT_FAILURE; + } + } + else if (!gtk_builder_add_from_file (builder, GREETER_DATA_DIR "/greeter.ui", &error)) { g_warning ("Error loading UI: %s", error->message); return EXIT_FAILURE; |