installer.kmdr: disable clock and language buttons when not available

This commit is contained in:
Silvan Calarco 2011-10-30 16:42:03 +01:00
parent 3e711cfee0
commit 16ebbb5c67

View File

@ -760,28 +760,6 @@ dcop @dcopid KommanderIf setText licenseBrowser "`cat /usr/share/openmamba/insta
</stringlist> </stringlist>
</property> </property>
</widget> </widget>
<widget class="ScriptObject">
<property name="name">
<cstring>setTimeLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>520</x>
<y>10</y>
<width>32</width>
<height>32</height>
</rect>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>@execBegin
currdate=`date +"%x %H:%M %Z"`
dcop @dcopid KommanderIf setText timelabel "$currdate"
@execEnd
</string>
</stringlist>
</property>
</widget>
<widget class="Label"> <widget class="Label">
<property name="name"> <property name="name">
<cstring>Label32</cstring> <cstring>Label32</cstring>
@ -800,7 +778,7 @@ dcop @dcopid KommanderIf setText timelabel "$currdate"
</widget> </widget>
<widget class="ExecButton"> <widget class="ExecButton">
<property name="name"> <property name="name">
<cstring>ExecButton1</cstring> <cstring>timebutton</cstring>
</property> </property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -820,6 +798,29 @@ dcop @dcopid KommanderIf setText timelabel "$currdate"
<stringlist> <stringlist>
<string>@exec("kcmshell4 clock") <string>@exec("kcmshell4 clock")
@setTimeLabel.execute() @setTimeLabel.execute()
</string>
</stringlist>
</property>
</widget>
<widget class="ScriptObject">
<property name="name">
<cstring>setTimeLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>520</x>
<y>10</y>
<width>32</width>
<height>32</height>
</rect>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>@execBegin
currdate=`date +"%x %H:%M %Z"`
dcop @dcopid KommanderIf setText timelabel "$currdate"
[ -e /opt/kde/lib/kde4/kcm_clock.so ] || dcop @dcopid KommanderIf setEnabled timebutton "false"
@execEnd
</string> </string>
</stringlist> </stringlist>
</property> </property>
@ -920,6 +921,48 @@ dcop @dcopid KommanderIf setText timelabel "$currdate"
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="ExecButton">
<property name="name">
<cstring>langbutton</cstring>
</property>
<property name="geometry">
<rect>
<x>280</x>
<y>40</y>
<width>261</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Configure &amp;language and country</string>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>@exec("kcmshell4 language")
@execBegin
if [ -r ~/.kde4/share/config/kdeglobals ]; then
eval `grep -i Language ~/.kde4/share/config/kdeglobals`
Language=${Language/:*}
if [ "$Language" ]; then
case ${Language} in
it|it_IT) LANGUAGE="it_IT" ;;
en|en_US) LANGUAGE="en_US" ;;
es|es_ES) LANGUAGE="es_ES" ;;
fr|fr_FR) LANGUAGE="fr_FR" ;;
en_GB) LANGUAGE="en_GB" ;;
*) LANGUAGE="${Language}" ;;
esac
LANGUAGE=${LANGUAGE:0:5}.UTF-8
sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/sysconfig/i18n
sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/locale.conf
fi
fi
@execEnd
@setLangLabel.execute()
</string>
</stringlist>
</property>
</widget>
<widget class="ScriptObject"> <widget class="ScriptObject">
<property name="name"> <property name="name">
<cstring>setLangLabel</cstring> <cstring>setLangLabel</cstring>
@ -963,49 +1006,7 @@ case ${LANGUAGE:0:5} in
esac esac
dcop @dcopid KommanderIf setText langlabel "$LANGUAGE" dcop @dcopid KommanderIf setText langlabel "$LANGUAGE"
dcop @dcopid KommanderIf setText countrylabel $"$COUNTRY" dcop @dcopid KommanderIf setText countrylabel $"$COUNTRY"
</string> [ -e /opt/kde/lib/kde4/kcm_locale.so ] || dcop @dcopid KommanderIf setEnabled langbutton "false"</string>
</stringlist>
</property>
</widget>
<widget class="ExecButton">
<property name="name">
<cstring>ExecButton1_2_2</cstring>
</property>
<property name="geometry">
<rect>
<x>280</x>
<y>40</y>
<width>261</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Configure &amp;language and country</string>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>@exec("kcmshell4 language")
@execBegin
if [ -r ~/.kde4/share/config/kdeglobals ]; then
eval `grep -i Language ~/.kde4/share/config/kdeglobals`
Language=${Language/:*}
if [ "$Language" ]; then
case ${Language} in
it|it_IT) LANGUAGE="it_IT" ;;
en|en_US) LANGUAGE="en_US" ;;
es|es_ES) LANGUAGE="es_ES" ;;
fr|fr_FR) LANGUAGE="fr_FR" ;;
en_GB) LANGUAGE="en_GB" ;;
*) LANGUAGE="${Language}" ;;
esac
LANGUAGE=${LANGUAGE:0:5}.UTF-8
sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/sysconfig/i18n
sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/locale.conf
fi
fi
@execEnd
@setLangLabel.execute()
</string>
</stringlist> </stringlist>
</property> </property>
</widget> </widget>