]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - debian/config-error-dialog.sh
Fix and simplify test of /etc/guest-session/skel emptyness.
[sojka/lightdm.git] / debian / config-error-dialog.sh
1 # Copyright (C) 2014 Canonical Ltd
2 # Author: Gunnar Hjalmarsson <gunnarhj@ubuntu.com>
3 #
4 # This program is free software: you can redistribute it and/or modify it under
5 # the terms of the GNU General Public License as published by the Free Software
6 # Foundation, version 3 of the License.
7 #
8 # See http://www.gnu.org/copyleft/gpl.html the full text of the license.
9
10 # This file may be sourced by the function source_with_error_check() in
11 # /usr/sbin/lightdm-session
12
13 export TEXTDOMAIN=lightdm
14 . /usr/bin/gettext.sh
15
16 PARA1=$(eval_gettext 'Error found when loading $CONFIG_FILE:')
17 PARA2=$(gettext 'As a result the session will not be configured correctly.
18 You should fix the problem as soon as feasible.')
19
20 TEXT="$PARA1\n\n$(fold -s $ERR)\n\n$PARA2"
21
22 if [ -x /usr/bin/kdialog ]; then
23         TEXT_FILE=$(mktemp --tmpdir config-err-kdialog-XXXXXX)
24         echo -n "$TEXT" > "$TEXT_FILE"
25         kdialog --textbox "$TEXT_FILE" 500 300
26         rm -f "$TEXT_FILE"
27 elif [ -x /usr/bin/zenity ]; then
28         zenity --warning --no-wrap --text="$TEXT"
29 fi