diff options
author | Oliver Tappe | 2008-06-03 01:52:06 +0200 |
---|---|---|
committer | Oliver Tappe | 2008-06-03 01:52:06 +0200 |
commit | 26f2a2855f43cf5d8516b110149247af7b1b3fb7 (patch) | |
tree | 2a4ef4bb54d6967e4720d16c00b63566d89775ef /os-plugins/plugins/desktop/OpenSLX | |
parent | Implemented a better algorithm for keeping the plugins and the references (diff) | |
download | core-26f2a2855f43cf5d8516b110149247af7b1b3fb7.tar.gz core-26f2a2855f43cf5d8516b110149247af7b1b3fb7.tar.xz core-26f2a2855f43cf5d8516b110149247af7b1b3fb7.zip |
* reorganized the themes-folders of the desktop-plugin as discussed with Michael
recently: now it's kdm/<theme> and gdm/<theme> instead of <theme>/kdm and
<theme>/gdm, as that makes handling of GDM less cumbersome
* renamed actual theme description files to theme.xml instead of being
named like the theme (in this case: openslx.xml)
Tested with GDM and KDM on SUSE-10.2
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1838 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/desktop/OpenSLX')
-rw-r--r-- | os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm | 10 | ||||
-rw-r--r-- | os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm | 2 | ||||
-rw-r--r-- | os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm | 42 |
3 files changed, 35 insertions, 19 deletions
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm index 2777dc13..dbd12416 100644 --- a/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm +++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm @@ -152,9 +152,9 @@ sub setupGDMScript # activate theme only if the corresponding xml file is found # (otherwise fall back to default theme of vendor-OS) if [ -n "\$desktop_theme" ]; then - thdir=/opt/openslx/plugin-repo/desktop/themes/\$desktop_theme/gdm + thdir=/opt/openslx/plugin-repo/desktop/themes/gdm theme=\$desktop_theme - if [ -e /mnt\$thdir/\$theme/\$theme.xml ]; then + if [ -e /mnt\$thdir/\$theme/theme.xml ]; then sed -i "s,\\[greeter\\],[greeter]\\nGraphicalThemeDir=\$thdir," \\ /mnt$configFile sed -i "s,\\[greeter\\],[greeter]\\nGraphicalTheme=\$theme," \\ @@ -298,10 +298,10 @@ sub setupKDMScript # activate theme only if the corresponding xml file is found # (otherwise fall back to default theme of vendor-OS) if [ -n "\$desktop_theme" ]; then - thdir=/opt/openslx/plugin-repo/desktop/themes/\$desktop_theme/kdm theme=\$desktop_theme - if [ -e /mnt\$thdir/\$theme.xml ]; then - sed -i "s,\\[X-\\*-Greeter\\],[X-*-Greeter]\\nTheme=\$thdir," \\ + thfile=/opt/openslx/plugin-repo/desktop/themes/kdm/\$theme/theme.xml + if [ -e /mnt\$thfile ]; then + sed -i "s,\\[X-\\*-Greeter\\],[X-*-Greeter]\\nTheme=\$thfile," \\ /mnt$configFile sed -i "s,\\[X-\\*-Greeter\\],[X-*-Greeter]\\nUseTheme=true," \\ /mnt$configFile diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm index 08633fcd..0e2095c6 100644 --- a/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm +++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm @@ -65,7 +65,7 @@ sub setupKDMScript # SUSE reads /var/adm/kdm/kdmrc.sysconfig, so we link that to # our config file - my $pathInfo = $self->GDMPathInfo(); + my $pathInfo = $self->KDMPathInfo(); my $configFile = $pathInfo->{config}; mkpath("/etc/opt/kdm"); system("ln -sfn /etc/opt/kdm/kdmrc /var/adm/kdm/kdmrc.sysconfig"); diff --git a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm index 9a251a86..5c146016 100644 --- a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm +++ b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm @@ -33,8 +33,12 @@ sub new name => 'desktop', }; - my $localThemesDir = "$openslxConfig{'config-path'}/plugins/desktop/themes"; - mkpath($localThemesDir) unless -e $localThemesDir; + my $localGDMThemesDir + = "$openslxConfig{'config-path'}/plugins/desktop/themes/gdm"; + mkpath($localGDMThemesDir) unless -e $localGDMThemesDir; + my $localKDMThemesDir + = "$openslxConfig{'config-path'}/plugins/desktop/themes/kdm"; + mkpath($localKDMThemesDir) unless -e $localKDMThemesDir; return bless $self, $class; } @@ -432,6 +436,8 @@ sub _fillUnsetStage1Attrs } if (!defined $self->{'supported_themes'}) { $self->{'supported_themes'} = join ",", $self->_getAvailableThemes(); + $self->{attrs}->{'desktop::supported_themes'} + = $self->{'supported_themes'}; } return 1; @@ -608,15 +614,21 @@ sub _setupSupportedThemes for my $theme (@supportedThemes) { THEME_DIR: foreach my $themeBaseDir (@themeBaseDirs) { - my $themeDir = "$themeBaseDir/$theme"; - next THEME_DIR if !-d $themeDir; + my $gdmThemeDir = "$themeBaseDir/gdm/$theme"; + my $kdmThemeDir = "$themeBaseDir/kdm/$theme"; + next THEME_DIR if !-d $gdmThemeDir && !-d $kdmThemeDir; + # any of both dirs is enough # copy theme into plugin-repo folder - my $themeTargetPath = "$self->{pluginRepositoryPath}/themes"; - mkpath($themeTargetPath); vlog(1, "installing theme '$theme'..."); - slxsystem("cp -a $themeDir $themeTargetPath/$theme") == 0 - or die _tr('unable to copy theme %s (%s)', $theme, $!); + my $gdmThemeTargetPath = "$self->{pluginRepositoryPath}/themes/gdm"; + mkpath($gdmThemeTargetPath); + slxsystem("cp -a $gdmThemeDir $gdmThemeTargetPath/$theme") == 0 + or die _tr('unable to copy GDM-theme %s (%s)', $theme, $!); + my $kdmThemeTargetPath = "$self->{pluginRepositoryPath}/themes/kdm"; + mkpath($kdmThemeTargetPath); + slxsystem("cp -a $kdmThemeDir $kdmThemeTargetPath/$theme") == 0 + or die _tr('unable to copy KDM-theme %s (%s)', $theme, $!); next THEME; } warn _tr('theme "%s" not found - skipped!', $theme); @@ -629,7 +641,7 @@ sub _getAvailableThemes { my $self = shift; - my @availableThemes; + my %availableThemes; # return all themes found in any of these two folders my @themeBaseDirs = ( @@ -637,13 +649,17 @@ sub _getAvailableThemes "$self->{openslxBasePath}/lib/plugins/desktop/themes", ); for my $themeBaseDir (@themeBaseDirs) { - push @availableThemes, - map { basename $_ } grep { -d $_ } glob("$themeBaseDir/*"); + my @foundGDMThemes + = map { basename $_ } grep { -d $_ } glob("$themeBaseDir/gdm/*"); + @availableThemes{@foundGDMThemes} = (); + my @foundKDMThemes + = map { basename $_ } grep { -d $_ } glob("$themeBaseDir/kdm/*"); + @availableThemes{@foundKDMThemes} = (); } - vlog(1, _tr("available themes: %s", join ",", @availableThemes)); + vlog(1, _tr("available themes: %s", join ",", keys %availableThemes)); - return @availableThemes; + return keys %availableThemes; } 1; |