def loadDesktopEntry( self, desktopItem ): try: self.appName = desktopItem.getName() self.appGenericName = desktopItem.getGenericName() self.appComment = desktopItem.getComment() self.appExec = desktopItem.getExec() self.appIconName = desktopItem.getIcon() self.appCategories = desktopItem.getCategories() self.appGnomeDocPath = desktopItem.get( "X-GNOME-DocPath" ) or "" self.useTerminal = desktopItem.getTerminal() if not self.appGnomeDocPath: self.appKdeDocPath = desktopItem.getDocPath() or "" self.appName = self.appName.strip() self.appGenericName = self.appGenericName.strip() self.appComment = self.appComment.strip() basename = os.path.basename( self.desktopFile ) self.startupFilePath = os.path.join( os.path.expanduser("~"), ".config", "autostart", basename ) if self.startupMonitorId: filemonitor.removeMonitor( self.startupMonitorId ) self.startupMonitorId = filemonitor.addMonitor( self.startupFilePath, self.startupFileChanged ) #self.inStartup = os.path.exists( self.startupFilePath ) except Exception, e: print e self.appName = "" self.appGenericName = "" self.appComment = "" self.appExec = "" self.appIconName = "" self.appCategories = "" self.appDocPath = "" self.startupMonitorId = 0
def destroy( self ): self.content_holder.destroy() self.searchEntry.destroy() self.searchButton.destroy() self.showAllAppsButton.destroy() self.showFavoritesButton.destroy() self.applicationsBox.destroy() self.categoriesBox.destroy() self.favoritesBox.destroy() self.gconf.notifyRemoveAll() for mId in self.menuFileMonitors: filemonitor.removeMonitor( mId )
def loadDesktopEntry(self, desktopItem): try: self.appName = self.strip_accents(desktopItem.getName()) self.appGenericName = self.strip_accents( desktopItem.getGenericName()) self.appComment = self.strip_accents(desktopItem.getComment()) self.appExec = self.strip_accents(desktopItem.getExec()) self.appIconName = desktopItem.getIcon() self.appCategories = desktopItem.getCategories() self.appUkuiDocPath = desktopItem.get("X-MATE-DocPath") or "" self.useTerminal = desktopItem.getTerminal() self.appPath = desktopItem.getPath() self.appNoDisplay = desktopItem.getNoDisplay() self.appType = desktopItem.getType() if not self.appUkuiDocPath: self.appKdeDocPath = desktopItem.getDocPath() or "" if not self.appIconName: self.appIconName = 'system-run' self.appName = self.appName.strip() self.appGenericName = self.appGenericName.strip() self.appComment = self.appComment.strip() configPath = os.environ.get( "XDG_CONFIG_HOME", os.path.join(os.environ["HOME"], ".config")) basename = os.path.basename(self.desktopFile) self.startupFilePath = os.path.join(configPath, "autostart", basename) if self.startupMonitorId: filemonitor.removeMonitor(self.startupMonitorId) if os.path.exists(self.startupFilePath): self.startupMonitorId = filemonitor.addMonitor( self.startupFilePath, self.startupFileChanged) except Exception, e: print e self.appName = "" self.appGenericName = "" self.appComment = "" self.appExec = "" self.appIconName = "" self.appCategories = "" self.appDocPath = "" self.startupMonitorId = 0
def loadDesktopEntry(self, desktopItem): try: self.appName = self.strip_accents(desktopItem.getName()) self.appGenericName = self.strip_accents( desktopItem.getGenericName()) self.appComment = self.strip_accents(desktopItem.getComment()) self.appExec = self.strip_accents(desktopItem.getExec().replace( '\\\\', '\\')) self.appIconName = desktopItem.getIcon() self.appCategories = desktopItem.getCategories() self.appMateDocPath = desktopItem.get("X-MATE-DocPath") or "" self.useTerminal = desktopItem.getTerminal() self.appPath = desktopItem.getPath() if not self.appMateDocPath: self.appKdeDocPath = desktopItem.getDocPath() or "" self.appName = self.appName.strip() self.appGenericName = self.appGenericName.strip() self.appComment = self.appComment.strip() basename = os.path.basename(self.desktopFile) self.startupFilePath = os.path.join(os.path.expanduser("~"), ".config", "autostart", basename) if self.startupMonitorId: filemonitor.removeMonitor(self.startupMonitorId) if os.path.exists(self.startupFilePath): self.startupMonitorId = filemonitor.addMonitor( self.startupFilePath, self.startupFileChanged) except Exception, e: print e self.appName = "" self.appGenericName = "" self.appComment = "" self.appExec = "" self.appIconName = "" self.appCategories = "" self.appDocPath = "" self.startupMonitorId = 0
def onDestroy( self, widget ): easyButton.onDestroy( self, widget ) if self.startupMonitorId: filemonitor.removeMonitor( self.startupMonitorId ) for id in self.desktopEntryMonitors: filemonitor.removeMonitor( id )
def onDestroy(self, widget): easyButton.onDestroy(self, widget) if self.startupMonitorId: filemonitor.removeMonitor(self.startupMonitorId) for id in self.desktopEntryMonitors: filemonitor.removeMonitor(id)