Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lafenghu
alacarte
alacarte-support-exo-desktop-item-edit.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File alacarte-support-exo-desktop-item-edit.patch of Package alacarte
Index: alacarte-0.13.4/Alacarte/MainWindow.py =================================================================== --- alacarte-0.13.4.orig/Alacarte/MainWindow.py +++ alacarte-0.13.4/Alacarte/MainWindow.py @@ -36,6 +36,7 @@ class MainWindow(object): #hack to make editing menu properties work allow_update = True edit_pool = [] + desktop_item_editor = util.getCommandPath(['gnome-desktop-item-edit', 'exo-desktop-item-edit']) def __init__(self, datadir, version): self.file_path = datadir @@ -264,7 +265,7 @@ class MainWindow(object): else: parent = menus[iter][2] file_path = os.path.join(util.getUserDirectoryPath(), util.getUniqueFileId('alacarte-made', '.directory')) - process = subprocess.Popen(['gnome-desktop-item-edit', file_path], env=os.environ) + process = subprocess.Popen([self.desktop_item_editor, file_path], env=os.environ) GObject.timeout_add(100, self.waitForNewMenuProcess, process, parent.get_menu_id(), file_path) def on_new_item_button_clicked(self, button): @@ -277,7 +278,7 @@ class MainWindow(object): else: parent = menus[iter][2] file_path = os.path.join(util.getUserItemPath(), util.getUniqueFileId('alacarte-made', '.desktop')) - process = subprocess.Popen(['gnome-desktop-item-edit', file_path], env=os.environ) + process = subprocess.Popen([self.desktop_item_editor, file_path], env=os.environ) GObject.timeout_add(100, self.waitForNewItemProcess, process, parent.get_menu_id(), file_path) def on_new_separator_button_clicked(self, button): @@ -338,7 +339,7 @@ class MainWindow(object): if file_path not in self.edit_pool: self.edit_pool.append(file_path) - process = subprocess.Popen(['gnome-desktop-item-edit', file_path], env=os.environ) + process = subprocess.Popen([self.desktop_item_editor, file_path], env=os.environ) GObject.timeout_add(100, self.waitForEditProcess, process, file_path) def on_menu_tree_cursor_changed(self, treeview): Index: alacarte-0.13.4/Alacarte/util.py =================================================================== --- alacarte-0.13.4.orig/Alacarte/util.py +++ alacarte-0.13.4/Alacarte/util.py @@ -107,6 +107,15 @@ def getUserDirectoryPath(): os.makedirs(menu_dir) return menu_dir +def getCommandPath(commands): + paths = os.environ['PATH'].split(os.pathsep) + for command in commands: + for path in paths: + command_path = os.path.join(path, command) + if os.access(command_path, os.X_OK): + return command_path + return None + def getUserMenuPath(): menu_dir = os.path.join(GLib.get_user_config_dir(), 'menus') if not os.path.isdir(menu_dir):
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor