## Copyright (C) 2002, 2004 Red Hat, Inc.
## Copyright (C) 2002, 2004 Than Ngo <than@redhat.com>

## 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., 675 Mass Ave, Cambridge, MA 02139, USA.

PROGNAME = 'switchdesk'
TITLE = PROGNAME
SWITCHMAILDIR = '/usr/share/' + PROGNAME + '/'
COPYRIGHT = 'Copyright (C) 2002, 2003, 2004 Red Hat, Inc.'
AUTORS = ['Than Ngo <than@redhat.com>']
VERSION = '4.0.3'
GLADEPATH = ''
TRUE = (1==1)
FALSE = not TRUE

import re
import traceback
import sys
import os
import os.path
import shutil
import string
import gettext

##
## I18N
##
gettext.bindtextdomain(PROGNAME, '/usr/share/locale')
gettext.textdomain(PROGNAME)
_ = gettext.gettext

TEXT = _('The Desktop Switcher is a tool which enables users to easily switch between various Desktops that they have installed.\n\nPlease select the default desktop for the system.')

INFO_TEXT = _('Your desktop configuration has successfully been updated,\n'
              'but you must restart the X Window System for the changes\n'
              'to take effect.\n')

WARNING_TEXT = _('Your desktop configuration cannot be updated, please make sure that the package switchdesk has correctly been installed on the machine.\n')

TIP_TEXT = _('You may not want your new settings to apply\n'
             'globally, but only to this current computer.\n'
             '(Your home directory may be NFS mounted, or\n'
             'you might be sitting at a slow computer, etc.)')

HELPER = 'switchdesk-helper'

GNOME = 'GNOME'
KDE = 'KDE'
XFCE = 'XFce'
TWM = 'TWM'
WINDOWMAKER = 'WindowMaker'
ENLIGHTENMENT = 'Enlightenment'
FVWM = 'FVWM'
ICEWM = 'IceWM'
FLUXBOX = 'FluxBox'

WINDOWMANAGERS={ KDE           : 'startkde',
                 XFCE          : 'startxfce4',
                 GNOME         : 'gnome-session',
                 ICEWM         : 'icewm',
                 FVWM          : 'fvwm2',
                 ENLIGHTENMENT : 'enlightenment',
                 WINDOWMAKER   : 'wmaker',
                 TWM           : 'twm',
                 FLUXBOX       : 'fluxbox' }

def checkWM( wm ):
    DESKTOP_PATH = [ '/usr/local/bin/', '/usr/bin/', '/usr/X11R6/bin/' ]

    for p in DESKTOP_PATH:
        if os.access( p + WINDOWMANAGERS[wm], os.X_OK ):
            return TRUE

    return FALSE

def switchWM( wm ):
    pass
