From 3b92de62d8560e8f32064716abb48781fdd5efe9 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 18 Nov 2011 10:42:20 +0000 Subject: [PATCH] Switched support from Gnome/Bonobo to MATE/Component --- debian/dirs | 4 +- usr/bin/mintmenu | 4 +- usr/lib/linuxmint/mintMenu/detectDE | 7 -- usr/lib/linuxmint/mintMenu/mintMenu.py | 53 ++++++++------- usr/lib/linuxmint/mintMenu/mintMenuConfig.py | 14 ++-- .../mintMenu/plugins/applications.py | 65 +++++++++---------- .../linuxmint/mintMenu/plugins/easybuttons.py | 16 ++--- .../linuxmint/mintMenu/plugins/easygconf.py | 6 +- usr/lib/linuxmint/mintMenu/plugins/places.py | 12 ++-- usr/lib/linuxmint/mintMenu/plugins/recent.py | 12 ++-- .../mintMenu/plugins/system_management.py | 10 ++- .../servers/mintMenu.server | 20 +++--- 12 files changed, 105 insertions(+), 118 deletions(-) delete mode 100755 usr/lib/linuxmint/mintMenu/detectDE rename usr/lib/{bonobo => matecomponent}/servers/mintMenu.server (58%) diff --git a/debian/dirs b/debian/dirs index ee4a8b3..ecde142 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,6 +1,6 @@ usr/lib/linuxmint usr/lib/linuxmint/mintMenu usr/lib/linuxmint/mintMenu/plugins -usr/lib/bonobo -usr/lib/bonobo/servers +usr/lib/matecomponent +usr/lib/matecomponent/servers diff --git a/usr/bin/mintmenu b/usr/bin/mintmenu index 3fdc4a3..cef8ad2 100755 --- a/usr/bin/mintmenu +++ b/usr/bin/mintmenu @@ -4,9 +4,9 @@ import sys, os if len(sys.argv) > 1: if (sys.argv[1] in ["clean", "clear", "reset", "--clean", "--clear", "--reset"]): - os.system("gconftool-2 --recursive-unset /apps/mintMenu") + os.system("mateconftool-2 --recursive-unset /apps/mintMenu") os.system("rm -rf ~/.linuxmint/mintMenu") - os.system("gconftool-2 --recursive-unset /apps/mintMenu") + os.system("mateconftool-2 --recursive-unset /apps/mintMenu") os.system("rm -rf ~/.linuxmint/mintMenu") print "All mintMenu settings are now restored to default" else: diff --git a/usr/lib/linuxmint/mintMenu/detectDE b/usr/lib/linuxmint/mintMenu/detectDE deleted file mode 100755 index e8eca68..0000000 --- a/usr/lib/linuxmint/mintMenu/detectDE +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; - elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; - elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; - elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; -fi -echo $DE diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 1daa32f..17948e0 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -7,9 +7,9 @@ try: import pango import os import commands - import gnomeapplet + import mateapplet import gettext - import gnomevfs + import matevfs import traceback import time import gc @@ -54,10 +54,9 @@ ICON = "/usr/lib/linuxmint/mintMenu/visualisation-logo.png" sys.path.append( os.path.join( PATH , "plugins") ) -# FIX: Get the window manager from the GDMSESSION environment variable, fallback to GNOME if it's not set -windowManager = os.getenv("GDMSESSION") +windowManager = os.getenv("DESKTOP_SESSION") if not windowManager: - windowManager = "GNOME" + windowManager = "MATE" xdg.Config.setWindowManager( windowManager.upper() ) from easybuttons import iconManager @@ -213,10 +212,10 @@ class MainWindow( object ): self.window.set_opacity(opacity) def detect_desktop_environment (self): - self.de = "gnome" + self.de = "mate" try: - de = commands.getoutput("/usr/lib/linuxmint/mintMenu/detectDE") - if de in ["gnome", "kde", "xfce"]: + de = os.environ["DESKTOP_SESSION"] + if de in ["gnome", "gnome-shell", "mate", "kde", "xfce"]: self.de = de except Exception, detail: print detail @@ -254,7 +253,7 @@ class MainWindow( object ): MyPlugin = X.pluginclass( self, self.toggle, self.de ) if not MyPlugin.icon: - MyPlugin.icon = "gnome-logo-icon.png" + MyPlugin.icon = "mate-logo-icon.png" #if hasattr( MyPlugin, "hideseparator" ) and not MyPlugin.hideseparator: # Image1 = gtk.Image() @@ -282,7 +281,7 @@ class MainWindow( object ): MyPlugin.content_holder.add( errorLabel ) MyPlugin.add( MyPlugin.content_holder ) MyPlugin.width = 270 - MyPlugin.icon = 'gnome-logo-icon.png' + MyPlugin.icon = 'mate-logo-icon.png' print u"Unable to load " + plugin + " plugin :-(" @@ -527,12 +526,12 @@ class MenuWin( object ): self.gconf.notifyAdd( "applet_icon_size", self.gconfEntriesChanged ) self.getGconfEntries() - self.gconftheme = EasyGConf( "/desktop/gnome/interface/" ) + self.gconftheme = EasyGConf( "/desktop/mate/interface/" ) self.gconftheme.notifyAdd( "gtk_theme", self.changeTheme ) self.createPanelButton() - self.applet.set_applet_flags( gnomeapplet.EXPAND_MINOR ) + self.applet.set_applet_flags( mateapplet.EXPAND_MINOR ) self.applet.connect( "button-press-event", self.showMenu ) self.applet.connect( "change-orient", self.changeOrientation ) self.applet.connect( "change-background", self.changeBackground ) @@ -596,20 +595,20 @@ class MenuWin( object ): 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: + if self.applet.get_orient() == mateapplet.ORIENT_UP or self.applet.get_orient() == mateapplet.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: + elif self.applet.get_orient() == mateapplet.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: + elif self.applet.get_orient() == mateapplet.ORIENT_RIGHT: self.button_box = gtk.VBox() self.systemlabel.set_angle( 90 ) self.button_box.pack_start( self.button_icon ) @@ -640,9 +639,9 @@ class MenuWin( object ): rc_style = gtk.RcStyle() self.applet.modify_style(rc_style) - if gnomeapplet.COLOR_BACKGROUND == type: + if mateapplet.COLOR_BACKGROUND == type: applet.modify_bg( gtk.STATE_NORMAL, color ) - elif gnomeapplet.PIXMAP_BACKGROUND == type: + elif mateapplet.PIXMAP_BACKGROUND == type: style = applet.style style.bg_pixmap[ gtk.STATE_NORMAL ] = pixmap applet.set_style( style ) @@ -654,7 +653,7 @@ class MenuWin( object ): def applyTheme(self): style_settings = gtk.settings_get_default() - desktop_theme = self.gconf.get( "string", '/desktop/gnome/interface/gtk_theme', "") + desktop_theme = self.gconf.get( "string", '/desktop/mate/interface/gtk_theme', "") if self.theme_name == "default": style_settings.set_property("gtk-theme-name", desktop_theme) else: @@ -665,17 +664,17 @@ class MenuWin( object ): def changeOrientation( self, *args, **kargs ): - if self.applet.get_orient() == gnomeapplet.ORIENT_UP or self.applet.get_orient() == gnomeapplet.ORIENT_DOWN: + if self.applet.get_orient() == mateapplet.ORIENT_UP or self.applet.get_orient() == mateapplet.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: + elif self.applet.get_orient() == mateapplet.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: + elif self.applet.get_orient() == mateapplet.ORIENT_RIGHT: tmpbox = gtk.VBox() self.systemlabel.set_angle( 90 ) self.button_box.reorder_child( self.button_icon, 0 ) @@ -720,7 +719,7 @@ class MenuWin( object ): 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.applet.get_orient() == mateapplet.ORIENT_UP or self.applet.get_orient() == mateapplet.ORIENT_DOWN: if self.hideIcon: self.applet.set_size_request( self.systemlabel.size_request()[0] + 2, -1 ) else: @@ -764,7 +763,7 @@ class MenuWin( object ): def showPreferences( self, uicomponent, verb ): -# Execute( "gconf-editor /apps/mintMenu" ) +# Execute( "mateconf-editor /apps/mintMenu" ) Execute( os.path.join( PATH, "mintMenuConfig.py" ) ) def showMenuEditor( self, uicomponent, verb ): @@ -805,7 +804,7 @@ class MenuWin( object ): 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 self.applet.get_orient() == mateapplet.ORIENT_UP or self.applet.get_orient() == mateapplet.ORIENT_DOWN: if entryX + ourWidth < screenWidth or entryX + entryWidth / 2 < screenWidth / 2: # Align to the left of the entry newX = entryX @@ -852,7 +851,7 @@ if len(sys.argv) == 2 and sys.argv[1] == "run-in-window": main_window = gtk.Window( gtk.WINDOW_TOPLEVEL ) main_window.set_title( NAME ) main_window.connect( "destroy", quit_all ) - app = gnomeapplet.Applet() + app = mateapplet.Applet() menu_factory( app, None ) app.reparent( main_window ) main_window.show() @@ -860,6 +859,6 @@ if len(sys.argv) == 2 and sys.argv[1] == "run-in-window": gtk.main() gtk.gdk.threads_leave() else: - gnomeapplet.bonobo_factory("OAFIID:GNOME_mintMenu_Factory", - gnomeapplet.Applet.__gtype__, + mateapplet.bonobo_factory("OAFIID:MATE_mintMenu_Factory", + mateapplet.Applet.__gtype__, "mintMenu", "0", menu_factory) diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py index 4a52147..8b6afe8 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py @@ -275,7 +275,7 @@ class mintMenuConfig( object ): wTree.get_widget("removeButton").connect("clicked", self.removePlace) #Detect themes and show theme here - theme_name = commands.getoutput("gconftool-2 --get /apps/mintMenu/theme_name").strip() + theme_name = commands.getoutput("mateconftool-2 --get /apps/mintMenu/theme_name").strip() themes = commands.getoutput("find /usr/share/themes -name gtkrc") themes = themes.split("\n") model = gtk.ListStore(str, str) @@ -300,22 +300,22 @@ class mintMenuConfig( object ): model = widget.get_model() iter = widget.get_active_iter() theme_name = model.get_value(iter, 1) - os.system("gconftool-2 --type string --set /apps/mintMenu/theme_name \"%s\"" % theme_name) + os.system("mateconftool-2 --type string --set /apps/mintMenu/theme_name \"%s\"" % theme_name) def getPluginsToggle(self): - if (commands.getoutput("gconftool-2 --get /apps/mintMenu/plugins_list | grep recent | wc -l") == "0"): + if (commands.getoutput("mateconftool-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"): + if (commands.getoutput("mateconftool-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"): + if (commands.getoutput("mateconftool-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"): + if (commands.getoutput("mateconftool-2 --get /apps/mintMenu/plugins_list | grep places | wc -l") == "0"): self.showPlacesPlugin.set_active(False) else: self.showPlacesPlugin.set_active(True) @@ -339,7 +339,7 @@ class mintMenuConfig( object ): 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) + os.system("mateconftool-2 --type list --list-type string --set /apps/mintMenu/plugins_list [%s]" % layout) def setShowButtonIcon( self, value ): self.showButtonIcon.set_active(not value ) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index dea60bb..1af681e 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -4,12 +4,11 @@ import gtk import gtk.glade import gobject import os -import gconf +import mateconf import fnmatch import time import string import gettext -import gnomevfs import threading import commands import subprocess @@ -23,7 +22,7 @@ from easyfiles import * #from filemonitor import monitor as filemonitor #import xdg.Menu -import gmenu +import matemenu from user import home @@ -141,7 +140,7 @@ def rel_path(target, base=os.curdir): class Menu: def __init__( self, MenuToLookup ): - self.tree = gmenu.lookup_tree( MenuToLookup ) + self.tree = matemenu.lookup_tree( MenuToLookup ) self.directory = self.tree.get_root_directory() def getMenus( self, parent=None ): @@ -150,18 +149,18 @@ class Menu: yield self.tree.root else: for menu in parent.get_contents(): - if menu.get_type() == gmenu.TYPE_DIRECTORY and self.__isVisible( menu ): + if menu.get_type() == matemenu.TYPE_DIRECTORY and self.__isVisible( menu ): yield menu def getItems( self, menu ): for item in menu.get_contents(): - if item.get_type() == gmenu.TYPE_ENTRY and item.get_desktop_file_id()[-19:] != '-usercustom.desktop' and self.__isVisible( item ): + if item.get_type() == matemenu.TYPE_ENTRY and item.get_desktop_file_id()[-19:] != '-usercustom.desktop' and self.__isVisible( item ): yield item def __isVisible( self, item ): - if item.get_type() == gmenu.TYPE_ENTRY: + if item.get_type() == matemenu.TYPE_ENTRY: return not ( item.get_is_excluded() or item.get_is_nodisplay() ) - if item.get_type() == gmenu.TYPE_DIRECTORY and len( item.get_contents() ): + if item.get_type() == matemenu.TYPE_DIRECTORY and len( item.get_contents() ): return True @@ -332,12 +331,12 @@ class pluginclass( object ): def get_panel(self): self.panel = None self.panel_position = 0 - appletidlist = gconf.client_get_default().get_list("/apps/panel/general/applet_id_list", "string") + appletidlist = mateconf.client_get_default().get_list("/apps/panel/general/applet_id_list", "string") for applet in appletidlist: - bonobo_id = gconf.client_get_default().get_string("/apps/panel/applets/" + applet + "/bonobo_iid") - if bonobo_id == "OAFIID:GNOME_mintMenu": - self.panel = gconf.client_get_default().get_string("/apps/panel/applets/" + applet + "/toplevel_id") - self.panel_position = gconf.client_get_default().get_int("/apps/panel/applets/" + applet + "/position") + 1 + bonobo_id = mateconf.client_get_default().get_string("/apps/panel/applets/" + applet + "/bonobo_iid") + if bonobo_id == "OAFIID:MATE_mintMenu": + self.panel = mateconf.client_get_default().get_string("/apps/panel/applets/" + applet + "/toplevel_id") + self.panel_position = mateconf.client_get_default().get_int("/apps/panel/applets/" + applet + "/position") + 1 def apturl_install(self, widget, pkg_name): os.system("xdg-open apt://" + pkg_name + " &") @@ -489,10 +488,10 @@ class pluginclass( object ): self.minimized = self.gconf.get( "bool", "minimized", False ) # Search tool - self.searchtool = self.gconf.get( "string", "search_command", "gnome-search-tool --named \"%s\" --start" ) + self.searchtool = self.gconf.get( "string", "search_command", "mate-search-tool --named \"%s\" --start" ) if self.searchtool == "beagle-search SEARCH_STRING": - self.searchtool = "gnome-search-tool --named \"%s\" --start" - self.gconf.set( "string", "search_command", "gnome-search-tool --named \"%s\" --start" ) + self.searchtool = "mate-search-tool --named \"%s\" --start" + self.gconf.set( "string", "search_command", "mate-search-tool --named \"%s\" --start" ) # Plugin icon self.icon = self.gconf.get( "string", "icon", "applications-accessories" ) @@ -890,7 +889,7 @@ class pluginclass( object ): removeFromFavMenuItem.connect( "activate", self.onFavoritesRemove, widget ) propsMenuItem.connect( "activate", self.onPropsApp, widget) - if self.de == "gnome": + if self.de == "mate": mTree.get_widget("favoritesMenu").append(desktopMenuItem) mTree.get_widget("favoritesMenu").append(panelMenuItem) mTree.get_widget("favoritesMenu").append(separator1) @@ -943,7 +942,7 @@ class pluginclass( object ): separator3 = gtk.SeparatorMenuItem() propsMenuItem = gtk.MenuItem(_("Edit properties")) - if self.de == "gnome": + if self.de == "mate": mTree.get_widget("applicationsMenu").append(desktopMenuItem) mTree.get_widget("applicationsMenu").append(panelMenuItem) mTree.get_widget("applicationsMenu").append(separator1) @@ -1093,7 +1092,7 @@ class pluginclass( object ): def search_dictionary(self, widget): text = self.searchEntry.get_text() - os.system("gnome-dictionary \"" + text + "\" &") + os.system("mate-dictionary \"" + text + "\" &") self.mintMenuWin.hide() def search_mint_tutorials(self, widget): @@ -1148,7 +1147,7 @@ class pluginclass( object ): def add_to_panel(self, widget, desktopEntry): import random object_name = "mintmenu_"+''.join([random.choice('abcdefghijklmnopqrstuvwxyz0123456789') for x in xrange(8)]) - new_directory = home + "/.gnome2/panel2.d/default/launchers/" + new_directory = home + "/.mate2/panel2.d/default/launchers/" os.system("mkdir -p " + new_directory) new_file = new_directory + object_name @@ -1158,7 +1157,7 @@ class pluginclass( object ): # Add to Gnome/GConf object_dir = "/apps/panel/objects/" - object_client = gconf.client_get_default() + object_client = mateconf.client_get_default() object_client.set_string(object_dir + object_name +"/"+ "menu_path", "applications:/") object_client.set_bool(object_dir + object_name +"/"+ "locked", False) @@ -1177,7 +1176,7 @@ class pluginclass( object ): launchers_list = object_client.get_list("/apps/panel/general/object_id_list", "string") launchers_list.append(object_name) - object_client.set_list("/apps/panel/general/object_id_list", gconf.VALUE_STRING, launchers_list) + object_client.set_list("/apps/panel/general/object_id_list", mateconf.VALUE_STRING, launchers_list) def delete_from_menu(self, widget, desktopEntry): try: @@ -1220,7 +1219,7 @@ class pluginclass( object ): self.mintMenuWin.hide() gtk.gdk.flush() - editProcess = subprocess.Popen(["/usr/bin/gnome-desktop-item-edit", filePath]) + editProcess = subprocess.Popen(["/usr/bin/mate-desktop-item-edit", filePath]) subprocess.Popen.communicate(editProcess) if newFileFlag: @@ -1334,10 +1333,10 @@ class pluginclass( object ): location = string.join( location.split( "%20" ) ) if location.startswith( "file" ): - ButtonIcon = "gnome-fs-directory" + ButtonIcon = "mate-fs-directory" if location.startswith( "smb" ) or location.startswith( "ssh" ) or location.startswith( "network" ): - ButtonIcon = "gnome-fs-network" + ButtonIcon = "mate-fs-network" #For Special locations if location == "x-nautilus-desktop:///computer": @@ -1706,7 +1705,7 @@ class pluginclass( object ): # Reload the menufiles from the filesystem def loadMenuFiles( self ): self.menuFiles = [] - for mainitems in [ "applications.menu", "settings.menu" ]: + for mainitems in [ "mate-applications.menu", "mate-settings.menu" ]: self.menuFiles.append( Menu( mainitems) ) # Build a list of all categories in the menu ( [ { "name", "icon", tooltip" } ] @@ -1717,7 +1716,7 @@ class pluginclass( object ): for menu in self.menuFiles: for child in menu.directory.get_contents(): - if child.get_type() == gmenu.TYPE_DIRECTORY: + if child.get_type() == matemenu.TYPE_DIRECTORY: icon = str(child.icon) #if (icon == "preferences-system"): # self.adminMenu = child.name @@ -1734,27 +1733,27 @@ class pluginclass( object ): def find_applications_recursively(app_list, directory, catName): for item in directory.get_contents(): - if item.get_type() == gmenu.TYPE_ENTRY: + if item.get_type() == matemenu.TYPE_ENTRY: print "=======>>> " + str(item.name) + " = " + str(catName) app_list.append( { "entry": item, "category": catName } ) - elif item.get_type() == gmenu.TYPE_DIRECTORY: + elif item.get_type() == matemenu.TYPE_DIRECTORY: find_applications_recursively(app_list, item, catName) for menu in self.menuFiles: directory = menu.directory for entry in directory.get_contents(): - if entry.get_type() == gmenu.TYPE_DIRECTORY and len(entry.get_contents()): + if entry.get_type() == matemenu.TYPE_DIRECTORY and len(entry.get_contents()): #Entry is a top-level category #catName = entry.name #icon = str(entry.icon) #if (icon == "applications-system" or icon == "applications-other"): # catName = self.adminMenu for item in entry.get_contents(): - if item.get_type() == gmenu.TYPE_DIRECTORY: + if item.get_type() == matemenu.TYPE_DIRECTORY: find_applications_recursively(newApplicationsList, item, entry.name) - elif item.get_type() == gmenu.TYPE_ENTRY: + elif item.get_type() == matemenu.TYPE_ENTRY: newApplicationsList.append( { "entry": item, "category": entry.name } ) - #elif entry.get_type() == gmenu.TYPE_ENTRY: + #elif entry.get_type() == matemenu.TYPE_ENTRY: # if not (entry.get_is_excluded() or entry.get_is_nodisplay()): # print "=======>>> " + item.name + " = top level" # newApplicationsList.append( { "entry": item, "category": "" } ) diff --git a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py index e0e9840..f5b00ac 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py +++ b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py @@ -2,11 +2,11 @@ import gtk import pango -import gnomedesktop +import matedesktop import gobject import os.path import shutil -import gnomevfs +import matevfs import re from execute import * import xdg.DesktopEntry @@ -286,7 +286,7 @@ class ApplicationLauncher( easyButton ): self.appExec = desktopItem.getExec() self.appIconName = desktopItem.getIcon() self.appCategories = desktopItem.getCategories() - self.appGnomeDocPath = desktopItem.get( "X-GNOME-DocPath" ) or "" + self.appGnomeDocPath = desktopItem.get( "X-MATE-DocPath" ) or "" self.useTerminal = desktopItem.getTerminal() if not self.appGnomeDocPath: @@ -396,11 +396,11 @@ class ApplicationLauncher( easyButton ): shutil.copyfile( self.desktopFile, self.startupFilePath ) # Remove %u, etc. from Exec entry, because gnome will not replace them when it starts the app - item = gnomedesktop.item_new_from_uri( self.startupFilePath, gnomedesktop.LOAD_ONLY_IF_EXISTS ) + item = matedesktop.item_new_from_uri( self.startupFilePath, matedesktop.LOAD_ONLY_IF_EXISTS ) if item: r = re.compile("%[A-Za-z]"); - tmp = r.sub("", item.get_string( gnomedesktop.KEY_EXEC ) ).strip() - item.set_string( gnomedesktop.KEY_EXEC, tmp ) + tmp = r.sub("", item.get_string( matedesktop.KEY_EXEC ) ).strip() + item.set_string( matedesktop.KEY_EXEC, tmp ) item.save( self.startupFilePath, 0 ) def removeFromStartup( self ): @@ -431,12 +431,12 @@ class ApplicationLauncher( easyButton ): dn = os.path.dirname( self.appGnomeDocPath ) if self.appGnomeDocPath[0:6] != "ghelp:": self.appGnomeDocPath = "ghelp:" + self.appGnomeDocPath - gnomevfs.url_show( self.appGnomeDocPath ) + matevfs.url_show( self.appGnomeDocPath ) elif self.appKdeDocPath: if self.appKdeDocPath[0:6] != "help:/" and self.appKdeDocPath[0:6] != "file:/": self.appKdeDocPath = "help:/" + self.appKdeDocPath if self.appKdeDocPath[0:6] == "file:/": - gnomevfs.url_show( self.appKdeDocPath ) + matevfs.url_show( self.appKdeDocPath ) else: Execute( [ "khelpcenter", self.appKdeDocPath ] ) diff --git a/usr/lib/linuxmint/mintMenu/plugins/easygconf.py b/usr/lib/linuxmint/mintMenu/plugins/easygconf.py index b46c246..61fed49 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/easygconf.py +++ b/usr/lib/linuxmint/mintMenu/plugins/easygconf.py @@ -1,18 +1,18 @@ #!/usr/bin/env python -import gconf +import mateconf class EasyGConf: def __init__( self, gconfDir = None, client = None ): if not client: - client = gconf.client_get_default() + client = mateconf.client_get_default() self.client = client self.gconfDir = gconfDir - self.client.add_dir( self.gconfDir[:-1], gconf.CLIENT_PRELOAD_NONE ) + self.client.add_dir( self.gconfDir[:-1], mateconf.CLIENT_PRELOAD_NONE ) self.handlerIds = [ ] diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.py b/usr/lib/linuxmint/mintMenu/plugins/places.py index c38c1f8..e44d2e4 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/places.py +++ b/usr/lib/linuxmint/mintMenu/plugins/places.py @@ -3,8 +3,6 @@ import gtk import gtk.glade import os -import gconf -import gnomevfs import string import gettext import commands @@ -132,7 +130,7 @@ class pluginclass( object ): # Hide vertical dotted separator self.hideseparator = self.gconf.get( "bool", "hide_separator", False ) # Plugin icon - self.icon = self.gconf.get( "string", 'icon', "gnome-fs-directory.png" ) + self.icon = self.gconf.get( "string", 'icon', "mate-fs-directory.png" ) # Allow plugin to be minimized to the left plugin pane self.sticky = self.gconf.get( "bool", "sticky", False ) self.minimized = self.gconf.get( "bool", "minimized", False ) @@ -148,7 +146,7 @@ class pluginclass( object ): if ( self.showcomputer == True ): Button1 = easyButton( "computer", self.iconsize, [_("Computer")], -1, -1 ) - if self.de == "gnome": + if self.de == "mate": Button1.connect( "clicked", self.ButtonClicked, "nautilus computer:" ) else: Button1.connect( "clicked", self.ButtonClicked, "xdg-open /" ) @@ -163,8 +161,8 @@ class pluginclass( object ): self.placesBtnHolder.pack_start( Button2, False, False ) self.mintMenuWin.setTooltip( Button2, _("Open your personal folder") ) - if ( self.shownetwork == True and self.de == "gnome"): - gconftheme = EasyGConf( "/desktop/gnome/interface/" ) + if ( self.shownetwork == True and self.de == "mate"): + gconftheme = EasyGConf( "/desktop/mate/interface/" ) icon_theme = gconftheme.get("string", "icon_theme", "Mint-X") if "Mint-X" in icon_theme: Button3 = easyButton( "notification-network-ethernet-connected", self.iconsize, [_("Network")], -1, -1) @@ -189,7 +187,7 @@ class pluginclass( object ): desktopDir = tmpdesktopDir except Exception, detail: print detail - Button4 = easyButton( "gnome-fs-desktop", self.iconsize, [_("Desktop")], -1, -1 ) + Button4 = easyButton( "mate-fs-desktop", self.iconsize, [_("Desktop")], -1, -1 ) Button4.connect( "clicked", self.ButtonClicked, "xdg-open \"" + desktopDir + "\"") Button4.show() self.placesBtnHolder.pack_start( Button4, False, False ) diff --git a/usr/lib/linuxmint/mintMenu/plugins/recent.py b/usr/lib/linuxmint/mintMenu/plugins/recent.py index 371d72d..337ce3e 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/recent.py +++ b/usr/lib/linuxmint/mintMenu/plugins/recent.py @@ -4,7 +4,7 @@ import sys import os import gobject import datetime -import gconf +import mateconf import fcntl import pango from execute import Execute @@ -43,11 +43,11 @@ class pluginclass: self.width = 250 #Plugin icon - self.icon = 'gnome-folder.png' + self.icon = 'mate-folder.png' self.gconf_dir = '/apps/mintMenu/plugins/recent' - self.client = gconf.client_get_default() - self.client.add_dir( '/apps/mintMenu/plugins/recent', gconf.CLIENT_PRELOAD_NONE ) + self.client = mateconf.client_get_default() + self.client.add_dir( '/apps/mintMenu/plugins/recent', mateconf.CLIENT_PRELOAD_NONE ) self.client.notify_add( '/apps/mintMenu/plugins/recent/height', self.RegenPlugin ) self.client.notify_add( '/apps/mintMenu/plugins/recent/width', self.RegenPlugin ) self.client.notify_add( '/apps/mintMenu/plugins/recent/num_recent_docs_to_show', self.RegenPlugin ) @@ -81,7 +81,7 @@ class pluginclass: # Hide vertical dotted separator self.hideseparator = self.gconf.get( "bool", "hide_separator", False ) # Plugin icon - self.icon = self.gconf.get( "string", 'icon', "gnome-fs-directory" ) + self.icon = self.gconf.get( "string", 'icon', "mate-fs-directory" ) # Allow plugin to be minimized to the left plugin pane self.sticky = self.gconf.get( "bool", "sticky", False ) self.minimized = self.gconf.get( "bool", "minimized", False ) @@ -165,7 +165,7 @@ class pluginclass: def callback(self, widget, filename=None): self.Win.hide() - x = os.system("gnome-open \""+filename+"\"") + x = os.system("mate-open \""+filename+"\"") if x == 256: dia = gtk.Dialog('File not found!', None, #the toplevel wgt of your app diff --git a/usr/lib/linuxmint/mintMenu/plugins/system_management.py b/usr/lib/linuxmint/mintMenu/plugins/system_management.py index dcc4069..39c9dc8 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/system_management.py +++ b/usr/lib/linuxmint/mintMenu/plugins/system_management.py @@ -3,8 +3,6 @@ import gtk import gtk.glade import os -import gconf -import gnomevfs import string import gettext @@ -150,13 +148,13 @@ class pluginclass( object ): if self.de == "xfce": Button3.connect( "clicked", self.ButtonClicked, "xfce4-settings-manager" ) else: - Button3.connect( "clicked", self.ButtonClicked, "gnome-control-center" ) + Button3.connect( "clicked", self.ButtonClicked, "mate-control-center" ) Button3.show() self.systemBtnHolder.pack_start( Button3, False, False ) self.mintMenuWin.setTooltip( Button3, _("Configure your system") ) if ( self.showTerminal == True ): - Button4 = easyButton( "gnome-terminal", self.iconsize, [_("Terminal")], -1, -1 ) + Button4 = easyButton( "mate-terminal", self.iconsize, [_("Terminal")], -1, -1 ) Button4.connect( "clicked", self.ButtonClicked, "x-terminal-emulator" ) Button4.show() self.systemBtnHolder.pack_start( Button4, False, False ) @@ -178,14 +176,14 @@ class pluginclass( object ): if ( self.showLogout == True ): Button6 = easyButton( "system-log-out", self.iconsize, [_("Logout")], -1, -1 ) - Button6.connect( "clicked", self.ButtonClicked, "gnome-session-save --logout-dialog" ) + Button6.connect( "clicked", self.ButtonClicked, "mate-session-save --logout-dialog" ) Button6.show() self.systemBtnHolder.pack_start( Button6, False, False ) self.mintMenuWin.setTooltip( Button6, _("Log out or switch user") ) if ( self.showQuit == True ): Button7 = easyButton( "system-shutdown", self.iconsize, [_("Quit")], -1, -1 ) - Button7.connect( "clicked", self.ButtonClicked, "gnome-session-save --shutdown-dialog" ) + Button7.connect( "clicked", self.ButtonClicked, "mate-session-save --shutdown-dialog" ) Button7.show() self.systemBtnHolder.pack_start( Button7, False, False ) self.mintMenuWin.setTooltip( Button7, _("Shutdown, restart, suspend or hibernate") ) diff --git a/usr/lib/bonobo/servers/mintMenu.server b/usr/lib/matecomponent/servers/mintMenu.server similarity index 58% rename from usr/lib/bonobo/servers/mintMenu.server rename to usr/lib/matecomponent/servers/mintMenu.server index 1a3a169..7844536 100755 --- a/usr/lib/bonobo/servers/mintMenu.server +++ b/usr/lib/matecomponent/servers/mintMenu.server @@ -1,25 +1,25 @@ - - - + + - + - + - - - + + + - +