Exemplo n.º 1
0
    def __remove_style_clicked__(self,widget):
        """Remove selected style, currently only 1 style at a time is supported"""
        global location
        style = self.__get_selected_style__()
        if style == False:
            m = "You must select a style to remove first"
            errorMessage.infoMessage(m)            
        else:
            message = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, \
                gtk.BUTTONS_NONE, "Are you sure you want to delete %s?"%(style))
            message.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
            message.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CLOSE)
            response = message.run()
            message.hide()
            if response == gtk.RESPONSE_OK:
                if findStyles.remove_style(style,location) != False:
                    message.destroy()
                    self.__fill_combolist__(self,location)
                else:
                    say = "You do not have access to remove this style please contact "
					say += "your system admin for help removing this style."
                    message = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, \
						gtk.BUTTONS_NONE, say)
                    message.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)
                    response = message.run()
                    message.hide()
                if response == gtk.RESPONSE_CLOSE:
                    message.destroy()
            if response == gtk.RESPONSE_CLOSE:
                message.destroy()
Exemplo n.º 2
0
    def __about1_activate__(self,widget):
        """Activate the help button with the about dialog, use generic if pygtk < 2.5.9"""
        #gladefile="/usr/share/fluxstyle-1.0/glade/main.glade"
        gladefile="./images/main.glade"
        if gtk.pygtk_version < (2,5,90):
            message = "fluxStyle version 1.0 Updae your pygtk version for more features. Version "
			message += "2.6.0 or newer is reccomended"
            errorMessage.infoMessage(message)
Exemplo n.º 3
0
    def __fill_view_menu__(self, widget):
        v_menuNam = None
        if parseConfig.check4_config() == 2:
            message = "This looks like the first time you have started fluxStlye "
			message += "a default config has been created for you. You should edit "
			message += "this config to control the location of styles shown in the "
			message += "preview window. The config file is located in ~/.fluxStyle.rc"
            errorMessage.infoMessage(message)
Exemplo n.º 4
0
    def __fill_combolist__(self,widget,loc="default"):
        """Fill the combo list with styles test to see if there is a ~/.fluxbox/styles
        if there isnt then make it and move on instead of die."""
        global location
        location = expanduser(loc)
        if location == "default":
            location = expanduser("~/.fluxbox/styles")
            try:
                dir = os.listdir(location)
                dir.sort()
                self.liststore.clear()
                for styles in dir:
				    self.liststore.append((self.__get_preview__(styles), styles,))
            except(OSError):
                dir = expanduser("~/.fluxbox/styles")
                os.makedirs(dir,mode=0700)
                message = "You do not have a default style folder yet I have made it for you. "
				message += "The list will remain empty until you install a style which "
				message += "you can do by clicking the add button."
		        errorMessage.infoMessage(message)
Exemplo n.º 5
0
doclines = __doc__.split("\n")

try:
    import gtk
except ImportError:
    print m0
    raise SystemExit

# we now have gtk check for gtk.glade
try:
    import gtk.glade
except ImportError:
    try:
        from fluxstyle import errorMessage
        errorMessage.infoMessage(m1)
    except IomportError:
        m1 = textwrap.wrap(m1,50)
        for l in m1:
          print l
    raise SystemExit
#we have gtk and gtk.glade now check for pygtk version
if gtk.pygtk_version < (2,3,90):
    try:
        from fluxstyle import errorMessage
        errorMessage.infoMessage(m2)
    except ImportError:
        m2 = textwrap.wrap(m2,50)
        for l in m2:
            print l
        raise SystemExit
Exemplo n.º 6
0
doclines = __doc__.split("\n")

try:
    import gtk
except ImportError:
    print m0
    raise SystemExit

# we now have gtk check for gtk.glade
try:
    import gtk.glade
except ImportError:
    try:
        from fluxstyle import errorMessage
        errorMessage.infoMessage(m1)
    except IomportError:
        m1 = textwrap.wrap(m1, 50)
        for l in m1:
            print l
    raise SystemExit
#we have gtk and gtk.glade now check for pygtk version
if gtk.pygtk_version < (2, 3, 90):
    try:
        from fluxstyle import errorMessage
        errorMessage.infoMessage(m2)
    except ImportError:
        m2 = textwrap.wrap(m2, 50)
        for l in m2:
            print l
        raise SystemExit
Exemplo n.º 7
0
    raise SystemExit

from fluxstyle import errorMessage
try:
    import gtk.glade

except:
    #we have gtk so give a gui message as to why this app will not work.
    #maybe we need to offer to open the browser to
    #http://ftp.gnome.org/pub/GNOME/sources/libglade/2.0/ 
    ver = sys.version[:5]
    message = "You need to install libglade2 http://ftp.gnome.org/pub/GNOME/sources"
	message += "/libglade/2.0/ or set your PYTHONPATH correctly. try: export "
	message += "PYTHONPATH=/usr/local/lib/python%s/site-packages/ or export " %(ver)
	message += "PYTHONPATH=/usr/lib/python%s/site-packages/" % (ver)
    errorMessage.infoMessage(message)
    raise SystemExit

if gtk.pygtk_version < (2,3,90):
    #we do have gtk so lets tell them via gui that they need to update pygtk
    #maybe we should add a 'would you like to open a browser to pygtk.org ??
    message = "PyGtk 2.3.90 or later required for this program it is reccomended "
	message += "that you get pygtk 2.6 or newer for best results."
    errorMessage.infoMessage(message)
    raise SystemExit

class StyleChange:
    """Class wrapper for changing styles in fluxbox"""
    location = ""
    def main(self):
        gtk.main()