diff --git a/debian/changelog b/debian/changelog index e7f25ed..4577c6d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mintmenu (5.0.6) julia; urgency=low + + * Removed sidepane (confusing), plugins are now enabled/disabled in preferences + * UI improvements (dotted separators, layout) + + -- Clement Lefebvre Mon, 13 Sep 2010 12:09:00 +0000 + mintmenu (5.0.5) julia; urgency=low * Multi-threaded search diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.glade b/usr/lib/linuxmint/mintMenu/mintMenu.glade index cc06375..dd97faa 100644 --- a/usr/lib/linuxmint/mintMenu/mintMenu.glade +++ b/usr/lib/linuxmint/mintMenu/mintMenu.glade @@ -1,12 +1,12 @@ - - - + + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK - GTK_WINDOW_POPUP + popup False - GDK_WINDOW_TYPE_HINT_MENU + menu True True False @@ -18,40 +18,6 @@ True - - - 35 - True - - - True - 3 - 5 - - - 32 - 20 - True - True - 0 - - - - - - - False - False - - - - - - - False - False - - diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 17f73db..2072f2b 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -1,41 +1,41 @@ #!/usr/bin/env python try: - import sys - import gtk - import gtk.glade - import pango - import os - import gnomeapplet - import gettext - import gnomevfs - import traceback - import time - import gc - import xdg.Config - import pygtk - pygtk.require( "2.0" ) + import sys + import gtk + import gtk.glade + import pango + import os + import gnomeapplet + import gettext + import gnomevfs + import traceback + import time + import gc + import xdg.Config + import pygtk + pygtk.require( "2.0" ) except Exception, e: - print e - sys.exit( 1 ) + print e + sys.exit( 1 ) global mbindkey # Load the key binding lib (developped by deskbar-applet, copied into mintMenu so we don't end up with an unnecessary dependency) try: - from deskbar.core.keybinder import tomboy_keybinder_bind as bind_key + from deskbar.core.keybinder import tomboy_keybinder_bind as bind_key except Exception, cause: - print "*********** Keybind Driver Load Failure **************" - print "Error Report : ", str(cause) - pass + print "*********** Keybind Driver Load Failure **************" + print "Error Report : ", str(cause) + pass # Rename the process try: - import dl - libc = dl.open( "/lib/libc.so.6" ) - libc.call( "prctl", 15, "mintmenu", 0, 0, 0 ) - libc.close() + import dl + libc = dl.open( "/lib/libc.so.6" ) + libc.call( "prctl", 15, "mintmenu", 0, 0, 0 ) + libc.close() except ImportError: - pass + pass # i18n gettext.install("mintmenu", "/usr/share/linuxmint/locale") @@ -57,851 +57,781 @@ from execute import * class MainWindow( object ): - """This is the main class for the application""" - - def __init__( self, toggleButton ): - - self.path = PATH - sys.path.append( os.path.join( self.path, "plugins") ) - - self.icon = ICON - - self.toggle = toggleButton - # Load glade file and extract widgets - gladefile = os.path.join( self.path, "mintMenu.glade" ) - wTree = gtk.glade.XML( gladefile, "mainWindow" ) - self.window = wTree.get_widget( "mainWindow" ) - self.paneholder = wTree.get_widget( "paneholder" ) - self.sidepane = wTree.get_widget( "sidepane" ) - self.pinbutton = wTree.get_widget( "pin_button" ) - self.pinholder = wTree.get_widget( "pinholder" ) - self.border = wTree.get_widget( "border" ) - - self.panesToColor = [ ] - self.headingsToColor = [ ] - - self.window.connect( "map-event", self.onMap ) - self.window.connect( "show", self.onShow ) - self.window.connect( "unmap-event", self.onUnmap ) - self.window.connect( "button-press-event", self.onButtonPress ) - self.window.connect( "key-press-event", self.onKeyPress ) - self.window.connect( "grab-broken-event", self.onGrabBroken ) - - self.window.stick() - - plugindir = os.path.join( os.path.expanduser( "~" ), ".linuxmint/mintMenu/plugins" ) - sys.path.append( plugindir ) - - dic = {"on_window1_destroy" : self.quit_cb, - "on_pin_button_toggled" : self.PinMenu} - wTree.signal_autoconnect( dic ) - - self.gconf = EasyGConf( "/apps/mintMenu/" ) - self.gconftheme = EasyGConf( "/desktop/gnome/interface/" ) - - self.getSetGconfEntries() - self.SetupMintMenuBorder() - self.SetupMintMenuOpacity() - - self.tooltips = gtk.Tooltips() - if self.globalEnableTooltips and self.enableTooltips: - self.tooltips.enable() - else: - self.tooltips.disable() - - self.PopulatePlugins(); - - self.gconf.notifyAdd( "plugins_list", self.RegenPlugins ) - self.gconftheme.notifyAdd( "gtk_theme", self.RegenPlugins ) - - self.gconf.notifyAdd( "show_side_pane", self.toggleShowSidepane ) - self.gconf.notifyAdd( "start_with_favorites", self.toggleStartWithFavorites ) - self.gconf.notifyAdd( "/apps/panel/global/tooltips_enabled", self.toggleTooltipsEnabled ) - self.gconf.notifyAdd( "tooltips_enabled", self.toggleTooltipsEnabled ) - - self.gconf.notifyAdd( "use_custom_color", self.toggleUseCustomColor ) - self.gconf.notifyAdd( "custom_border_color", self.toggleCustomBorderColor ) - self.gconf.notifyAdd( "custom_heading_color", self.toggleCustomHeadingColor ) - self.gconf.notifyAdd( "custom_color", self.toggleCustomBackgroundColor ) - self.gconf.notifyAdd( "border_width", self.toggleBorderWidth ) - self.gconf.notifyAdd( "opacity", self.toggleOpacity ) - - def quit_cb (self): - gtk.main_quit() - sys.exit(0) - - def wakePlugins( self ): - # Call each plugin and let them know we're showing up - for plugin in self.plugins.values(): - if hasattr( plugin, "destroy" ): - plugin.wake() - - def toggleTooltipsEnabled( self, client, connection_id, entry, args ): - if entry.get_key() == "/apps/panel/global/tooltips_enabled": - self.globalEnableTooltips = entry.get_value().get_bool() - else: - self.enableTooltips = entry.get_value().get_bool() - - if self.globalEnableTooltips and self.enableTooltips: - self.tooltips.enable() - else: - self.tooltips.disable() - - def toggleStartWithFavorites( self, client, connection_id, entry, args ): - self.startWithFavorites = entry.get_value().get_bool() - - def toggleShowSidepane( self, client, connection_id, entry, args ): - self.sidepanevisible = entry.get_value().get_bool() - if self.sidepanevisible == False and self.pinmenu == False: - self.sidepane.hide() - else: - self.sidepane.show() - - def toggleBorderWidth( self, client, connection_id, entry, args ): - self.borderwidth = entry.get_value().get_int() - self.SetupMintMenuBorder() - - def toggleOpacity( self, client, connection_id, entry, args ): - self.opacity = entry.get_value().get_int() - self.SetupMintMenuOpacity() - - def toggleUseCustomColor( self, client, connection_id, entry, args ): - self.usecustomcolor = entry.get_value().get_bool() - self.SetupMintMenuBorder() - self.SetPaneColors( self.panesToColor ) - self.SetHeadingStyle( self.headingsToColor ) - - - def toggleCustomBorderColor( self, client, connection_id, entry, args ): - self.custombordercolor = entry.get_value().get_string() - self.SetupMintMenuBorder() - - def toggleCustomBackgroundColor( self, client, connection_id, entry, args ): - self.customcolor = entry.get_value().get_string() - self.SetPaneColors( self.panesToColor ) - - def toggleCustomHeadingColor( self, client, connection_id, entry, args ): - self.customheadingcolor = entry.get_value().get_string() - self.SetHeadingStyle( self.headingsToColor ) - - - def getSetGconfEntries( self ): - self.pluginlist = self.gconf.get( "list-string", "plugins_list",['newpane','places', 'system_management', 'newpane', 'applications'] ) - self.dottedfile = os.path.join( self.path, "dotted.png") - - self.usecustomcolor = self.gconf.get( "bool", "use_custom_color", False ) - self.customcolor = self.gconf.get( "color", "custom_color", "#EEEEEE" ) - self.customheadingcolor = self.gconf.get( "color", "custom_heading_color", "#001155" ) - self.custombordercolor = self.gconf.get( "color", "custom_border_color", "#001155" ) - - self.borderwidth = self.gconf.get( "int", "border_width", 1 ) - self.opacity = self.gconf.get( "int", "opacity", 100 ) - self.offset = self.gconf.get( "int", "mintMenu_offset", 0 ) - self.pinmenu = self.gconf.get( "bool", "pin_menu", False ) - self.enableTooltips = self.gconf.get( "bool", "tooltips_enabled", True ) - self.globalEnableTooltips = self.gconf.get( "bool", "/apps/panel/global/tooltips_enabled", True ) - self.sidepanevisible = self.gconf.get( "bool", "show_side_pane", False ) - self.startWithFavorites = self.gconf.get( "bool", "start_with_favorites", False ) - - - def PinMenu(self, *args, **kargs): - self.pinmenu = self.pinbutton.get_active() - self.gconf.set("bool", "pin_menu", self.pinmenu) - - if self.pinmenu == True: - self.sidepane.show() - elif not self.sidepanevisible: - self.sidepane.hide() - - - def SetupMintMenuBorder( self ): - if self.usecustomcolor: - self.window.modify_bg( gtk.STATE_NORMAL, gtk.gdk.color_parse( self.custombordercolor ) ) - else: - self.window.modify_bg( gtk.STATE_NORMAL, self.window.rc_get_style().bg[ gtk.STATE_SELECTED ] ) - self.border.set_padding( self.borderwidth, self.borderwidth, self.borderwidth, self.borderwidth ) - self.SetPaneColors( [ self.sidepane ] ) - - self.pinbutton.set_active( self.pinmenu ) - - if self.sidepanevisible == False and self.pinmenu == False: - self.sidepane.hide() - else: - self.sidepane.show() - - def SetupMintMenuOpacity( self ): - print "Opacity is: " + str(self.opacity) - opacity = float(self.opacity) / float(100) - print "Setting opacity to: " + str(opacity) - self.window.set_opacity(opacity) - - def PopulatePlugins( self ): - self.panesToColor = [ ] - self.headingsToColor = [ ] - start = time.time() - PluginPane = gtk.EventBox() - PluginPane.show() - PaneLadder = gtk.VBox( False, 0 ) - PluginPane.add( PaneLadder ) - self.SetPaneColors( [ PluginPane ] ) - ImageBox = gtk.EventBox() - self.SetPaneColors( [ ImageBox ] ) - ImageBox.show() - - seperatorImage = gtk.gdk.pixbuf_new_from_file( self.dottedfile ) - - self.plugins = {} - - for plugin in self.pluginlist: - if plugin in self.plugins: - print u"Duplicate plugin in list: ", plugin - continue - - if plugin != "newpane": - try: - X = __import__( plugin ) - # If no parameter passed to plugin it is autonomous - if X.pluginclass.__init__.func_code.co_argcount == 1: - MyPlugin = X.pluginclass() - else: - # pass mintMenu and togglebutton instance so that the plugin can use it - MyPlugin = X.pluginclass( self, self.toggle ) - - if not MyPlugin.icon: - MyPlugin.icon = "gnome-logo-icon.png" - - if hasattr( MyPlugin, "hideseparator" ) and not MyPlugin.hideseparator: - Image1 = gtk.Image() - Image1.set_from_pixbuf( seperatorImage ) - if not ImageBox.get_child(): - ImageBox.add( Image1 ) - Image1.show() - - #print u"Loading plugin '" + plugin + "' : sucessful" - except Exception, e: - MyPlugin = gtk.EventBox() #Fake class for MyPlugin - MyPlugin.heading = _("Couldn't load plugin:") + " " + plugin - MyPlugin.content_holder = gtk.EventBox() - - # create traceback - info = sys.exc_info() - - errorLabel = gtk.Label( "\n".join(traceback.format_exception( info[0], info[1], info[2] )).replace("\\n", "\n") ) - errorLabel.set_selectable( True ) - errorLabel.set_line_wrap( True ) - errorLabel.set_alignment( 0.0, 0.0 ) - errorLabel.set_padding( 5, 5 ) - errorLabel.show() - - MyPlugin.content_holder.add( errorLabel ) - MyPlugin.add( MyPlugin.content_holder ) - MyPlugin.width = 270 - MyPlugin.icon = 'gnome-logo-icon.png' - print u"Unable to load " + plugin + " plugin :-(" - - - self.SetPaneColors( [MyPlugin.content_holder] ) - - - MyPlugin.content_holder.show() - - if MyPlugin.heading != "": - VBox1 = gtk.VBox( False, 0 ) - Label1 = gtk.Label( MyPlugin.heading ) - Align1 = gtk.Alignment( 0, 0.5, 0, 0 ) - Align1.set_padding( 0, 0, 0, 0 ) - Align1.add( Label1 ) - self.SetHeadingStyle( [Label1] ) - Align1.show() - Label1.show() - - if not hasattr( MyPlugin, 'sticky' ) or MyPlugin.sticky == True: - heading = gtk.EventBox() - Align1.set_padding( 0, 0, 10, 0 ) - self.SetPaneColors( [heading] ) - heading.set_size_request( MyPlugin.width, 30 ) - else: - heading = gtk.Button() - heading.set_relief( gtk.RELIEF_NONE ) - heading.set_size_request( MyPlugin.width, -1 ) - heading.connect( "button_press_event", self.TogglePluginView, VBox1, MyPlugin.icon, MyPlugin.heading, MyPlugin ) - - heading.add( Align1 ) - heading.show() - VBox1.pack_start( heading, False ) - VBox1.show() - MyPlugin.container = VBox1 - #Add plugin to Plugin Box under heading button - MyPlugin.content_holder.reparent( VBox1 ) - - #Add plugin to main window - PaneLadder.pack_start( VBox1 ) - PaneLadder.show() - - if MyPlugin.window: - MyPlugin.window.destroy() - - try: - if hasattr( MyPlugin, 'do_plugin' ): - MyPlugin.do_plugin() - if hasattr( MyPlugin, 'height' ): - MyPlugin.content_holder.set_size_request( -1, MyPlugin.height ) - if hasattr( MyPlugin, 'itemstocolor' ): - self.SetPaneColors( MyPlugin.itemstocolor ) - if hasattr( MyPlugin, 'minimized' ) and MyPlugin.minimized: - self.HidePlugin( MyPlugin.container, MyPlugin.icon, MyPlugin.heading, MyPlugin ) - except: - # create traceback - info = sys.exc_info() - - error = _("Couldn't initialize plugin") + " " + plugin + " : " + "\n".join(traceback.format_exception( info[0], info[1], info[2] )).replace("\\n", "\n") - msgDlg = gtk.MessageDialog( None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, error ) - msgDlg.run(); - msgDlg.destroy(); - - self.plugins[plugin] = MyPlugin - - else: - self.paneholder.pack_start( ImageBox, False, False, 0 ) - self.paneholder.pack_start( PluginPane, False, False, 0 ) - PluginPane = gtk.EventBox() - PaneLadder = gtk.VBox( False, 0 ) - PluginPane.add( PaneLadder ) - self.SetPaneColors( [PluginPane] ) - ImageBox = gtk.EventBox() - self.SetPaneColors( [ImageBox] ) - ImageBox.show() - PluginPane.show_all() - - if self.plugins and hasattr( MyPlugin, 'hideseparator' ) and not MyPlugin.hideseparator: - Image1 = gtk.Image() - Image1.set_from_pixbuf( seperatorImage ) - Image1.show() - ImageBox.add( Image1 ) - - - self.paneholder.pack_start( ImageBox, False, False, 0 ) - self.paneholder.pack_start( PluginPane, False, False, 0 ) - self.tooltips.disable() - - #print u"Loading", (time.time() - start), "s" - - - def HidePlugin( self , PluginData, icon, tooltip, plugin ): - if PluginData.flags() & gtk.VISIBLE: - PluginData.hide() - Button1 = gtk.Button() - Image1 = gtk.Image() - Image1.set_from_pixbuf( iconManager.getIcon( icon, gtk.ICON_SIZE_MENU ) ) - Button1.add( Image1 ) - Button1.show() - self.setTooltip( Button1, tooltip ) - Image1.show() - - #Show side pane if it is hidden - self.sidepane.show() - Button1.connect( "button_press_event", self.TogglePluginView, PluginData, icon, tooltip, plugin ) - self.pinholder.pack_start( Button1, False, False, 0 ) - - - def TogglePluginView( self, widget, event, PluginData, icon, tooltip, plugin ): - if event.button == 1: - if PluginData.flags() & gtk.VISIBLE: - PluginData.hide() - if hasattr( plugin, 'SetHidden' ): - plugin.SetHidden(True) - Button1 = gtk.Button() - Image1 = gtk.Image() - Image1.set_from_pixbuf( iconManager.getIcon( icon, gtk.ICON_SIZE_MENU ) ) - Button1.add( Image1 ) - Button1.show() - self.setTooltip( Button1, tooltip ) - Image1.show() - - #Show side pane if it is hidden - self.sidepane.show() - Button1.connect( "button_press_event", self.TogglePluginView, PluginData, icon, tooltip, plugin ) - self.pinholder.pack_start( Button1, False, False, 0 ) - - else: - PluginData.show() - if hasattr( plugin, 'SetHidden' ): - plugin.SetHidden(False) - widget.destroy() - if len( self.pinholder.get_children() ) == 1: - if self.sidepanevisible == False and self.pinmenu == False: - self.sidepane.hide() - else: - self.sidepane.show() - - def SetPaneColors( self, items ): - for item in items: - if item not in self.panesToColor: - self.panesToColor.append( item ) - - if self.usecustomcolor: - for item in items: - item.modify_bg( gtk.STATE_NORMAL, gtk.gdk.color_parse( self.customcolor ) ) - else: - for item in items: - item.modify_bg( gtk.STATE_NORMAL, self.paneholder.rc_get_style().bg[ gtk.STATE_NORMAL ] ) - - - def SetHeadingStyle( self, items ): - for item in items: - if item not in self.headingsToColor: - self.headingsToColor.append( item ) - - HeadingStyle = pango.AttrList() - attr = pango.AttrSize( 12000, 0, -1 ) - HeadingStyle.insert( attr ) - - if self.usecustomcolor: - headingcolor = gtk.gdk.color_parse( self.customheadingcolor ) - attr = pango.AttrForeground( headingcolor.red, headingcolor.green, headingcolor.blue, 0, -1 ) - HeadingStyle.insert( attr ) -# else: -# headingcolor = self.window.rc_get_style().bg[ gtk.STATE_SELECTED ] - - attr = pango.AttrWeight( pango.WEIGHT_BOLD, 0, -1 ) - HeadingStyle.insert( attr ) - - for item in items: - item.set_attributes( HeadingStyle ) - - def setTooltip( self, widget, tip, tipPrivate = None ): - self.tooltips.set_tip( widget, tip, tipPrivate ) - - def RegenPlugins( self, *args, **kargs ): - #print - #print u"Reloading Plugins..." - for item in self.paneholder: - if item.name != "sidepane": - item.destroy() - - for plugin in self.plugins.values(): - if hasattr( plugin, "destroy" ): - plugin.destroy() - - del plugin - del self.plugins - - gc.collect() - - self.getSetGconfEntries() - self.PopulatePlugins() - - #print NAME+u" reloaded" - - - def show( self ): - self.window.present() - - if ( "applications" in self.plugins ) and ( hasattr( self.plugins["applications"], "focusSearchEntry" ) ): - if (self.startWithFavorites): - self.plugins["applications"].changeTab(0) - self.plugins["applications"].focusSearchEntry() - - def grab( self ): - gtk.gdk.pointer_grab( self.window.window, True, gtk.gdk.BUTTON_PRESS_MASK ) - gtk.gdk.keyboard_grab( self.window.window, False ) - self.window.grab_add() - - def ungrab( self ): - self.window.grab_remove() - self.window.hide() - gtk.gdk.pointer_ungrab() - gtk.gdk.keyboard_ungrab() - - def onMap( self, widget, event ): - self.grab() - - def onShow( self, widget ): - for plugin in self.plugins.values(): - if hasattr( plugin, "onShowMenu" ): - plugin.onShowMenu() - - def onUnmap( self, widget, event ): - self.ungrab() - - for plugin in self.plugins.values(): - if hasattr( plugin, "onHideMenu" ): - plugin.onHideMenu() - - def onKeyPress( self, widget, event ): - if event.keyval == gtk.keysyms.Escape or event.keyval == gtk.keysyms.Super_L: - self.hide() - return False - - def onButtonPress( self, widget, event ): - # Check if the pointer is within the menu, else hide the menu - winatptr = gtk.gdk.window_at_pointer() - - if winatptr: - win = winatptr[0] - while win: - if win == self.window.window: - break - win = win.get_parent() - if not win: - self.hide( True ) - else: - self.hide( True ) - - return True - - def onGrabBroken( self, widget, event ): - if event.grab_window: - try: - theft = event.grab_window.get_user_data() - theft.connect( "event", self.onGrabTheftEvent ) - except: - self.window.hide( True ) - - def onGrabTheftEvent( self, widget, event ): - if event.type == gtk.gdk.UNMAP or event.type == gtk.gdk.SELECTION_CLEAR: - self.grab() - - def hide( self, forceHide = False ): - if not self.pinmenu or forceHide: - self.window.hide() + """This is the main class for the application""" + + def __init__( self, toggleButton ): + + self.path = PATH + sys.path.append( os.path.join( self.path, "plugins") ) + + self.icon = ICON + + self.toggle = toggleButton + # Load glade file and extract widgets + gladefile = os.path.join( self.path, "mintMenu.glade" ) + wTree = gtk.glade.XML( gladefile, "mainWindow" ) + self.window = wTree.get_widget( "mainWindow" ) + self.paneholder = wTree.get_widget( "paneholder" ) + self.border = wTree.get_widget( "border" ) + + self.panesToColor = [ ] + self.headingsToColor = [ ] + + self.window.connect( "map-event", self.onMap ) + self.window.connect( "show", self.onShow ) + self.window.connect( "unmap-event", self.onUnmap ) + self.window.connect( "button-press-event", self.onButtonPress ) + self.window.connect( "key-press-event", self.onKeyPress ) + self.window.connect( "grab-broken-event", self.onGrabBroken ) + + self.window.stick() + + plugindir = os.path.join( os.path.expanduser( "~" ), ".linuxmint/mintMenu/plugins" ) + sys.path.append( plugindir ) + + dic = {"on_window1_destroy" : self.quit_cb} + wTree.signal_autoconnect( dic ) + + self.gconf = EasyGConf( "/apps/mintMenu/" ) + self.gconftheme = EasyGConf( "/desktop/gnome/interface/" ) + + self.getSetGconfEntries() + self.SetupMintMenuBorder() + self.SetupMintMenuOpacity() + + self.tooltips = gtk.Tooltips() + if self.globalEnableTooltips and self.enableTooltips: + self.tooltips.enable() + else: + self.tooltips.disable() + + self.PopulatePlugins(); + + self.gconf.notifyAdd( "plugins_list", self.RegenPlugins ) + self.gconftheme.notifyAdd( "gtk_theme", self.RegenPlugins ) + + self.gconf.notifyAdd( "start_with_favorites", self.toggleStartWithFavorites ) + self.gconf.notifyAdd( "/apps/panel/global/tooltips_enabled", self.toggleTooltipsEnabled ) + self.gconf.notifyAdd( "tooltips_enabled", self.toggleTooltipsEnabled ) + + self.gconf.notifyAdd( "use_custom_color", self.toggleUseCustomColor ) + self.gconf.notifyAdd( "custom_border_color", self.toggleCustomBorderColor ) + self.gconf.notifyAdd( "custom_heading_color", self.toggleCustomHeadingColor ) + self.gconf.notifyAdd( "custom_color", self.toggleCustomBackgroundColor ) + self.gconf.notifyAdd( "border_width", self.toggleBorderWidth ) + self.gconf.notifyAdd( "opacity", self.toggleOpacity ) + + def quit_cb (self): + gtk.main_quit() + sys.exit(0) + + def wakePlugins( self ): + # Call each plugin and let them know we're showing up + for plugin in self.plugins.values(): + if hasattr( plugin, "destroy" ): + plugin.wake() + + def toggleTooltipsEnabled( self, client, connection_id, entry, args ): + if entry.get_key() == "/apps/panel/global/tooltips_enabled": + self.globalEnableTooltips = entry.get_value().get_bool() + else: + self.enableTooltips = entry.get_value().get_bool() + + if self.globalEnableTooltips and self.enableTooltips: + self.tooltips.enable() + else: + self.tooltips.disable() + + def toggleStartWithFavorites( self, client, connection_id, entry, args ): + self.startWithFavorites = entry.get_value().get_bool() + + def toggleBorderWidth( self, client, connection_id, entry, args ): + self.borderwidth = entry.get_value().get_int() + self.SetupMintMenuBorder() + + def toggleOpacity( self, client, connection_id, entry, args ): + self.opacity = entry.get_value().get_int() + self.SetupMintMenuOpacity() + + def toggleUseCustomColor( self, client, connection_id, entry, args ): + self.usecustomcolor = entry.get_value().get_bool() + self.SetupMintMenuBorder() + self.SetPaneColors( self.panesToColor ) + self.SetHeadingStyle( self.headingsToColor ) + + + def toggleCustomBorderColor( self, client, connection_id, entry, args ): + self.custombordercolor = entry.get_value().get_string() + self.SetupMintMenuBorder() + + def toggleCustomBackgroundColor( self, client, connection_id, entry, args ): + self.customcolor = entry.get_value().get_string() + self.SetPaneColors( self.panesToColor ) + + def toggleCustomHeadingColor( self, client, connection_id, entry, args ): + self.customheadingcolor = entry.get_value().get_string() + self.SetHeadingStyle( self.headingsToColor ) + + + def getSetGconfEntries( self ): + self.pluginlist = self.gconf.get( "list-string", "plugins_list",['places', 'system_management', 'newpane', 'applications'] ) + self.dottedfile = os.path.join( self.path, "dotted.png") + + self.usecustomcolor = self.gconf.get( "bool", "use_custom_color", False ) + self.customcolor = self.gconf.get( "color", "custom_color", "#EEEEEE" ) + self.customheadingcolor = self.gconf.get( "color", "custom_heading_color", "#001155" ) + self.custombordercolor = self.gconf.get( "color", "custom_border_color", "#001155" ) + + self.borderwidth = self.gconf.get( "int", "border_width", 1 ) + self.opacity = self.gconf.get( "int", "opacity", 100 ) + self.offset = self.gconf.get( "int", "mintMenu_offset", 0 ) + self.enableTooltips = self.gconf.get( "bool", "tooltips_enabled", True ) + self.globalEnableTooltips = self.gconf.get( "bool", "/apps/panel/global/tooltips_enabled", True ) + self.startWithFavorites = self.gconf.get( "bool", "start_with_favorites", False ) + + def SetupMintMenuBorder( self ): + if self.usecustomcolor: + self.window.modify_bg( gtk.STATE_NORMAL, gtk.gdk.color_parse( self.custombordercolor ) ) + else: + self.window.modify_bg( gtk.STATE_NORMAL, self.window.rc_get_style().bg[ gtk.STATE_SELECTED ] ) + self.border.set_padding( self.borderwidth, self.borderwidth, self.borderwidth, self.borderwidth ) + + def SetupMintMenuOpacity( self ): + print "Opacity is: " + str(self.opacity) + opacity = float(self.opacity) / float(100) + print "Setting opacity to: " + str(opacity) + self.window.set_opacity(opacity) + + def PopulatePlugins( self ): + self.panesToColor = [ ] + self.headingsToColor = [ ] + start = time.time() + PluginPane = gtk.EventBox() + PluginPane.show() + PaneLadder = gtk.VBox( False, 0 ) + PluginPane.add( PaneLadder ) + self.SetPaneColors( [ PluginPane ] ) + ImageBox = gtk.EventBox() + self.SetPaneColors( [ ImageBox ] ) + ImageBox.show() + + seperatorImage = gtk.gdk.pixbuf_new_from_file( self.dottedfile ) + + self.plugins = {} + + for plugin in self.pluginlist: + if plugin in self.plugins: + print u"Duplicate plugin in list: ", plugin + continue + + if plugin != "newpane": + try: + X = __import__( plugin ) + # If no parameter passed to plugin it is autonomous + if X.pluginclass.__init__.func_code.co_argcount == 1: + MyPlugin = X.pluginclass() + else: + # pass mintMenu and togglebutton instance so that the plugin can use it + MyPlugin = X.pluginclass( self, self.toggle ) + + if not MyPlugin.icon: + MyPlugin.icon = "gnome-logo-icon.png" + + #if hasattr( MyPlugin, "hideseparator" ) and not MyPlugin.hideseparator: + # Image1 = gtk.Image() + # Image1.set_from_pixbuf( seperatorImage ) + # if not ImageBox.get_child(): + # ImageBox.add( Image1 ) + # Image1.show() + + #print u"Loading plugin '" + plugin + "' : sucessful" + except Exception, e: + MyPlugin = gtk.EventBox() #Fake class for MyPlugin + MyPlugin.heading = _("Couldn't load plugin:") + " " + plugin + MyPlugin.content_holder = gtk.EventBox() + + # create traceback + info = sys.exc_info() + + errorLabel = gtk.Label( "\n".join(traceback.format_exception( info[0], info[1], info[2] )).replace("\\n", "\n") ) + errorLabel.set_selectable( True ) + errorLabel.set_line_wrap( True ) + errorLabel.set_alignment( 0.0, 0.0 ) + errorLabel.set_padding( 5, 5 ) + errorLabel.show() + + MyPlugin.content_holder.add( errorLabel ) + MyPlugin.add( MyPlugin.content_holder ) + MyPlugin.width = 270 + MyPlugin.icon = 'gnome-logo-icon.png' + print u"Unable to load " + plugin + " plugin :-(" + + + self.SetPaneColors( [MyPlugin.content_holder] ) + + + MyPlugin.content_holder.show() + + VBox1 = gtk.VBox( False, 0 ) + if MyPlugin.heading != "": + Label1 = gtk.Label( MyPlugin.heading ) + Align1 = gtk.Alignment( 0, 0, 0, 0 ) + Align1.set_padding( 10, 5, 10, 0 ) + Align1.add( Label1 ) + self.SetHeadingStyle( [Label1] ) + Align1.show() + Label1.show() + + if not hasattr( MyPlugin, 'sticky' ) or MyPlugin.sticky == True: + heading = gtk.EventBox() + Align1.set_padding( 0, 0, 10, 0 ) + self.SetPaneColors( [heading] ) + heading.set_size_request( MyPlugin.width, 30 ) + else: + heading = gtk.HBox() + #heading.set_relief( gtk.RELIEF_NONE ) + heading.set_size_request( MyPlugin.width, -1 ) + #heading.set_sensitive(False) + #heading.connect( "button_press_event", self.TogglePluginView, VBox1, MyPlugin.icon, MyPlugin.heading, MyPlugin ) + + heading.add( Align1 ) + heading.show() + VBox1.pack_start( heading, False ) + VBox1.show() + MyPlugin.container = VBox1 + #Add plugin to Plugin Box under heading button + MyPlugin.content_holder.reparent( VBox1 ) + + #Add plugin to main window + PaneLadder.pack_start( VBox1 ) + PaneLadder.show() + + if MyPlugin.window: + MyPlugin.window.destroy() + + try: + if hasattr( MyPlugin, 'do_plugin' ): + MyPlugin.do_plugin() + if hasattr( MyPlugin, 'height' ): + MyPlugin.content_holder.set_size_request( -1, MyPlugin.height ) + if hasattr( MyPlugin, 'itemstocolor' ): + self.SetPaneColors( MyPlugin.itemstocolor ) + if hasattr( MyPlugin, 'minimized' ) and MyPlugin.minimized: + self.HidePlugin( MyPlugin.container, MyPlugin.icon, MyPlugin.heading, MyPlugin ) + except: + # create traceback + info = sys.exc_info() + + error = _("Couldn't initialize plugin") + " " + plugin + " : " + "\n".join(traceback.format_exception( info[0], info[1], info[2] )).replace("\\n", "\n") + msgDlg = gtk.MessageDialog( None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, error ) + msgDlg.run(); + msgDlg.destroy(); + + self.plugins[plugin] = MyPlugin + + else: + self.paneholder.pack_start( ImageBox, False, False, 0 ) + self.paneholder.pack_start( PluginPane, False, False, 0 ) + PluginPane = gtk.EventBox() + PaneLadder = gtk.VBox( False, 0 ) + PluginPane.add( PaneLadder ) + self.SetPaneColors( [PluginPane] ) + ImageBox = gtk.EventBox() + self.SetPaneColors( [ImageBox] ) + ImageBox.show() + PluginPane.show_all() + + if self.plugins and hasattr( MyPlugin, 'hideseparator' ) and not MyPlugin.hideseparator: + Image1 = gtk.Image() + Image1.set_from_pixbuf( seperatorImage ) + Image1.show() + #ImageBox.add( Image1 ) + + Align1 = gtk.Alignment() + Align1.set_padding( 0, 0, 6, 6 ) + Align1.add(Image1) + ImageBox.add(Align1) + ImageBox.show_all() + + + self.paneholder.pack_start( ImageBox, False, False, 0 ) + self.paneholder.pack_start( PluginPane, False, False, 0 ) + self.tooltips.disable() + + #print u"Loading", (time.time() - start), "s" + + def SetPaneColors( self, items ): + for item in items: + if item not in self.panesToColor: + self.panesToColor.append( item ) + + if self.usecustomcolor: + for item in items: + item.modify_bg( gtk.STATE_NORMAL, gtk.gdk.color_parse( self.customcolor ) ) + else: + for item in items: + item.modify_bg( gtk.STATE_NORMAL, self.paneholder.rc_get_style().bg[ gtk.STATE_NORMAL ] ) + + + def SetHeadingStyle( self, items ): + for item in items: + if item not in self.headingsToColor: + self.headingsToColor.append( item ) + + HeadingStyle = pango.AttrList() + attr = pango.AttrSize( 12000, 0, -1 ) + HeadingStyle.insert( attr ) + + if self.usecustomcolor: + headingcolor = gtk.gdk.color_parse( self.customheadingcolor ) + attr = pango.AttrForeground( headingcolor.red, headingcolor.green, headingcolor.blue, 0, -1 ) + HeadingStyle.insert( attr ) +# else: +# headingcolor = self.window.rc_get_style().bg[ gtk.STATE_SELECTED ] + + attr = pango.AttrWeight( pango.WEIGHT_BOLD, 0, -1 ) + HeadingStyle.insert( attr ) + + for item in items: + item.set_attributes( HeadingStyle ) + + def setTooltip( self, widget, tip, tipPrivate = None ): + self.tooltips.set_tip( widget, tip, tipPrivate ) + + def RegenPlugins( self, *args, **kargs ): + #print + #print u"Reloading Plugins..." + for item in self.paneholder: + item.destroy() + + for plugin in self.plugins.values(): + if hasattr( plugin, "destroy" ): + plugin.destroy() + + try: + del plugin + except: + pass + + try: + del self.plugins + except: + pass + + gc.collect() + + self.getSetGconfEntries() + self.PopulatePlugins() + + #print NAME+u" reloaded" + + + def show( self ): + self.window.present() + + if ( "applications" in self.plugins ) and ( hasattr( self.plugins["applications"], "focusSearchEntry" ) ): + if (self.startWithFavorites): + self.plugins["applications"].changeTab(0) + self.plugins["applications"].focusSearchEntry() + + def grab( self ): + gtk.gdk.pointer_grab( self.window.window, True, gtk.gdk.BUTTON_PRESS_MASK ) + gtk.gdk.keyboard_grab( self.window.window, False ) + self.window.grab_add() + + def ungrab( self ): + self.window.grab_remove() + self.window.hide() + gtk.gdk.pointer_ungrab() + gtk.gdk.keyboard_ungrab() + + def onMap( self, widget, event ): + self.grab() + + def onShow( self, widget ): + for plugin in self.plugins.values(): + if hasattr( plugin, "onShowMenu" ): + plugin.onShowMenu() + + def onUnmap( self, widget, event ): + self.ungrab() + + for plugin in self.plugins.values(): + if hasattr( plugin, "onHideMenu" ): + plugin.onHideMenu() + + def onKeyPress( self, widget, event ): + if event.keyval == gtk.keysyms.Escape or event.keyval == gtk.keysyms.Super_L: + self.hide() + return False + + def onButtonPress( self, widget, event ): + # Check if the pointer is within the menu, else hide the menu + winatptr = gtk.gdk.window_at_pointer() + + if winatptr: + win = winatptr[0] + while win: + if win == self.window.window: + break + win = win.get_parent() + if not win: + self.hide( True ) + else: + self.hide( True ) + + return True + + def onGrabBroken( self, widget, event ): + if event.grab_window: + try: + theft = event.grab_window.get_user_data() + theft.connect( "event", self.onGrabTheftEvent ) + except: + self.window.hide( True ) + + def onGrabTheftEvent( self, widget, event ): + if event.type == gtk.gdk.UNMAP or event.type == gtk.gdk.SELECTION_CLEAR: + self.grab() + + def hide( self, forceHide = False ): + if forceHide: + self.window.hide() class MenuWin( object ): - def __init__( self, applet, iid ): - self.applet = applet + def __init__( self, applet, iid ): + self.applet = applet - self.gconf = EasyGConf( "/apps/mintMenu/" ) - self.gconf.notifyAdd( "applet_text", self.gconfEntriesChanged ) - self.gconf.notifyAdd( "hot_key", self.gconfEntriesChanged ) - self.gconf.notifyAdd( "applet_icon", self.gconfEntriesChanged ) - self.gconf.notifyAdd( "hide_applet_icon", self.gconfEntriesChanged ) - self.gconf.notifyAdd( "applet_icon_size", self.gconfEntriesChanged ) - self.getGconfEntries() + self.gconf = EasyGConf( "/apps/mintMenu/" ) + self.gconf.notifyAdd( "applet_text", self.gconfEntriesChanged ) + self.gconf.notifyAdd( "hot_key", self.gconfEntriesChanged ) + self.gconf.notifyAdd( "applet_icon", self.gconfEntriesChanged ) + self.gconf.notifyAdd( "hide_applet_icon", self.gconfEntriesChanged ) + self.gconf.notifyAdd( "applet_icon_size", self.gconfEntriesChanged ) + self.getGconfEntries() - - self.createPanelButton() - - self.applet.set_applet_flags( gnomeapplet.EXPAND_MINOR ) - self.applet.connect( "button-press-event", self.showMenu ) - self.applet.connect( "change-orient", self.changeOrientation ) - self.applet.connect( "change-background", self.changeBackground ) - self.applet.connect("enter-notify-event", self.enter_notify) - self.applet.connect("leave-notify-event", self.leave_notify) - self.mainwin = MainWindow( self.button_box ) - self.mainwin.window.connect( "map-event", lambda *args: self.applet.set_state( gtk.STATE_SELECTED ) ) - self.mainwin.window.connect( "unmap-event", lambda *args: self.applet.set_state( gtk.STATE_NORMAL ) ) - self.mainwin.window.connect( "size-allocate", lambda *args: self.positionMenu() ) - icon = iconManager.getIcon( self.mainwin.icon, 1 ) - if icon: - gtk.window_set_default_icon( icon ) + self.createPanelButton() - self.propxml = """ - - - - - - - """ % ( _("Preferences"), _("Edit menu"), _("Reload plugins"), _("About") ) - self.verbs = [ ("Preferences", self.showPreferences), ("Edit", self.showMenuEditor), ("About", self.showAboutDialog), ("Reload",self.mainwin.RegenPlugins) ] - self.bind_hot_key() + self.applet.set_applet_flags( gnomeapplet.EXPAND_MINOR ) + self.applet.connect( "button-press-event", self.showMenu ) + self.applet.connect( "change-orient", self.changeOrientation ) + self.applet.connect( "change-background", self.changeBackground ) + self.applet.connect("enter-notify-event", self.enter_notify) + self.applet.connect("leave-notify-event", self.leave_notify) + self.mainwin = MainWindow( self.button_box ) + self.mainwin.window.connect( "map-event", lambda *args: self.applet.set_state( gtk.STATE_SELECTED ) ) + self.mainwin.window.connect( "unmap-event", lambda *args: self.applet.set_state( gtk.STATE_NORMAL ) ) + self.mainwin.window.connect( "size-allocate", lambda *args: self.positionMenu() ) - def onBindingPress(self): - try: - if self.mainwin.window.flags() & gtk.VISIBLE: - self.mainwin.window.hide() - self.mainwin.toggle.set_active(False) - else: - MenuWin.showMenu(self,self.mainwin.toggle) - self.mainwin.window.show() - #self.mainwin.wTree.get_widget( 'PluginTabs' ).set_curremenu_editor = SetGconf( self.client, "string", "/apps/usp/menu_editor", "alacarte" ) - except Exception, cause: - print cause + icon = iconManager.getIcon( self.mainwin.icon, 1 ) + if icon: + gtk.window_set_default_icon( icon ) - def enter_notify(self, applet, event): - self.do_image(self.buttonIcon, True) + self.propxml = """ + + + + + + + """ % ( _("Preferences"), _("Edit menu"), _("Reload plugins"), _("About") ) + self.verbs = [ ("Preferences", self.showPreferences), ("Edit", self.showMenuEditor), ("About", self.showAboutDialog), ("Reload",self.mainwin.RegenPlugins) ] + self.bind_hot_key() - def leave_notify(self, applet, event): - self.do_image(self.buttonIcon, False) + def onBindingPress(self): + try: + if self.mainwin.window.flags() & gtk.VISIBLE: + self.mainwin.window.hide() + self.mainwin.toggle.set_active(False) + else: + MenuWin.showMenu(self,self.mainwin.toggle) + self.mainwin.window.show() + #self.mainwin.wTree.get_widget( 'PluginTabs' ).set_curremenu_editor = SetGconf( self.client, "string", "/apps/usp/menu_editor", "alacarte" ) + except Exception, cause: + print cause - def do_image(self, image_file, saturate): - pixbuf = gtk.gdk.pixbuf_new_from_file(image_file) - if saturate: - gtk.gdk.Pixbuf.saturate_and_pixelate(pixbuf, pixbuf, 1.5, False) - self.button_icon.set_from_pixbuf(pixbuf) + def enter_notify(self, applet, event): + self.do_image(self.buttonIcon, True) - def createPanelButton( self ): - self.button_icon = gtk.image_new_from_file( self.buttonIcon ) - self.systemlabel = gtk.Label( self.buttonText ) - if os.path.exists("/etc/linuxmint/info"): - import commands - tooltip = commands.getoutput("cat /etc/linuxmint/info | grep DESCRIPTION") - tooltip = tooltip.replace("DESCRIPTION", "") - tooltip = tooltip.replace("=", "") - tooltip = tooltip.replace("\"", "") - self.systemlabel.set_tooltip_text(tooltip) - self.button_icon.set_tooltip_text(tooltip) + def leave_notify(self, applet, event): + self.do_image(self.buttonIcon, False) - if self.applet.get_orient() == gnomeapplet.ORIENT_UP or self.applet.get_orient() == gnomeapplet.ORIENT_DOWN: - self.button_box = gtk.HBox() - self.button_box.pack_start( self.button_icon, False, False ) - self.button_box.pack_start( self.systemlabel, False, False ) - - self.button_icon.set_padding( 5, 0 ) - # if we have a vertical panel - elif self.applet.get_orient() == gnomeapplet.ORIENT_LEFT: - self.button_box = gtk.VBox() - self.systemlabel.set_angle( 270 ) - self.button_box.pack_start( self.systemlabel ) - self.button_box.pack_start( self.button_icon ) - self.button_icon.set_padding( 5, 0 ) - elif self.applet.get_orient() == gnomeapplet.ORIENT_RIGHT: - self.button_box = gtk.VBox() - self.systemlabel.set_angle( 90 ) - self.button_box.pack_start( self.button_icon ) - self.button_box.pack_start( self.systemlabel ) - self.button_icon.set_padding( 0, 5 ) - - self.button_box.set_homogeneous( False ) - self.button_box.show_all() - self.sizeButton() + def do_image(self, image_file, saturate): + pixbuf = gtk.gdk.pixbuf_new_from_file(image_file) + if saturate: + gtk.gdk.Pixbuf.saturate_and_pixelate(pixbuf, pixbuf, 1.5, False) + self.button_icon.set_from_pixbuf(pixbuf) - self.applet.add( self.button_box ) + def createPanelButton( self ): + self.button_icon = gtk.image_new_from_file( self.buttonIcon ) + self.systemlabel = gtk.Label( self.buttonText ) + if os.path.exists("/etc/linuxmint/info"): + import commands + tooltip = commands.getoutput("cat /etc/linuxmint/info | grep DESCRIPTION") + tooltip = tooltip.replace("DESCRIPTION", "") + tooltip = tooltip.replace("=", "") + tooltip = tooltip.replace("\"", "") + self.systemlabel.set_tooltip_text(tooltip) + self.button_icon.set_tooltip_text(tooltip) + + if self.applet.get_orient() == gnomeapplet.ORIENT_UP or self.applet.get_orient() == gnomeapplet.ORIENT_DOWN: + self.button_box = gtk.HBox() + self.button_box.pack_start( self.button_icon, False, False ) + self.button_box.pack_start( self.systemlabel, False, False ) + + self.button_icon.set_padding( 5, 0 ) + # if we have a vertical panel + elif self.applet.get_orient() == gnomeapplet.ORIENT_LEFT: + self.button_box = gtk.VBox() + self.systemlabel.set_angle( 270 ) + self.button_box.pack_start( self.systemlabel ) + self.button_box.pack_start( self.button_icon ) + self.button_icon.set_padding( 5, 0 ) + elif self.applet.get_orient() == gnomeapplet.ORIENT_RIGHT: + self.button_box = gtk.VBox() + self.systemlabel.set_angle( 90 ) + self.button_box.pack_start( self.button_icon ) + self.button_box.pack_start( self.systemlabel ) + self.button_icon.set_padding( 0, 5 ) + + self.button_box.set_homogeneous( False ) + self.button_box.show_all() + self.sizeButton() + + self.applet.add( self.button_box ) - def getGconfEntries( self, *args, **kargs ): - self.hideIcon = self.gconf.get( "bool", "hide_applet_icon", False ) - self.buttonText = self.gconf.get( "string", "applet_text", "Menu" ) - self.hotkeyText = self.gconf.get( "string", "hot_key", "Super_L" ) - self.buttonIcon = self.gconf.get( "string", "applet_icon", ICON ) - self.setIconSize( self.gconf.get( "int", "applet_icon_size", 2 ) ) + def getGconfEntries( self, *args, **kargs ): + self.hideIcon = self.gconf.get( "bool", "hide_applet_icon", False ) + self.buttonText = self.gconf.get( "string", "applet_text", "Menu" ) + self.hotkeyText = self.gconf.get( "string", "hot_key", "Super_L" ) + self.buttonIcon = self.gconf.get( "string", "applet_icon", ICON ) + self.setIconSize( self.gconf.get( "int", "applet_icon_size", 2 ) ) - def setIconSize( self, icon_size): - if icon_size >= 4: - self.iconSize = gtk.ICON_SIZE_DIALOG - elif icon_size == 3: - self.iconSize = gtk.ICON_SIZE_DND - elif icon_size == 2: - self.iconSize = gtk.ICON_SIZE_BUTTON - else: - self.iconSize = gtk.ICON_SIZE_MENU + def setIconSize( self, icon_size): + if icon_size >= 4: + self.iconSize = gtk.ICON_SIZE_DIALOG + elif icon_size == 3: + self.iconSize = gtk.ICON_SIZE_DND + elif icon_size == 2: + self.iconSize = gtk.ICON_SIZE_BUTTON + else: + self.iconSize = gtk.ICON_SIZE_MENU - def changeBackground( self, applet, type, color, pixmap ): - # get reset style - self.applet.set_style(None) - rc_style = gtk.RcStyle() - self.applet.modify_style(rc_style) + def changeBackground( self, applet, type, color, pixmap ): + # get reset style + self.applet.set_style(None) + rc_style = gtk.RcStyle() + self.applet.modify_style(rc_style) - if gnomeapplet.COLOR_BACKGROUND == type: - applet.modify_bg( gtk.STATE_NORMAL, color ) - elif gnomeapplet.PIXMAP_BACKGROUND == type: - style = applet.style - style.bg_pixmap[ gtk.STATE_NORMAL ] = pixmap - applet.set_style( style ) + if gnomeapplet.COLOR_BACKGROUND == type: + applet.modify_bg( gtk.STATE_NORMAL, color ) + elif gnomeapplet.PIXMAP_BACKGROUND == type: + style = applet.style + style.bg_pixmap[ gtk.STATE_NORMAL ] = pixmap + applet.set_style( style ) - def changeOrientation( self, *args, **kargs ): + def changeOrientation( self, *args, **kargs ): - if self.applet.get_orient() == gnomeapplet.ORIENT_UP or self.applet.get_orient() == gnomeapplet.ORIENT_DOWN: - tmpbox = gtk.HBox() - self.systemlabel.set_angle( 0 ) - self.button_box.reorder_child( self.button_icon, 0 ) - self.button_icon.set_padding( 5, 0 ) - elif self.applet.get_orient() == gnomeapplet.ORIENT_LEFT: - tmpbox = gtk.VBox() - self.systemlabel.set_angle( 270 ) - self.button_box.reorder_child( self.button_icon, 1 ) - self.button_icon.set_padding( 0, 5 ) - elif self.applet.get_orient() == gnomeapplet.ORIENT_RIGHT: - tmpbox = gtk.VBox() - self.systemlabel.set_angle( 90 ) - self.button_box.reorder_child( self.button_icon, 0 ) - self.button_icon.set_padding( 0, 5 ) + if self.applet.get_orient() == gnomeapplet.ORIENT_UP or self.applet.get_orient() == gnomeapplet.ORIENT_DOWN: + tmpbox = gtk.HBox() + self.systemlabel.set_angle( 0 ) + self.button_box.reorder_child( self.button_icon, 0 ) + self.button_icon.set_padding( 5, 0 ) + elif self.applet.get_orient() == gnomeapplet.ORIENT_LEFT: + tmpbox = gtk.VBox() + self.systemlabel.set_angle( 270 ) + self.button_box.reorder_child( self.button_icon, 1 ) + self.button_icon.set_padding( 0, 5 ) + elif self.applet.get_orient() == gnomeapplet.ORIENT_RIGHT: + tmpbox = gtk.VBox() + self.systemlabel.set_angle( 90 ) + self.button_box.reorder_child( self.button_icon, 0 ) + self.button_icon.set_padding( 0, 5 ) - tmpbox.set_homogeneous( False ) - - # reparent all the hboxes to the new tmpbox - for i in self.button_box: - i.reparent( tmpbox ) + tmpbox.set_homogeneous( False ) - self.button_box.destroy() - - self.button_box = tmpbox - self.button_box.show() + # reparent all the hboxes to the new tmpbox + for i in self.button_box: + i.reparent( tmpbox ) - # this call makes sure width stays intact - self.updateButton() - self.applet.add( self.button_box ) + self.button_box.destroy() + + self.button_box = tmpbox + self.button_box.show() + + # this call makes sure width stays intact + self.updateButton() + self.applet.add( self.button_box ) - def updateButton( self ): - self.systemlabel.set_text( self.buttonText ) - self.button_icon.clear() - self.button_icon.set_from_file( self.buttonIcon ) - self.sizeButton() + def updateButton( self ): + self.systemlabel.set_text( self.buttonText ) + self.button_icon.clear() + self.button_icon.set_from_file( self.buttonIcon ) + self.sizeButton() - def bind_hot_key (self): - try: - # Binding menu to hotkey - print "Binding to Hot Key: " + self.hotkeyText - bind_key( self.hotkeyText, self.onBindingPress ) - except Exception, cause: - print "** WARNING ** - Menu Hotkey Binding Error" - print "Error Report :\n", str(cause) - pass + def bind_hot_key (self): + try: + # Binding menu to hotkey + print "Binding to Hot Key: " + self.hotkeyText + bind_key( self.hotkeyText, self.onBindingPress ) + except Exception, cause: + print "** WARNING ** - Menu Hotkey Binding Error" + print "Error Report :\n", str(cause) + pass - def sizeButton( self ): - if self.hideIcon: - self.button_icon.hide() - else: - self.button_icon.show() - # This code calculates width and height for the button_box - # and takes the orientation in account - if self.applet.get_orient() == gnomeapplet.ORIENT_UP or self.applet.get_orient() == gnomeapplet.ORIENT_DOWN: - if self.hideIcon: - self.applet.set_size_request( self.systemlabel.size_request()[0] + 2, -1 ) - else: - self.applet.set_size_request( self.systemlabel.size_request()[0] + self.button_icon.size_request()[0] + 5, self.button_icon.size_request()[1] ) - else: - if self.hideIcon: - self.applet.set_size_request( self.button_icon.size_request()[0], self.systemlabel.size_request()[1] + 2 ) - else: - self.applet.set_size_request( self.button_icon.size_request()[0], self.systemlabel.size_request()[1] + self.button_icon.size_request()[1] + 5 ) + def sizeButton( self ): + if self.hideIcon: + self.button_icon.hide() + else: + self.button_icon.show() + # This code calculates width and height for the button_box + # and takes the orientation in account + if self.applet.get_orient() == gnomeapplet.ORIENT_UP or self.applet.get_orient() == gnomeapplet.ORIENT_DOWN: + if self.hideIcon: + self.applet.set_size_request( self.systemlabel.size_request()[0] + 2, -1 ) + else: + self.applet.set_size_request( self.systemlabel.size_request()[0] + self.button_icon.size_request()[0] + 5, self.button_icon.size_request()[1] ) + else: + if self.hideIcon: + self.applet.set_size_request( self.button_icon.size_request()[0], self.systemlabel.size_request()[1] + 2 ) + else: + self.applet.set_size_request( self.button_icon.size_request()[0], self.systemlabel.size_request()[1] + self.button_icon.size_request()[1] + 5 ) - def gconfEntriesChanged( self, *args ): - self.getGconfEntries() - self.updateButton() + def gconfEntriesChanged( self, *args ): + self.getGconfEntries() + self.updateButton() - def showAboutDialog( self, uicomponent, verb ): + def showAboutDialog( self, uicomponent, verb ): - gtk.about_dialog_set_email_hook( lambda dialog, mail: gnomevfs.url_show( "mailto:" + mail ) ) - gtk.about_dialog_set_url_hook( lambda dialog, url: gnomevfs.url_show( url ) ) - about = gtk.AboutDialog() - about.set_name("mintMenu") - import commands - version = commands.getoutput("/usr/lib/linuxmint/common/version.py mintmenu") - about.set_version(version) - try: - h = open('/usr/share/common-licenses/GPL','r') - s = h.readlines() - gpl = "" - for line in s: - gpl += line - h.close() - about.set_license(gpl) - except Exception, detail: - print detail - about.set_comments( _("Advanced Gnome Menu") ) - about.set_authors( ["Clement Lefebvre ", "Lars-Peter Clausen "] ) - about.set_translator_credits(("translator-credits") ) - about.set_copyright( _("Based on USP from S.Chanderbally") ) - about.set_logo( gtk.gdk.pixbuf_new_from_file("/usr/lib/linuxmint/mintMenu/icon.svg") ) - about.connect( "response", lambda dialog, r: dialog.destroy() ) - about.show() + gtk.about_dialog_set_email_hook( lambda dialog, mail: gnomevfs.url_show( "mailto:" + mail ) ) + gtk.about_dialog_set_url_hook( lambda dialog, url: gnomevfs.url_show( url ) ) + about = gtk.AboutDialog() + about.set_name("mintMenu") + import commands + version = commands.getoutput("/usr/lib/linuxmint/common/version.py mintmenu") + about.set_version(version) + try: + h = open('/usr/share/common-licenses/GPL','r') + s = h.readlines() + gpl = "" + for line in s: + gpl += line + h.close() + about.set_license(gpl) + except Exception, detail: + print detail + about.set_comments( _("Advanced Gnome Menu") ) + about.set_authors( ["Clement Lefebvre ", "Lars-Peter Clausen "] ) + about.set_translator_credits(("translator-credits") ) + about.set_copyright( _("Based on USP from S.Chanderbally") ) + about.set_logo( gtk.gdk.pixbuf_new_from_file("/usr/lib/linuxmint/mintMenu/icon.svg") ) + about.connect( "response", lambda dialog, r: dialog.destroy() ) + about.show() - def showPreferences( self, uicomponent, verb ): -# Execute( "gconf-editor /apps/mintMenu" ) - Execute( os.path.join( PATH, "mintMenuConfig.py" ) ) + def showPreferences( self, uicomponent, verb ): +# Execute( "gconf-editor /apps/mintMenu" ) + Execute( os.path.join( PATH, "mintMenuConfig.py" ) ) - def showMenuEditor( self, uicomponent, verb ): - Execute( "alacarte" ) + def showMenuEditor( self, uicomponent, verb ): + Execute( "alacarte" ) - def showMenu( self, widget=None, event=None ): - if event == None or event.button == 1: - self.toggleMenu() - # show right click menu - elif event.button == 3: - self.create_menu() - # allow middle click and drag - elif event.button == 2: - self.mainwin.hide( True ) + def showMenu( self, widget=None, event=None ): + if event == None or event.button == 1: + self.toggleMenu() + # show right click menu + elif event.button == 3: + self.create_menu() + # allow middle click and drag + elif event.button == 2: + self.mainwin.hide( True ) - def toggleMenu( self ): - if self.applet.state & gtk.STATE_SELECTED: - self.mainwin.hide( True ) - else: - self.positionMenu() - self.mainwin.show() - self.wakePlugins() + def toggleMenu( self ): + if self.applet.state & gtk.STATE_SELECTED: + self.mainwin.hide( True ) + else: + self.positionMenu() + self.mainwin.show() + self.wakePlugins() - def wakePlugins( self ): - self.mainwin.wakePlugins() + def wakePlugins( self ): + self.mainwin.wakePlugins() - def positionMenu( self ): - # Get our own dimensions & position - ourWidth = self.mainwin.window.get_size()[0] - ourHeight = self.mainwin.window.get_size()[1] + self.mainwin.offset + def positionMenu( self ): + # Get our own dimensions & position + ourWidth = self.mainwin.window.get_size()[0] + ourHeight = self.mainwin.window.get_size()[1] + self.mainwin.offset - # Get the dimensions/position of the widgetToAlignWith - entryX, entryY = self.applet.window.get_origin() - entryWidth, entryHeight = self.applet.get_allocation().width, self.applet.get_allocation().height - entryHeight = entryHeight + self.mainwin.offset + # Get the dimensions/position of the widgetToAlignWith + entryX, entryY = self.applet.window.get_origin() + entryWidth, entryHeight = self.applet.get_allocation().width, self.applet.get_allocation().height + entryHeight = entryHeight + self.mainwin.offset - # Get the screen dimensions - screenHeight = gtk.gdk.screen_height() - screenWidth = gtk.gdk.screen_width() + # Get the screen dimensions + screenHeight = gtk.gdk.screen_height() + screenWidth = gtk.gdk.screen_width() - if self.applet.get_orient() == gnomeapplet.ORIENT_UP or self.applet.get_orient() == gnomeapplet.ORIENT_DOWN: - if entryX + ourWidth < screenWidth or entryX + entryWidth / 2 < screenWidth / 2: - # Align to the left of the entry - newX = entryX - else: - # Align to the right of the entry - newX = entryX + entryWidth - ourWidth - - if entryY + entryHeight / 2 < screenHeight / 2: - # Align to the bottom of the entry - newY = entryY + entryHeight - else: - newY = entryY - ourHeight - else: - if entryX + entryWidth / 2 < screenWidth / 2: - # Align to the left of the entry - newX = entryX + entryWidth - else: - # Align to the right of the entry - newX = entryX - ourWidth - - if entryY + ourHeight < screenHeight or entryY + entryHeight / 2 < screenHeight / 2: - # Align to the bottom of the entry - newY = entryY - else: - newY = entryY - ourHeight + entryHeight - # -"Move window" - self.mainwin.window.move( newX, newY ) + if self.applet.get_orient() == gnomeapplet.ORIENT_UP or self.applet.get_orient() == gnomeapplet.ORIENT_DOWN: + if entryX + ourWidth < screenWidth or entryX + entryWidth / 2 < screenWidth / 2: + # Align to the left of the entry + newX = entryX + else: + # Align to the right of the entry + newX = entryX + entryWidth - ourWidth - # this callback is to create a context menu - def create_menu(self): - self.applet.setup_menu(self.propxml, self.verbs, None) + if entryY + entryHeight / 2 < screenHeight / 2: + # Align to the bottom of the entry + newY = entryY + entryHeight + else: + newY = entryY - ourHeight + else: + if entryX + entryWidth / 2 < screenWidth / 2: + # Align to the left of the entry + newX = entryX + entryWidth + else: + # Align to the right of the entry + newX = entryX - ourWidth + + if entryY + ourHeight < screenHeight or entryY + entryHeight / 2 < screenHeight / 2: + # Align to the bottom of the entry + newY = entryY + else: + newY = entryY - ourHeight + entryHeight + # -"Move window" + self.mainwin.window.move( newX, newY ) + + # this callback is to create a context menu + def create_menu(self): + self.applet.setup_menu(self.propxml, self.verbs, None) def menu_factory( applet, iid ): - MenuWin( applet, iid ) - applet.show() - return True + MenuWin( applet, iid ) + applet.show() + return True def quit_all(widget): - gtk.main_quit() - sys.exit(0) + gtk.main_quit() + sys.exit(0) if len(sys.argv) == 2 and sys.argv[1] == "run-in-window": - gtk.gdk.threads_init() - main_window = gtk.Window( gtk.WINDOW_TOPLEVEL ) - main_window.set_title( NAME ) - main_window.connect( "destroy", quit_all ) - app = gnomeapplet.Applet() - menu_factory( app, None ) - app.reparent( main_window ) - main_window.show() - gtk.gdk.threads_enter() - gtk.main() - gtk.gdk.threads_leave() + gtk.gdk.threads_init() + main_window = gtk.Window( gtk.WINDOW_TOPLEVEL ) + main_window.set_title( NAME ) + main_window.connect( "destroy", quit_all ) + app = gnomeapplet.Applet() + menu_factory( app, None ) + app.reparent( main_window ) + main_window.show() + gtk.gdk.threads_enter() + gtk.main() + gtk.gdk.threads_leave() else: - gnomeapplet.bonobo_factory("OAFIID:GNOME_mintMenu_Factory", - gnomeapplet.Applet.__gtype__, - "mintMenu", "0", menu_factory) - - + gnomeapplet.bonobo_factory("OAFIID:GNOME_mintMenu_Factory", + gnomeapplet.Applet.__gtype__, + "mintMenu", "0", menu_factory) diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade index 945c297..f60e15e 100644 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade @@ -11,7 +11,6 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - vertical True @@ -221,7 +220,6 @@ True - vertical 5 @@ -238,8 +236,8 @@ - - Show sidepane + + Show applications plugin True True False @@ -253,8 +251,8 @@ - - Show recent documents + + Show system plugin True True False @@ -267,6 +265,36 @@ 2 + + + Show places plugin + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + + + False + False + 3 + + + + + Show recent documents plugin + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + + + False + False + 4 + + True @@ -346,7 +374,7 @@ False - 3 + 5 @@ -372,7 +400,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Options + Plugins 1 @@ -600,7 +628,6 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - vertical Use custom colors @@ -887,7 +914,6 @@ True - vertical Allow Scrollbar @@ -963,7 +989,6 @@ True - vertical Computer @@ -1081,11 +1106,9 @@ True - vertical True - vertical 5 @@ -1126,7 +1149,6 @@ True - vertical gtk-go-up @@ -1257,7 +1279,6 @@ True - vertical Allow Scrollbar @@ -1331,7 +1352,6 @@ True - vertical Software Manager @@ -1518,7 +1538,6 @@ True - vertical 2 @@ -1663,7 +1682,6 @@ True - vertical 2 diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py index 92dc1d5..22b8af8 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py @@ -3,19 +3,19 @@ import sys try: - import pygtk - pygtk.require( "2.0" ) + import pygtk + pygtk.require( "2.0" ) except: - pass + pass try: - import gtk - import gtk.glade - import gettext - import os - import commands + import gtk + import gtk.glade + import gettext + import os + import commands except Exception, e: - print e - sys.exit( 1 ) + print e + sys.exit( 1 ) PATH = os.path.abspath( os.path.dirname( sys.argv[0] ) ) @@ -28,435 +28,469 @@ from easybuttons import iconManager from easygconf import EasyGConf class mintMenuConfig( object ): - - def __init__( self ): - self.path = os.path.abspath( os.path.dirname( sys.argv[0] ) ) + def __init__( self ): - # Load glade file and extract widgets - gladefile = os.path.join( self.path, "mintMenuConfig.glade" ) - wTree = gtk.glade.XML( gladefile, "mainWindow" ) - self.mainWindow=wTree.get_widget("mainWindow") + self.path = os.path.abspath( os.path.dirname( sys.argv[0] ) ) - #i18n - self.mainWindow.set_title(_("Menu preferences")) - self.mainWindow.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg") + # Load glade file and extract widgets + gladefile = os.path.join( self.path, "mintMenuConfig.glade" ) + wTree = gtk.glade.XML( gladefile, "mainWindow" ) + self.mainWindow=wTree.get_widget("mainWindow") - wTree.get_widget("startWithFavorites").set_label(_("Always start with favorites pane")) - wTree.get_widget("showSidepane").set_label(_("Show sidepane")) - wTree.get_widget("showButtonIcon").set_label(_("Show button icon")) - wTree.get_widget("useCustomColors").set_label(_("Use custom colors")) - wTree.get_widget("showRecentPlugin").set_label(_("Show recent documents")) + #i18n + self.mainWindow.set_title(_("Menu preferences")) + self.mainWindow.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg") - wTree.get_widget("showAppComments").set_label(_("Show application comments")) - wTree.get_widget("showCategoryIcons").set_label(_("Show category icons")) - wTree.get_widget("hover").set_label(_("Hover")) - wTree.get_widget("swapGeneric").set_label(_("Swap name and generic name")) + wTree.get_widget("startWithFavorites").set_label(_("Always start with favorites pane")) + wTree.get_widget("showButtonIcon").set_label(_("Show button icon")) + wTree.get_widget("useCustomColors").set_label(_("Use custom colors")) + wTree.get_widget("showRecentPlugin").set_label(_("Show recent documents plugin")) + wTree.get_widget("showApplicationsPlugin").set_label(_("Show applications plugin")) + wTree.get_widget("showSystemPlugin").set_label(_("Show system plugin")) + wTree.get_widget("showPlacesPlugin").set_label(_("Show places plugin")) - wTree.get_widget("label11").set_text(_("Border width:")) - wTree.get_widget("label2").set_text(_("pixels")) + wTree.get_widget("showAppComments").set_label(_("Show application comments")) + wTree.get_widget("showCategoryIcons").set_label(_("Show category icons")) + wTree.get_widget("hover").set_label(_("Hover")) + wTree.get_widget("swapGeneric").set_label(_("Swap name and generic name")) - wTree.get_widget("label8").set_text(_("Opacity:")) - wTree.get_widget("label9").set_text("%") + wTree.get_widget("label11").set_text(_("Border width:")) + wTree.get_widget("label2").set_text(_("pixels")) - wTree.get_widget("buttonTextLabel").set_text(_("Button text:")) - wTree.get_widget("label1").set_text(_("Options")) - wTree.get_widget("label23").set_text(_("Applications")) + wTree.get_widget("label8").set_text(_("Opacity:")) + wTree.get_widget("label9").set_text("%") - wTree.get_widget("colorsLabel").set_text(_("Colors")) - wTree.get_widget("favLabel").set_text(_("Favorites")) - wTree.get_widget("label3").set_text(_("Main button")) - - wTree.get_widget("backgroundColorLabel").set_text(_("Background:")) - wTree.get_widget("headingColorLabel").set_text(_("Headings:")) - wTree.get_widget("borderColorLabel").set_text(_("Borders:")) - - #wTree.get_widget("applicationsLabel").set_text(_("Applications")) - #wTree.get_widget("favoritesLabel").set_text(_("Favorites")) - wTree.get_widget("numberColumnsLabel").set_text(_("Number of columns:")) - wTree.get_widget("iconSizeLabel").set_text(_("Icon size:")) - wTree.get_widget("iconSizeLabel2").set_text(_("Icon size:")) - wTree.get_widget("label44").set_text(_("Icon size:")) - wTree.get_widget("hoverLabel").set_text(_("Hover delay (ms):")) - wTree.get_widget("label4").set_text(_("Button icon:")) - wTree.get_widget("label5").set_text(_("Search command:")) + wTree.get_widget("buttonTextLabel").set_text(_("Button text:")) + wTree.get_widget("label1").set_text(_("Options")) + wTree.get_widget("label23").set_text(_("Applications")) - wTree.get_widget("placesLabel").set_text(_("Places")) - wTree.get_widget("allowscrollbarcheckbutton").set_label(_("Allow Scrollbar")) - wTree.get_widget("placesHeightEntryLabel").set_text(_("Height:")) - wTree.get_widget("defaultPlacesFrameLabel").set_text(_("Toggle Default Places:")) - wTree.get_widget("computercheckbutton").set_label(_("Computer")) - wTree.get_widget("homecheckbutton").set_label(_("Home Folder")) - wTree.get_widget("networkcheckbutton").set_label(_("Network")) - wTree.get_widget("desktopcheckbutton").set_label(_("Desktop")) - wTree.get_widget("trashcheckbutton").set_label(_("Trash")) - wTree.get_widget("customPlacesFrameLabel").set_text(_("Custom Places:")) + wTree.get_widget("colorsLabel").set_text(_("Colors")) + wTree.get_widget("favLabel").set_text(_("Favorites")) + wTree.get_widget("label3").set_text(_("Main button")) - wTree.get_widget("systemLabel").set_text(_("System")) - wTree.get_widget("allowscrollbarcheckbutton1").set_label(_("Allow Scrollbar")) - wTree.get_widget("systemHeightEntryLabel").set_text(_("Height:")) - wTree.get_widget("defaultItemsFrameLabel").set_text(_("Toggle Default Items:")) - wTree.get_widget("softwaremanagercheckbutton").set_label(_("Software Manager")) - wTree.get_widget("packagemanagercheckbutton").set_label(_("Package Manager")) - wTree.get_widget("controlcentercheckbutton").set_label(_("Control Center")) - wTree.get_widget("terminalcheckbutton").set_label(_("Terminal")) - wTree.get_widget("lockcheckbutton").set_label(_("Lock Screen")) - wTree.get_widget("logoutcheckbutton").set_label(_("Log Out")) - wTree.get_widget("quitcheckbutton").set_label(_("Quit")) + wTree.get_widget("backgroundColorLabel").set_text(_("Background:")) + wTree.get_widget("headingColorLabel").set_text(_("Headings:")) + wTree.get_widget("borderColorLabel").set_text(_("Borders:")) - self.editPlaceDialogTitle = (_("Edit Place")) - self.newPlaceDialogTitle = (_("New Place")) - self.folderChooserDialogTitle = (_("Select a folder")) + #wTree.get_widget("applicationsLabel").set_text(_("Applications")) + #wTree.get_widget("favoritesLabel").set_text(_("Favorites")) + wTree.get_widget("numberColumnsLabel").set_text(_("Number of columns:")) + wTree.get_widget("iconSizeLabel").set_text(_("Icon size:")) + wTree.get_widget("iconSizeLabel2").set_text(_("Icon size:")) + wTree.get_widget("label44").set_text(_("Icon size:")) + wTree.get_widget("hoverLabel").set_text(_("Hover delay (ms):")) + wTree.get_widget("label4").set_text(_("Button icon:")) + wTree.get_widget("label5").set_text(_("Search command:")) - wTree.get_widget("hotkey_label").set_text(_("Keyboard shortcut:")) + wTree.get_widget("placesLabel").set_text(_("Places")) + wTree.get_widget("allowscrollbarcheckbutton").set_label(_("Allow Scrollbar")) + wTree.get_widget("placesHeightEntryLabel").set_text(_("Height:")) + wTree.get_widget("defaultPlacesFrameLabel").set_text(_("Toggle Default Places:")) + wTree.get_widget("computercheckbutton").set_label(_("Computer")) + wTree.get_widget("homecheckbutton").set_label(_("Home Folder")) + wTree.get_widget("networkcheckbutton").set_label(_("Network")) + wTree.get_widget("desktopcheckbutton").set_label(_("Desktop")) + wTree.get_widget("trashcheckbutton").set_label(_("Trash")) + wTree.get_widget("customPlacesFrameLabel").set_text(_("Custom Places:")) - self.startWithFavorites = wTree.get_widget( "startWithFavorites" ) - self.showSidepane = wTree.get_widget( "showSidepane" ) - self.showAppComments = wTree.get_widget( "showAppComments" ) - self.showCategoryIcons = wTree.get_widget( "showCategoryIcons" ) - self.showRecentPlugin = wTree.get_widget( "showRecentPlugin" ) - self.swapGeneric = wTree.get_widget("swapGeneric") - self.hover = wTree.get_widget( "hover" ) - self.hoverDelay = wTree.get_widget( "hoverDelay" ) - self.bttniconSize = wTree.get_widget( "main_button_icon_size" ) - self.iconSize = wTree.get_widget( "iconSize" ) - self.favIconSize = wTree.get_widget( "favIconSize" ) - self.favCols = wTree.get_widget( "numFavCols" ) - self.borderWidth = wTree.get_widget( "borderWidth" ) - self.opacity = wTree.get_widget( "opacity" ) - self.useCustomColors = wTree.get_widget( "useCustomColors" ) - self.backgroundColor = wTree.get_widget( "backgroundColor" ) - self.borderColor = wTree.get_widget( "borderColor" ) - self.headingColor = wTree.get_widget( "headingColor" ) - self.backgroundColorLabel = wTree.get_widget( "backgroundColorLabel" ) - self.borderColorLabel = wTree.get_widget( "borderColorLabel" ) - self.headingColorLabel = wTree.get_widget( "headingColorLabel" ) - self.showButtonIcon = wTree.get_widget( "showButtonIcon" ) - self.buttonText = wTree.get_widget( "buttonText" ) - self.hotkeyText = wTree.get_widget( "hotkeyText" ) - self.buttonIcon = wTree.get_widget( "buttonIcon" ) - self.buttonIconImage = wTree.get_widget( "image_button_icon" ) - self.searchCommand = wTree.get_widget( "search_command" ) - self.computertoggle = wTree.get_widget( "computercheckbutton" ) - self.homefoldertoggle = wTree.get_widget( "homecheckbutton" ) - self.networktoggle = wTree.get_widget( "networkcheckbutton" ) - self.desktoptoggle = wTree.get_widget( "desktopcheckbutton" ) - self.trashtoggle = wTree.get_widget( "trashcheckbutton" ) - self.customplacestree = wTree.get_widget( "customplacestree" ) - self.allowPlacesScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton" ) - self.placesHeightButton = wTree.get_widget( "placesHeightSpinButton" ) - if (self.allowPlacesScrollbarToggle.get_active() == False): - self.placesHeightButton.set_sensitive(False) - self.allowPlacesScrollbarToggle.connect("toggled", self.togglePlacesHeightEnabled ) - self.softwareManagerToggle = wTree.get_widget( "softwaremanagercheckbutton" ) - self.packageManagerToggle = wTree.get_widget( "packagemanagercheckbutton" ) - self.controlCenterToggle = wTree.get_widget( "controlcentercheckbutton" ) - self.packageManagerToggle = wTree.get_widget( "packagemanagercheckbutton" ) - self.terminalToggle = wTree.get_widget( "terminalcheckbutton" ) - self.lockToggle = wTree.get_widget( "lockcheckbutton" ) - self.logoutToggle = wTree.get_widget( "logoutcheckbutton" ) - self.quitToggle = wTree.get_widget( "quitcheckbutton" ) - self.allowSystemScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton1" ) - self.systemHeightButton = wTree.get_widget( "systemHeightSpinButton" ) - if (self.allowSystemScrollbarToggle.get_active() == False): self.systemHeightButton.set_sensitive(False) - self.allowSystemScrollbarToggle.connect("toggled", self.toggleSystemHeightEnabled ) - if os.path.exists("/usr/lib/linuxmint/mintInstall/icon.svg"): - wTree.get_widget( "softwaremanagercheckbutton" ).show() - else: - wTree.get_widget( "softwaremanagercheckbutton" ).hide() + wTree.get_widget("systemLabel").set_text(_("System")) + wTree.get_widget("allowscrollbarcheckbutton1").set_label(_("Allow Scrollbar")) + wTree.get_widget("systemHeightEntryLabel").set_text(_("Height:")) + wTree.get_widget("defaultItemsFrameLabel").set_text(_("Toggle Default Items:")) + wTree.get_widget("softwaremanagercheckbutton").set_label(_("Software Manager")) + wTree.get_widget("packagemanagercheckbutton").set_label(_("Package Manager")) + wTree.get_widget("controlcentercheckbutton").set_label(_("Control Center")) + wTree.get_widget("terminalcheckbutton").set_label(_("Terminal")) + wTree.get_widget("lockcheckbutton").set_label(_("Lock Screen")) + wTree.get_widget("logoutcheckbutton").set_label(_("Log Out")) + wTree.get_widget("quitcheckbutton").set_label(_("Quit")) - wTree.get_widget( "closeButton" ).connect("clicked", gtk.main_quit ) + self.editPlaceDialogTitle = (_("Edit Place")) + self.newPlaceDialogTitle = (_("New Place")) + self.folderChooserDialogTitle = (_("Select a folder")) - - self.gconf = EasyGConf( "/apps/mintMenu/" ) - self.gconfApplications = EasyGConf( "/apps/mintMenu/plugins/applications/" ) - self.gconfPlaces = EasyGConf( "/apps/mintMenu/plugins/places/" ) - self.gconfSystem = EasyGConf( "/apps/mintMenu/plugins/system-management/" ) - - self.useCustomColors.connect( "toggled", self.toggleUseCustomColors ) - - self.bindGconfValueToWidget( self.gconf, "bool", "start_with_favorites", self.startWithFavorites, "toggled", self.startWithFavorites.set_active, self.startWithFavorites.get_active ) - self.bindGconfValueToWidget( self.gconf, "bool", "show_side_pane", self.showSidepane, "toggled", self.showSidepane.set_active, self.showSidepane.get_active ) - self.bindGconfValueToWidget( self.gconfApplications, "bool", "show_application_comments", self.showAppComments, "toggled", self.showAppComments.set_active, self.showAppComments.get_active ) - self.bindGconfValueToWidget( self.gconfApplications, "bool", "show_category_icons", self.showCategoryIcons, "toggled", self.showCategoryIcons.set_active, self.showCategoryIcons.get_active ) - self.bindGconfValueToWidget( self.gconfApplications, "bool", "categories_mouse_over", self.hover, "toggled", self.hover.set_active, self.hover.get_active ) - self.bindGconfValueToWidget( self.gconfApplications, "bool", "swap_generic_name", self.swapGeneric, "toggled", self.swapGeneric.set_active, self.swapGeneric.get_active ) + wTree.get_widget("hotkey_label").set_text(_("Keyboard shortcut:")) - self.bindGconfValueToWidget( self.gconfApplications, "int", "category_hover_delay", self.hoverDelay, "value-changed", self.hoverDelay.set_value, self.hoverDelay.get_value ) - self.bindGconfValueToWidget( self.gconfApplications, "int", "icon_size", self.iconSize, "value-changed", self.iconSize.set_value, self.iconSize.get_value ) - self.bindGconfValueToWidget( self.gconf, "int", "applet_icon_size", self.bttniconSize, "value-changed", self.bttniconSize.set_value, self.bttniconSize.get_value ) - self.bindGconfValueToWidget( self.gconfApplications, "int", "favicon_size", self.favIconSize, "value-changed", self.favIconSize.set_value, self.favIconSize.get_value ) - self.bindGconfValueToWidget( self.gconfApplications, "int", "fav_cols", self.favCols, "value-changed", self.favCols.set_value, self.favCols.get_value ) + self.startWithFavorites = wTree.get_widget( "startWithFavorites" ) + self.showAppComments = wTree.get_widget( "showAppComments" ) + self.showCategoryIcons = wTree.get_widget( "showCategoryIcons" ) + self.showRecentPlugin = wTree.get_widget( "showRecentPlugin" ) + self.showApplicationsPlugin = wTree.get_widget( "showApplicationsPlugin" ) + self.showSystemPlugin = wTree.get_widget( "showSystemPlugin" ) + self.showPlacesPlugin = wTree.get_widget( "showPlacesPlugin" ) + self.swapGeneric = wTree.get_widget("swapGeneric") + self.hover = wTree.get_widget( "hover" ) + self.hoverDelay = wTree.get_widget( "hoverDelay" ) + self.bttniconSize = wTree.get_widget( "main_button_icon_size" ) + self.iconSize = wTree.get_widget( "iconSize" ) + self.favIconSize = wTree.get_widget( "favIconSize" ) + self.favCols = wTree.get_widget( "numFavCols" ) + self.borderWidth = wTree.get_widget( "borderWidth" ) + self.opacity = wTree.get_widget( "opacity" ) + self.useCustomColors = wTree.get_widget( "useCustomColors" ) + self.backgroundColor = wTree.get_widget( "backgroundColor" ) + self.borderColor = wTree.get_widget( "borderColor" ) + self.headingColor = wTree.get_widget( "headingColor" ) + self.backgroundColorLabel = wTree.get_widget( "backgroundColorLabel" ) + self.borderColorLabel = wTree.get_widget( "borderColorLabel" ) + self.headingColorLabel = wTree.get_widget( "headingColorLabel" ) + self.showButtonIcon = wTree.get_widget( "showButtonIcon" ) + self.buttonText = wTree.get_widget( "buttonText" ) + self.hotkeyText = wTree.get_widget( "hotkeyText" ) + self.buttonIcon = wTree.get_widget( "buttonIcon" ) + self.buttonIconImage = wTree.get_widget( "image_button_icon" ) + self.searchCommand = wTree.get_widget( "search_command" ) + self.computertoggle = wTree.get_widget( "computercheckbutton" ) + self.homefoldertoggle = wTree.get_widget( "homecheckbutton" ) + self.networktoggle = wTree.get_widget( "networkcheckbutton" ) + self.desktoptoggle = wTree.get_widget( "desktopcheckbutton" ) + self.trashtoggle = wTree.get_widget( "trashcheckbutton" ) + self.customplacestree = wTree.get_widget( "customplacestree" ) + self.allowPlacesScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton" ) + self.placesHeightButton = wTree.get_widget( "placesHeightSpinButton" ) + if (self.allowPlacesScrollbarToggle.get_active() == False): + self.placesHeightButton.set_sensitive(False) + self.allowPlacesScrollbarToggle.connect("toggled", self.togglePlacesHeightEnabled ) + self.softwareManagerToggle = wTree.get_widget( "softwaremanagercheckbutton" ) + self.packageManagerToggle = wTree.get_widget( "packagemanagercheckbutton" ) + self.controlCenterToggle = wTree.get_widget( "controlcentercheckbutton" ) + self.packageManagerToggle = wTree.get_widget( "packagemanagercheckbutton" ) + self.terminalToggle = wTree.get_widget( "terminalcheckbutton" ) + self.lockToggle = wTree.get_widget( "lockcheckbutton" ) + self.logoutToggle = wTree.get_widget( "logoutcheckbutton" ) + self.quitToggle = wTree.get_widget( "quitcheckbutton" ) + self.allowSystemScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton1" ) + self.systemHeightButton = wTree.get_widget( "systemHeightSpinButton" ) + if (self.allowSystemScrollbarToggle.get_active() == False): self.systemHeightButton.set_sensitive(False) + self.allowSystemScrollbarToggle.connect("toggled", self.toggleSystemHeightEnabled ) + if os.path.exists("/usr/lib/linuxmint/mintInstall/icon.svg"): + wTree.get_widget( "softwaremanagercheckbutton" ).show() + else: + wTree.get_widget( "softwaremanagercheckbutton" ).hide() - self.bindGconfValueToWidget( self.gconf, "int", "border_width", self.borderWidth, "value-changed", self.borderWidth.set_value, self.borderWidth.get_value_as_int ) - self.bindGconfValueToWidget( self.gconf, "int", "opacity", self.opacity, "value-changed", self.opacity.set_value, self.opacity.get_value_as_int ) - self.bindGconfValueToWidget( self.gconf, "bool", "use_custom_color", self.useCustomColors, "toggled", self.useCustomColors.set_active, self.useCustomColors.get_active ) - self.bindGconfValueToWidget( self.gconf, "color", "custom_color", self.backgroundColor, "color-set", self.backgroundColor.set_color, self.getBackgroundColor ) - self.bindGconfValueToWidget( self.gconf, "color", "custom_heading_color", self.headingColor, "color-set", self.headingColor.set_color, self.getHeadingColor ) - self.bindGconfValueToWidget( self.gconf, "color", "custom_border_color", self.borderColor, "color-set", self.borderColor.set_color, self.getBorderColor ) - self.bindGconfValueToWidget( self.gconf, "bool", "hide_applet_icon", self.showButtonIcon, "toggled", self.setShowButtonIcon, self.getShowButtonIcon ) - self.bindGconfValueToWidget( self.gconf, "string", "applet_text", self.buttonText, "changed", self.buttonText.set_text, self.buttonText.get_text ) - self.bindGconfValueToWidget( self.gconf, "string", "hot_key", self.hotkeyText, "changed", self.hotkeyText.set_text, self.hotkeyText.get_text ) - self.bindGconfValueToWidget( self.gconf, "string", "applet_icon", self.buttonIcon, "changed", self.setButtonIcon, self.buttonIcon.get_text ) - self.bindGconfValueToWidget( self.gconfApplications, "string", "search_command", self.searchCommand, "changed", self.searchCommand.set_text, self.searchCommand.get_text ) + wTree.get_widget( "closeButton" ).connect("clicked", gtk.main_quit ) - self.showRecentPlugin.connect("toggled", self.toggleRecent ) - self.showRecentPlugin.set_active( self.getRecentToggle() ) - - self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_computer", self.computertoggle, "toggled", self.computertoggle.set_active, self.computertoggle.get_active ) - self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_home_folder", self.homefoldertoggle, "toggled", self.homefoldertoggle.set_active, self.homefoldertoggle.get_active ) - self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_network", self.networktoggle, "toggled", self.networktoggle.set_active, self.networktoggle.get_active ) - self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_desktop", self.desktoptoggle, "toggled", self.desktoptoggle.set_active, self.desktoptoggle.get_active ) - self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_trash", self.trashtoggle, "toggled", self.trashtoggle.set_active, self.trashtoggle.get_active ) - self.bindGconfValueToWidget( self.gconfPlaces, "int", "height", self.placesHeightButton, "value-changed", self.placesHeightButton.set_value, self.placesHeightButton.get_value_as_int ) - self.bindGconfValueToWidget( self.gconfPlaces, "bool", "allowScrollbar", self.allowPlacesScrollbarToggle, "toggled", self.allowPlacesScrollbarToggle.set_active, self.allowPlacesScrollbarToggle.get_active ) - - self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_software_manager", self.softwareManagerToggle, "toggled", self.softwareManagerToggle.set_active, self.softwareManagerToggle.get_active ) - self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_package_manager", self.packageManagerToggle, "toggled", self.packageManagerToggle.set_active, self.packageManagerToggle.get_active ) - self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_control_center", self.controlCenterToggle, "toggled", self.controlCenterToggle.set_active, self.controlCenterToggle.get_active ) - self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_terminal", self.terminalToggle, "toggled", self.terminalToggle.set_active, self.terminalToggle.get_active ) - self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_lock_screen", self.lockToggle, "toggled", self.lockToggle.set_active, self.lockToggle.get_active ) - self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_logout", self.logoutToggle, "toggled", self.logoutToggle.set_active, self.logoutToggle.get_active ) - self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_quit", self.quitToggle, "toggled", self.quitToggle.set_active, self.quitToggle.get_active ) - self.bindGconfValueToWidget( self.gconfSystem, "int", "height", self.systemHeightButton, "value-changed", self.systemHeightButton.set_value, self.systemHeightButton.get_value_as_int ) - self.bindGconfValueToWidget( self.gconfSystem, "bool", "allowScrollbar", self.allowSystemScrollbarToggle, "toggled", self.allowSystemScrollbarToggle.set_active, self.allowSystemScrollbarToggle.get_active ) - self.customplacepaths = self.gconfPlaces.get( "list-string", "custom_paths", [ ] ) - self.customplacenames = self.gconfPlaces.get( "list-string", "custom_names", [ ] ) - - self.customplacestreemodel = gtk.ListStore( str, str) - self.cell = gtk.CellRendererText() - - for count in range( len(self.customplacepaths) ): - self.customplacestreemodel.append( [ self.customplacenames[count], self.customplacepaths[count] ] ) + self.gconf = EasyGConf( "/apps/mintMenu/" ) + self.gconfApplications = EasyGConf( "/apps/mintMenu/plugins/applications/" ) + self.gconfPlaces = EasyGConf( "/apps/mintMenu/plugins/places/" ) + self.gconfSystem = EasyGConf( "/apps/mintMenu/plugins/system-management/" ) - self.customplacestreemodel.connect("row-changed", self.updatePlacesGconf) - self.customplacestreemodel.connect("row-deleted", self.updatePlacesGconf) - self.customplacestreemodel.connect("rows-reordered", self.updatePlacesGconf) - self.customplacestree.set_model( self.customplacestreemodel ) - self.namescolumn = gtk.TreeViewColumn( _("Name"), self.cell, text = 0 ) - self.placescolumn = gtk.TreeViewColumn( _("Path"), self.cell, text = 1 ) - self.customplacestree.append_column( self.namescolumn ) - self.customplacestree.append_column( self.placescolumn ) - wTree.get_widget("newButton").connect("clicked", self.newPlace) - wTree.get_widget("editButton").connect("clicked", self.editPlace) - wTree.get_widget("upButton").connect("clicked", self.moveUp) - wTree.get_widget("downButton").connect("clicked", self.moveDown) - wTree.get_widget("removeButton").connect("clicked", self.removePlace) - - self.mainWindow.present() - - self.getBackgroundColor() + self.useCustomColors.connect( "toggled", self.toggleUseCustomColors ) - def toggleRecent(self, widget): - if self.showRecentPlugin.get_active(): - os.system("gconftool-2 --type list --list-type string --set /apps/mintMenu/plugins_list [newpane,places,system_management,newpane,applications,newpane,recent]") - else: - os.system("gconftool-2 --type list --list-type string --set /apps/mintMenu/plugins_list [newpane,places,system_management,newpane,applications]") + self.bindGconfValueToWidget( self.gconf, "bool", "start_with_favorites", self.startWithFavorites, "toggled", self.startWithFavorites.set_active, self.startWithFavorites.get_active ) + self.bindGconfValueToWidget( self.gconfApplications, "bool", "show_application_comments", self.showAppComments, "toggled", self.showAppComments.set_active, self.showAppComments.get_active ) + self.bindGconfValueToWidget( self.gconfApplications, "bool", "show_category_icons", self.showCategoryIcons, "toggled", self.showCategoryIcons.set_active, self.showCategoryIcons.get_active ) + self.bindGconfValueToWidget( self.gconfApplications, "bool", "categories_mouse_over", self.hover, "toggled", self.hover.set_active, self.hover.get_active ) + self.bindGconfValueToWidget( self.gconfApplications, "bool", "swap_generic_name", self.swapGeneric, "toggled", self.swapGeneric.set_active, self.swapGeneric.get_active ) - def getRecentToggle(self): - if (commands.getoutput("gconftool-2 --get /apps/mintMenu/plugins_list | grep recent | wc -l") == "0"): - return False - else: - return True + self.bindGconfValueToWidget( self.gconfApplications, "int", "category_hover_delay", self.hoverDelay, "value-changed", self.hoverDelay.set_value, self.hoverDelay.get_value ) + self.bindGconfValueToWidget( self.gconfApplications, "int", "icon_size", self.iconSize, "value-changed", self.iconSize.set_value, self.iconSize.get_value ) + self.bindGconfValueToWidget( self.gconf, "int", "applet_icon_size", self.bttniconSize, "value-changed", self.bttniconSize.set_value, self.bttniconSize.get_value ) + self.bindGconfValueToWidget( self.gconfApplications, "int", "favicon_size", self.favIconSize, "value-changed", self.favIconSize.set_value, self.favIconSize.get_value ) + self.bindGconfValueToWidget( self.gconfApplications, "int", "fav_cols", self.favCols, "value-changed", self.favCols.set_value, self.favCols.get_value ) - def setShowButtonIcon( self, value ): - self.showButtonIcon.set_active(not value ) + self.bindGconfValueToWidget( self.gconf, "int", "border_width", self.borderWidth, "value-changed", self.borderWidth.set_value, self.borderWidth.get_value_as_int ) + self.bindGconfValueToWidget( self.gconf, "int", "opacity", self.opacity, "value-changed", self.opacity.set_value, self.opacity.get_value_as_int ) + self.bindGconfValueToWidget( self.gconf, "bool", "use_custom_color", self.useCustomColors, "toggled", self.useCustomColors.set_active, self.useCustomColors.get_active ) + self.bindGconfValueToWidget( self.gconf, "color", "custom_color", self.backgroundColor, "color-set", self.backgroundColor.set_color, self.getBackgroundColor ) + self.bindGconfValueToWidget( self.gconf, "color", "custom_heading_color", self.headingColor, "color-set", self.headingColor.set_color, self.getHeadingColor ) + self.bindGconfValueToWidget( self.gconf, "color", "custom_border_color", self.borderColor, "color-set", self.borderColor.set_color, self.getBorderColor ) + self.bindGconfValueToWidget( self.gconf, "bool", "hide_applet_icon", self.showButtonIcon, "toggled", self.setShowButtonIcon, self.getShowButtonIcon ) + self.bindGconfValueToWidget( self.gconf, "string", "applet_text", self.buttonText, "changed", self.buttonText.set_text, self.buttonText.get_text ) + self.bindGconfValueToWidget( self.gconf, "string", "hot_key", self.hotkeyText, "changed", self.hotkeyText.set_text, self.hotkeyText.get_text ) + self.bindGconfValueToWidget( self.gconf, "string", "applet_icon", self.buttonIcon, "changed", self.setButtonIcon, self.buttonIcon.get_text ) + self.bindGconfValueToWidget( self.gconfApplications, "string", "search_command", self.searchCommand, "changed", self.searchCommand.set_text, self.searchCommand.get_text ) - def setButtonIcon( self, value ): - self.buttonIcon.set_text(value) - self.buttonIconImage.set_from_file(value) + self.getPluginsToggle() + self.showRecentPlugin.connect("toggled", self.setPluginsLayout ) + self.showApplicationsPlugin.connect("toggled", self.setPluginsLayout ) + self.showSystemPlugin.connect("toggled", self.setPluginsLayout ) + self.showPlacesPlugin.connect("toggled", self.setPluginsLayout ) - def getShowButtonIcon( self ): - return not self.showButtonIcon.get_active() - def bindGconfValueToWidget( self, gconf, gconfType, gconfPath, widget, changeEvent, setter, getter ): - widget.connect( changeEvent, lambda *args: self.callGetter( gconf, gconfType, gconfPath, getter ) ) + self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_computer", self.computertoggle, "toggled", self.computertoggle.set_active, self.computertoggle.get_active ) + self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_home_folder", self.homefoldertoggle, "toggled", self.homefoldertoggle.set_active, self.homefoldertoggle.get_active ) + self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_network", self.networktoggle, "toggled", self.networktoggle.set_active, self.networktoggle.get_active ) + self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_desktop", self.desktoptoggle, "toggled", self.desktoptoggle.set_active, self.desktoptoggle.get_active ) + self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_trash", self.trashtoggle, "toggled", self.trashtoggle.set_active, self.trashtoggle.get_active ) + self.bindGconfValueToWidget( self.gconfPlaces, "int", "height", self.placesHeightButton, "value-changed", self.placesHeightButton.set_value, self.placesHeightButton.get_value_as_int ) + self.bindGconfValueToWidget( self.gconfPlaces, "bool", "allowScrollbar", self.allowPlacesScrollbarToggle, "toggled", self.allowPlacesScrollbarToggle.set_active, self.allowPlacesScrollbarToggle.get_active ) - gconf.notifyAdd( gconfPath, self.callSetter, args = [ gconfType, setter ] ) - if gconfType == "color": - setter( gtk.gdk.color_parse( gconf.get( gconfType, gconfPath ) ) ) - else: - setter( gconf.get( gconfType, gconfPath ) ) + self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_software_manager", self.softwareManagerToggle, "toggled", self.softwareManagerToggle.set_active, self.softwareManagerToggle.get_active ) + self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_package_manager", self.packageManagerToggle, "toggled", self.packageManagerToggle.set_active, self.packageManagerToggle.get_active ) + self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_control_center", self.controlCenterToggle, "toggled", self.controlCenterToggle.set_active, self.controlCenterToggle.get_active ) + self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_terminal", self.terminalToggle, "toggled", self.terminalToggle.set_active, self.terminalToggle.get_active ) + self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_lock_screen", self.lockToggle, "toggled", self.lockToggle.set_active, self.lockToggle.get_active ) + self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_logout", self.logoutToggle, "toggled", self.logoutToggle.set_active, self.logoutToggle.get_active ) + self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_quit", self.quitToggle, "toggled", self.quitToggle.set_active, self.quitToggle.get_active ) + self.bindGconfValueToWidget( self.gconfSystem, "int", "height", self.systemHeightButton, "value-changed", self.systemHeightButton.set_value, self.systemHeightButton.get_value_as_int ) + self.bindGconfValueToWidget( self.gconfSystem, "bool", "allowScrollbar", self.allowSystemScrollbarToggle, "toggled", self.allowSystemScrollbarToggle.set_active, self.allowSystemScrollbarToggle.get_active ) - def callSetter( self, client, connection_id, entry, args ): - if args[0] == "bool": - args[1]( entry.get_value().get_bool() ) - elif args[0] == "string": - args[1]( entry.get_value().get_string() ) - elif args[0] == "int": - args[1]( entry.get_value().get_int() ) - elif args[0] == "color": - args[1]( gtk.gdk.color_parse( entry.get_value().get_string() ) ) - - def callGetter( self, gconf, gconfType, gconfPath, getter ): - gconf.set( gconfType, gconfPath, getter() ) - - def toggleUseCustomColors( self, widget ): - self.backgroundColor.set_sensitive( widget.get_active() ) - self.borderColor.set_sensitive( widget.get_active() ) - self.headingColor.set_sensitive( widget.get_active() ) - self.backgroundColorLabel.set_sensitive( widget.get_active() ) - self.borderColorLabel.set_sensitive( widget.get_active() ) - self.headingColorLabel.set_sensitive( widget.get_active() ) - - def getBackgroundColor( self ): - return self.gdkColorToString( self.backgroundColor.get_color() ) - - def getBorderColor( self ): - return self.gdkColorToString( self.borderColor.get_color() ) - - def getHeadingColor( self ): - return self.gdkColorToString( self.headingColor.get_color() ) - - def gdkColorToString( self, gdkColor ): - return "#%.2X%.2X%.2X" % ( gdkColor.red / 256, gdkColor.green / 256, gdkColor.blue / 256 ) - - def moveUp( self, upButton ): - - treeselection = self.customplacestree.get_selection() - currentiter = (treeselection.get_selected())[1] - - if ( treeselection != None ): - - lagiter = self.customplacestreemodel.get_iter_first() - nextiter = self.customplacestreemodel.get_iter_first() - - while ( (self.customplacestreemodel.get_path(nextiter) != self.customplacestreemodel.get_path(currentiter)) & (nextiter != None)): - lagiter = nextiter - nextiter = self.customplacestreemodel.iter_next(nextiter) - - if (nextiter != None): - self.customplacestreemodel.swap(currentiter, lagiter) - - return - - def newPlace(self, newButton): - gladefile = os.path.join( self.path, "mintMenuConfig.glade" ) - wTree = gtk.glade.XML( gladefile, "editPlaceDialog" ) - wTree.get_widget("label2").set_text(_("Name:")) - wTree.get_widget("label1").set_text(_("Path:")) - folderChooserTree = gtk.glade.XML( gladefile, "fileChooserDialog" ) - newPlaceDialog = wTree.get_widget( "editPlaceDialog" ) - folderChooserDialog = folderChooserTree.get_widget( "fileChooserDialog" ) - newPlaceDialog.set_transient_for(self.mainWindow) - newPlaceDialog.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg") - newPlaceDialog.set_title(self.newPlaceDialogTitle) - folderChooserDialog.set_title(self.folderChooserDialogTitle) - newPlaceDialog.set_default_response(gtk.RESPONSE_OK) - newPlaceName = wTree.get_widget( "nameEntryBox" ) - newPlacePath = wTree.get_widget( "pathEntryBox" ) - folderButton = wTree.get_widget( "folderButton" ) - def chooseFolder(folderButton): - currentPath = newPlacePath.get_text() - if (currentPath!=""): - folderChooserDialog.select_filename(currentPath) - response = folderChooserDialog.run() - folderChooserDialog.hide() - if (response == gtk.RESPONSE_OK): - newPlacePath.set_text( folderChooserDialog.get_filenames()[0] ) - folderButton.connect("clicked", chooseFolder) + self.customplacepaths = self.gconfPlaces.get( "list-string", "custom_paths", [ ] ) + self.customplacenames = self.gconfPlaces.get( "list-string", "custom_names", [ ] ) - response = newPlaceDialog.run() - newPlaceDialog.hide() - if (response == gtk.RESPONSE_OK ): - name = newPlaceName.get_text() - path = newPlacePath.get_text() - if (name != "" and path !=""): - self.customplacestreemodel.append( (name, path) ) - - def editPlace(self, editButton): - gladefile = os.path.join( self.path, "mintMenuConfig.glade" ) - wTree = gtk.glade.XML( gladefile, "editPlaceDialog" ) - wTree.get_widget("label2").set_text(_("Name:")) - wTree.get_widget("label1").set_text(_("Path:")) - folderChooserTree = gtk.glade.XML( gladefile, "fileChooserDialog" ) - editPlaceDialog = wTree.get_widget( "editPlaceDialog" ) - folderChooserDialog = folderChooserTree.get_widget( "fileChooserDialog" ) - editPlaceDialog.set_transient_for(self.mainWindow) - editPlaceDialog.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg") - editPlaceDialog.set_title(self.editPlaceDialogTitle) - folderChooserDialog.set_title(self.folderChooserDialogTitle) - editPlaceDialog.set_default_response(gtk.RESPONSE_OK) - editPlaceName = wTree.get_widget( "nameEntryBox" ) - editPlacePath = wTree.get_widget( "pathEntryBox" ) - folderButton = wTree.get_widget( "folderButton" ) - treeselection = self.customplacestree.get_selection() - currentiter = (treeselection.get_selected())[1] + self.customplacestreemodel = gtk.ListStore( str, str) + self.cell = gtk.CellRendererText() - if (currentiter != None): - - initName = self.customplacestreemodel.get_value(currentiter, 0) - initPath = self.customplacestreemodel.get_value(currentiter, 1) - - editPlaceName.set_text(initName) - editPlacePath.set_text(initPath) - def chooseFolder(folderButton): - currentPath = editPlacePath.get_text() - if (currentPath!=""): - folderChooserDialog.select_filename(currentPath) - response = folderChooserDialog.run() - folderChooserDialog.hide() - if (response == gtk.RESPONSE_OK): - editPlacePath.set_text( folderChooserDialog.get_filenames()[0] ) - folderButton.connect("clicked", chooseFolder) - response = editPlaceDialog.run() - editPlaceDialog.hide() - if (response == gtk.RESPONSE_OK): - name = editPlaceName.get_text() - path = editPlacePath.get_text() - if (name != "" and path != ""): - self.customplacestreemodel.set_value(currentiter, 0, name) - self.customplacestreemodel.set_value(currentiter, 1, path) - - def moveDown(self, downButton): - - treeselection = self.customplacestree.get_selection() - currentiter = (treeselection.get_selected())[1] - - nextiter = self.customplacestreemodel.iter_next(currentiter) - - if (nextiter != None): - self.customplacestreemodel.swap(currentiter, nextiter) - - return - - - def removePlace(self, removeButton): - - treeselection = self.customplacestree.get_selection() - currentiter = (treeselection.get_selected())[1] - - if (currentiter != None): - self.customplacestreemodel.remove(currentiter) - - return - - def togglePlacesHeightEnabled(self, toggle): - if (toggle.get_active() == True): - self.placesHeightButton.set_sensitive(True) - else: - self.placesHeightButton.set_sensitive(False) - - def toggleSystemHeightEnabled(self, toggle): - if (toggle.get_active() == True): - self.systemHeightButton.set_sensitive(True) - else: - self.systemHeightButton.set_sensitive(False) + for count in range( len(self.customplacepaths) ): + self.customplacestreemodel.append( [ self.customplacenames[count], self.customplacepaths[count] ] ) - def updatePlacesGconf(self, treemodel, path, iter = None, new_order = None): + self.customplacestreemodel.connect("row-changed", self.updatePlacesGconf) + self.customplacestreemodel.connect("row-deleted", self.updatePlacesGconf) + self.customplacestreemodel.connect("rows-reordered", self.updatePlacesGconf) + self.customplacestree.set_model( self.customplacestreemodel ) + self.namescolumn = gtk.TreeViewColumn( _("Name"), self.cell, text = 0 ) + self.placescolumn = gtk.TreeViewColumn( _("Path"), self.cell, text = 1 ) + self.customplacestree.append_column( self.namescolumn ) + self.customplacestree.append_column( self.placescolumn ) + wTree.get_widget("newButton").connect("clicked", self.newPlace) + wTree.get_widget("editButton").connect("clicked", self.editPlace) + wTree.get_widget("upButton").connect("clicked", self.moveUp) + wTree.get_widget("downButton").connect("clicked", self.moveDown) + wTree.get_widget("removeButton").connect("clicked", self.removePlace) + + self.mainWindow.present() + + self.getBackgroundColor() + + def getPluginsToggle(self): + if (commands.getoutput("gconftool-2 --get /apps/mintMenu/plugins_list | grep recent | wc -l") == "0"): + self.showRecentPlugin.set_active(False) + else: + self.showRecentPlugin.set_active(True) + if (commands.getoutput("gconftool-2 --get /apps/mintMenu/plugins_list | grep applications | wc -l") == "0"): + self.showApplicationsPlugin.set_active(False) + else: + self.showApplicationsPlugin.set_active(True) + if (commands.getoutput("gconftool-2 --get /apps/mintMenu/plugins_list | grep system_management | wc -l") == "0"): + self.showSystemPlugin.set_active(False) + else: + self.showSystemPlugin.set_active(True) + if (commands.getoutput("gconftool-2 --get /apps/mintMenu/plugins_list | grep places | wc -l") == "0"): + self.showPlacesPlugin.set_active(False) + else: + self.showPlacesPlugin.set_active(True) + + def setPluginsLayout (self, widget): + visiblePlugins = [] + if self.showPlacesPlugin.get_active(): + visiblePlugins.append("places") + if self.showSystemPlugin.get_active(): + visiblePlugins.append("system_management") + if self.showApplicationsPlugin.get_active(): + if self.showPlacesPlugin.get_active() or self.showSystemPlugin.get_active(): + visiblePlugins.append("newpane") + visiblePlugins.append("applications") + if self.showRecentPlugin.get_active(): + if self.showApplicationsPlugin.get_active() or self.showPlacesPlugin.get_active() or self.showSystemPlugin.get_active(): + visiblePlugins.append("newpane") + visiblePlugins.append("recent") + layout = "" + for plugin in visiblePlugins: + layout = layout + plugin + "," + if len(layout) > 0 and layout[-1] == ",": + layout = layout[0:-1] + os.system("gconftool-2 --type list --list-type string --set /apps/mintMenu/plugins_list [%s]" % layout) + + def setShowButtonIcon( self, value ): + self.showButtonIcon.set_active(not value ) + + def setButtonIcon( self, value ): + self.buttonIcon.set_text(value) + self.buttonIconImage.set_from_file(value) + + def getShowButtonIcon( self ): + return not self.showButtonIcon.get_active() + + def bindGconfValueToWidget( self, gconf, gconfType, gconfPath, widget, changeEvent, setter, getter ): + widget.connect( changeEvent, lambda *args: self.callGetter( gconf, gconfType, gconfPath, getter ) ) + + gconf.notifyAdd( gconfPath, self.callSetter, args = [ gconfType, setter ] ) + if gconfType == "color": + setter( gtk.gdk.color_parse( gconf.get( gconfType, gconfPath ) ) ) + else: + setter( gconf.get( gconfType, gconfPath ) ) + + def callSetter( self, client, connection_id, entry, args ): + if args[0] == "bool": + args[1]( entry.get_value().get_bool() ) + elif args[0] == "string": + args[1]( entry.get_value().get_string() ) + elif args[0] == "int": + args[1]( entry.get_value().get_int() ) + elif args[0] == "color": + args[1]( gtk.gdk.color_parse( entry.get_value().get_string() ) ) + + def callGetter( self, gconf, gconfType, gconfPath, getter ): + gconf.set( gconfType, gconfPath, getter() ) + + def toggleUseCustomColors( self, widget ): + self.backgroundColor.set_sensitive( widget.get_active() ) + self.borderColor.set_sensitive( widget.get_active() ) + self.headingColor.set_sensitive( widget.get_active() ) + self.backgroundColorLabel.set_sensitive( widget.get_active() ) + self.borderColorLabel.set_sensitive( widget.get_active() ) + self.headingColorLabel.set_sensitive( widget.get_active() ) + + def getBackgroundColor( self ): + return self.gdkColorToString( self.backgroundColor.get_color() ) + + def getBorderColor( self ): + return self.gdkColorToString( self.borderColor.get_color() ) + + def getHeadingColor( self ): + return self.gdkColorToString( self.headingColor.get_color() ) + + def gdkColorToString( self, gdkColor ): + return "#%.2X%.2X%.2X" % ( gdkColor.red / 256, gdkColor.green / 256, gdkColor.blue / 256 ) + + def moveUp( self, upButton ): + + treeselection = self.customplacestree.get_selection() + currentiter = (treeselection.get_selected())[1] + + if ( treeselection != None ): + + lagiter = self.customplacestreemodel.get_iter_first() + nextiter = self.customplacestreemodel.get_iter_first() + + while ( (self.customplacestreemodel.get_path(nextiter) != self.customplacestreemodel.get_path(currentiter)) & (nextiter != None)): + lagiter = nextiter + nextiter = self.customplacestreemodel.iter_next(nextiter) + + if (nextiter != None): + self.customplacestreemodel.swap(currentiter, lagiter) + + return + + def newPlace(self, newButton): + gladefile = os.path.join( self.path, "mintMenuConfig.glade" ) + wTree = gtk.glade.XML( gladefile, "editPlaceDialog" ) + wTree.get_widget("label2").set_text(_("Name:")) + wTree.get_widget("label1").set_text(_("Path:")) + folderChooserTree = gtk.glade.XML( gladefile, "fileChooserDialog" ) + newPlaceDialog = wTree.get_widget( "editPlaceDialog" ) + folderChooserDialog = folderChooserTree.get_widget( "fileChooserDialog" ) + newPlaceDialog.set_transient_for(self.mainWindow) + newPlaceDialog.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg") + newPlaceDialog.set_title(self.newPlaceDialogTitle) + folderChooserDialog.set_title(self.folderChooserDialogTitle) + newPlaceDialog.set_default_response(gtk.RESPONSE_OK) + newPlaceName = wTree.get_widget( "nameEntryBox" ) + newPlacePath = wTree.get_widget( "pathEntryBox" ) + folderButton = wTree.get_widget( "folderButton" ) + def chooseFolder(folderButton): + currentPath = newPlacePath.get_text() + if (currentPath!=""): + folderChooserDialog.select_filename(currentPath) + response = folderChooserDialog.run() + folderChooserDialog.hide() + if (response == gtk.RESPONSE_OK): + newPlacePath.set_text( folderChooserDialog.get_filenames()[0] ) + folderButton.connect("clicked", chooseFolder) + + response = newPlaceDialog.run() + newPlaceDialog.hide() + if (response == gtk.RESPONSE_OK ): + name = newPlaceName.get_text() + path = newPlacePath.get_text() + if (name != "" and path !=""): + self.customplacestreemodel.append( (name, path) ) + + def editPlace(self, editButton): + gladefile = os.path.join( self.path, "mintMenuConfig.glade" ) + wTree = gtk.glade.XML( gladefile, "editPlaceDialog" ) + wTree.get_widget("label2").set_text(_("Name:")) + wTree.get_widget("label1").set_text(_("Path:")) + folderChooserTree = gtk.glade.XML( gladefile, "fileChooserDialog" ) + editPlaceDialog = wTree.get_widget( "editPlaceDialog" ) + folderChooserDialog = folderChooserTree.get_widget( "fileChooserDialog" ) + editPlaceDialog.set_transient_for(self.mainWindow) + editPlaceDialog.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg") + editPlaceDialog.set_title(self.editPlaceDialogTitle) + folderChooserDialog.set_title(self.folderChooserDialogTitle) + editPlaceDialog.set_default_response(gtk.RESPONSE_OK) + editPlaceName = wTree.get_widget( "nameEntryBox" ) + editPlacePath = wTree.get_widget( "pathEntryBox" ) + folderButton = wTree.get_widget( "folderButton" ) + treeselection = self.customplacestree.get_selection() + currentiter = (treeselection.get_selected())[1] + + if (currentiter != None): + + initName = self.customplacestreemodel.get_value(currentiter, 0) + initPath = self.customplacestreemodel.get_value(currentiter, 1) + + editPlaceName.set_text(initName) + editPlacePath.set_text(initPath) + def chooseFolder(folderButton): + currentPath = editPlacePath.get_text() + if (currentPath!=""): + folderChooserDialog.select_filename(currentPath) + response = folderChooserDialog.run() + folderChooserDialog.hide() + if (response == gtk.RESPONSE_OK): + editPlacePath.set_text( folderChooserDialog.get_filenames()[0] ) + folderButton.connect("clicked", chooseFolder) + response = editPlaceDialog.run() + editPlaceDialog.hide() + if (response == gtk.RESPONSE_OK): + name = editPlaceName.get_text() + path = editPlacePath.get_text() + if (name != "" and path != ""): + self.customplacestreemodel.set_value(currentiter, 0, name) + self.customplacestreemodel.set_value(currentiter, 1, path) + + def moveDown(self, downButton): + + treeselection = self.customplacestree.get_selection() + currentiter = (treeselection.get_selected())[1] + + nextiter = self.customplacestreemodel.iter_next(currentiter) + + if (nextiter != None): + self.customplacestreemodel.swap(currentiter, nextiter) + + return + + + def removePlace(self, removeButton): + + treeselection = self.customplacestree.get_selection() + currentiter = (treeselection.get_selected())[1] + + if (currentiter != None): + self.customplacestreemodel.remove(currentiter) + + return + + def togglePlacesHeightEnabled(self, toggle): + if (toggle.get_active() == True): + self.placesHeightButton.set_sensitive(True) + else: + self.placesHeightButton.set_sensitive(False) + + def toggleSystemHeightEnabled(self, toggle): + if (toggle.get_active() == True): + self.systemHeightButton.set_sensitive(True) + else: + self.systemHeightButton.set_sensitive(False) + + def updatePlacesGconf(self, treemodel, path, iter = None, new_order = None): # Do only if not partway though an append operation; Append = insert+change+change and each creates a signal - if ((iter == None) or (self.customplacestreemodel.get_value(iter, 1) != None)): - treeiter = self.customplacestreemodel.get_iter_first() - customplacenames = [ ] - customplacepaths = [ ] - while( treeiter != None ): - customplacenames = customplacenames + [ self.customplacestreemodel.get_value(treeiter, 0 ) ] - customplacepaths = customplacepaths + [ self.customplacestreemodel.get_value(treeiter, 1 ) ] - treeiter = self.customplacestreemodel.iter_next(treeiter) - self.gconfPlaces.set( "list-string", "custom_paths", customplacepaths) - self.gconfPlaces.set( "list-string", "custom_names", customplacenames) - + if ((iter == None) or (self.customplacestreemodel.get_value(iter, 1) != None)): + treeiter = self.customplacestreemodel.get_iter_first() + customplacenames = [ ] + customplacepaths = [ ] + while( treeiter != None ): + customplacenames = customplacenames + [ self.customplacestreemodel.get_value(treeiter, 0 ) ] + customplacepaths = customplacepaths + [ self.customplacestreemodel.get_value(treeiter, 1 ) ] + treeiter = self.customplacestreemodel.iter_next(treeiter) + self.gconfPlaces.set( "list-string", "custom_paths", customplacepaths) + self.gconfPlaces.set( "list-string", "custom_names", customplacenames) + window = mintMenuConfig() gtk.main() diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 159936f..ad5a176 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -252,12 +252,12 @@ class pluginclass( object ): #i18n self.wTree.get_widget("searchLabel").set_text("" + _("Search:") + "") self.wTree.get_widget("searchLabel").set_use_markup(True) - self.wTree.get_widget("label6").set_text("" + _("Favorites") + "") - self.wTree.get_widget("label6").set_use_markup(True) - self.wTree.get_widget("label7").set_text(_("All applications")) - self.wTree.get_widget("label2").set_text("" + _("All applications") + "") - self.wTree.get_widget("label2").set_use_markup(True) + self.wTree.get_widget("label6").set_text(_("Favorites")) self.wTree.get_widget("label3").set_text(_("Favorites")) + self.wTree.get_widget("label7").set_text(_("All applications")) + self.wTree.get_widget("label2").set_text(_("Applications")) + + self.mintMenuWin.SetHeadingStyle( [self.wTree.get_widget("label6"), self.wTree.get_widget("label2")] ) self.numApps = 0 # These properties are NECESSARY to maintain consistency @@ -266,7 +266,7 @@ class pluginclass( object ): self.window = self.wTree.get_widget( "mainWindow" ) # Set 'heading' property for plugin - self.heading = _("Applications") + self.heading = ""#_("Applications") # This should be the first item added to the window in glade self.content_holder = self.wTree.get_widget( "Applications" ) diff --git a/usr/lib/linuxmint/mintMenu/plugins/system_management.glade b/usr/lib/linuxmint/mintMenu/plugins/system_management.glade index 180aeaf..d43b425 100644 --- a/usr/lib/linuxmint/mintMenu/plugins/system_management.glade +++ b/usr/lib/linuxmint/mintMenu/plugins/system_management.glade @@ -1,7 +1,7 @@ - - - + + + @@ -11,15 +11,15 @@ True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC + automatic + automatic True - GTK_SHADOW_NONE + none True @@ -29,11 +29,14 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 + + 0 + True - GTK_BUTTONBOX_START + start False