From 976dc99afd24b75647075b427ac5952418974042 Mon Sep 17 00:00:00 2001 From: Et0h Date: Thu, 19 Jan 2017 21:53:31 +0000 Subject: [PATCH] Don't omit "open folder" option in playlist for current file --- syncplay/ui/gui.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index 5ce72a8..0aa6730 100644 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -510,16 +510,16 @@ class MainWindow(QtGui.QMainWindow): if item: firstFile = item.sibling(item.row(), 0).data() + pathFound = self._syncplayClient.fileSwitch.findFilepath(firstFile) if not isURL(firstFile) else None if self._syncplayClient.userlist.currentUser.file is None or firstFile <> self._syncplayClient.userlist.currentUser.file["name"]: if isURL(firstFile): menu.addAction(QtGui.QPixmap(resourcespath + u"world_go.png"), getMessage("openstreamurl-menu-label"), lambda: self.openFile(firstFile)) - else: - pathFound = self._syncplayClient.fileSwitch.findFilepath(firstFile) - if pathFound: + elif pathFound: menu.addAction(QtGui.QPixmap(resourcespath + u"film_go.png"), getMessage("openmedia-menu-label"), lambda: self.openFile(pathFound)) - menu.addAction(QtGui.QPixmap(resourcespath + u"folder_film.png"), - getMessage('open-containing-folder'), - lambda: utils.open_system_file_browser(pathFound)) + if pathFound: + menu.addAction(QtGui.QPixmap(resourcespath + u"folder_film.png"), + getMessage('open-containing-folder'), + lambda: utils.open_system_file_browser(pathFound)) if self._syncplayClient.isUntrustedTrustableURI(firstFile): domain = utils.getDomainFromURL(firstFile) menu.addAction(QtGui.QPixmap(resourcespath + u"shield_add.png"),getMessage("addtrusteddomain-menu-label").format(domain), lambda: self.addTrustedDomain(domain))