Browse Source

Fix default theme initialization failure if config file values are missing. Fixes #32

sisyphus
Dustin Falgout 9 years ago
parent
commit
a0384a4576
  1. 4
      NEWS
  2. 2
      configure.ac
  3. 4
      themes/antergos/README.md
  4. 19
      themes/antergos/js/greeter.js

4
NEWS

@ -1,3 +1,7 @@
Overview of changes in lightdm-webkit2-greeter 2.1.1
* Fix default theme initialization failure if config file values are missing.
Overview of changes in lightdm-webkit2-greeter 2.1.0 Overview of changes in lightdm-webkit2-greeter 2.1.0
* It is now possible to configure branding including logos and backgrounds * It is now possible to configure branding including logos and backgrounds

2
configure.ac

@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT(lightdm-webkit2-greeter, 2.1.0) AC_INIT(lightdm-webkit2-greeter, 2.1.1)
AC_SUBST(THEME_DIR) AC_SUBST(THEME_DIR)
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
AC_PREREQ([2.59]) AC_PREREQ([2.59])

4
themes/antergos/README.md

@ -1,4 +1,4 @@
# lightdm-webkit-theme-antergos # lightdm-webkit-theme-antergos
### THIS REPO IS A MIRROR ### THIS REPO IS A MIRROR
#### Theme code is now maintained as part of [lightdm-webkit2-greeter](http://github.com/antergos/lightdm-webkit2-greeter). #### Theme code is now maintained as part of [lightdm-webkit2-greeter](http://github.com/antergos/lightdm-webkit2-greeter).
#### This repo is maintained as a mirror of the theme's code for easy cloning. #### This repo is maintained as a mirror of the theme's code for easy cloning/forking.

19
themes/antergos/js/greeter.js

@ -71,6 +71,8 @@ class AntergosThemeUtils {
} }
this.init_config_values(); this.init_config_values();
return _util;
} }
@ -132,17 +134,15 @@ class AntergosThemeUtils {
* Get some values from `lightdm-webkit2-greeter.conf` and save them for later. * Get some values from `lightdm-webkit2-greeter.conf` and save them for later.
*/ */
init_config_values() { init_config_values() {
var logo = '', user_image = '', background_images = [], background_images_dir = ''; var logo, user_image, debug, background_images, background_images_dir;
if ( 'undefined' !== typeof( config ) ) { if ( 'undefined' !== typeof( config ) ) {
logo = config.get_str( 'branding', 'logo' ) || ''; logo = config.get_str( 'branding', 'logo' ) || 'img/antergos.png';
user_image = config.get_str( 'branding', 'user_image' ) || ''; user_image = config.get_str( 'branding', 'user_image' ) || 'img/antergos-logo-user.png';
this.debug = config.get_bool( 'greeter', 'debug_mode' ); background_images_dir = config.get_str( 'branding', 'background_images' ) || '/usr/share/backgrounds';
this.debug = (true === this.debug) ? this.debug : false; debug = config.get_bool( 'greeter', 'debug_mode' ) || false;
background_images_dir = config.get_str( 'branding', 'background_images' ) || '';
if ( background_images_dir ) { if ( background_images_dir ) {
background_images = greeterutil.dirlist( background_images_dir ) || []; background_images = greeterutil.dirlist( background_images_dir ) || [];
_util.log(background_images); _util.log(background_images);
@ -155,6 +155,7 @@ class AntergosThemeUtils {
} }
this.logo = logo; this.logo = logo;
this.debug = debug;
this.user_image = user_image; this.user_image = user_image;
this.background_images = background_images; this.background_images = background_images;
this.background_images_dir = background_images_dir; this.background_images_dir = background_images_dir;
@ -207,7 +208,7 @@ class AntergosBackgroundManager {
this.current_background = _util.cache_get( 'background_manager', 'current_background' ); this.current_background = _util.cache_get( 'background_manager', 'current_background' );
if ( ! _util.background_images_dir || ! _util.background_images ) { if ( ! _util.background_images_dir || ! _util.background_images || ! _util.background_images.length ) {
_util.log( 'AntergosBackgroundManager: [ERROR] No background images detected.' ); _util.log( 'AntergosBackgroundManager: [ERROR] No background images detected.' );
$( '.header' ).fadeTo( 300, 0.5, function() { $( '.header' ).fadeTo( 300, 0.5, function() {
@ -546,7 +547,7 @@ class AntergosTheme {
if ( $( this.$clock_container ).hasClass( 'in' ) ) { if ( $( this.$clock_container ).hasClass( 'in' ) ) {
$( '#trigger' ).trigger( 'click' ); $( '#trigger' ).trigger( 'click' );
} }
if ( $( this.$user_list ).length <= 1 ) { if ( $( this.$user_list ).children().length <= 1 ) {
$( this.$user_list ).find( 'a' ).trigger( 'click', this ); $( this.$user_list ).find( 'a' ).trigger( 'click', this );
} }
} }

Loading…
Cancel
Save