#!/bin/bash 
# -*- coding:Utf-8 -*- 
# L'encodage Utf-8 sera a joindre dans tous les fichiers, sinon bug d'accents...

# Copyright (C) 2007 Pâris Quentin
#  		     Cassarin-Grand Arthur

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 

if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"

default()
{
	echo '[-HKEY_CURRENT_USER\Control Panel\Colors]
[-HKEY_CURRENT_USER\Control Panel\Desktop]
[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]' > $REPERTOIRE/tmp/theme.reg
	
}
cd $REPERTOIRE/wineprefix/
if [ "$1" = "shortcut" ]
then
	prefixe=$(detect_wineprefix "$2")
else
	prefixe="$REPERTOIRE/wineprefix/$2"
fi
echo "Using $prefixe"

#reponse=$(menu "Choisissez un préfixe de wine" "$(ls -1)" "Choisissez un préfixe" 1 2 1 "" --cut-line)
#if [ "$reponse" = "" ]
#then
#	exit
#fi
#select_prefixe "$REPERTOIRE/wineprefix/$reponse"
select_prefixe "$prefixe"
cd "$PLAYONLINUX/etc/winelook"
theme=$(menu "$LNG_WINELOOK1" "Default
$(ls -1)" "Wine Look" 1 2 1 "" --cut-line)
if [ "$theme" = "" ]
then
	exit
fi
default
regedit $REPERTOIRE/tmp/theme.reg
if [ ! "$theme" = "Default" ]
then
	regedit "$theme"
fi
message "$LNG_WINELOOK2" "Wine Look" 2 2 0 ""
