Merge pull request #124 from monsta/fix-add-to-desktop
properly create a desktop shortcut from a menu entry
This commit is contained in:
commit
2d9544357b
2
debian/control
vendored
2
debian/control
vendored
@ -13,7 +13,7 @@ Depends:
|
|||||||
python (>= 2.4), python (<< 3),
|
python (>= 2.4), python (<< 3),
|
||||||
python-gtk2, python-glade2,
|
python-gtk2, python-glade2,
|
||||||
mint-common,
|
mint-common,
|
||||||
python-mate-menu, python-xdg,
|
python-mate-menu, python-xdg, xdg-utils,
|
||||||
libmatepanelapplet, libmatedesktop,
|
libmatepanelapplet, libmatedesktop,
|
||||||
mate-menus,
|
mate-menus,
|
||||||
gvfs-bin,
|
gvfs-bin,
|
||||||
|
@ -1179,24 +1179,8 @@ class pluginclass( object ):
|
|||||||
os.system("xdg-open \"http://community.linuxmint.com/index.php/software/search/0/" + text + "\" &")
|
os.system("xdg-open \"http://community.linuxmint.com/index.php/software/search/0/" + text + "\" &")
|
||||||
self.mintMenuWin.hide()
|
self.mintMenuWin.hide()
|
||||||
|
|
||||||
|
|
||||||
def add_to_desktop(self, widget, desktopEntry):
|
def add_to_desktop(self, widget, desktopEntry):
|
||||||
try:
|
os.system("xdg-desktop-icon install --novendor %s" % desktopEntry.desktopFile)
|
||||||
# Determine where the Desktop folder is (could be localized)
|
|
||||||
import sys, commands
|
|
||||||
sys.path.append('/usr/lib/linuxmint/common')
|
|
||||||
from configobj import ConfigObj
|
|
||||||
config = ConfigObj(home + "/.config/user-dirs.dirs")
|
|
||||||
desktopDir = home + "/Desktop"
|
|
||||||
tmpdesktopDir = config['XDG_DESKTOP_DIR']
|
|
||||||
tmpdesktopDir = commands.getoutput("echo " + tmpdesktopDir)
|
|
||||||
if os.path.exists(tmpdesktopDir):
|
|
||||||
desktopDir = tmpdesktopDir
|
|
||||||
# Copy the desktop file to the desktop
|
|
||||||
os.system("cp \"%s\" \"%s/\"" % (desktopEntry.desktopFile, desktopDir))
|
|
||||||
os.system("chmod a+rx %s/*.desktop" % (desktopDir))
|
|
||||||
except Exception, detail:
|
|
||||||
print detail
|
|
||||||
|
|
||||||
def add_to_panel(self, widget, desktopEntry):
|
def add_to_panel(self, widget, desktopEntry):
|
||||||
self.get_panel()
|
self.get_panel()
|
||||||
|
Loading…
Reference in New Issue
Block a user