Don't omit "open folder" option in playlist for current file

This commit is contained in:
Et0h 2017-01-19 21:53:31 +00:00
parent 94e54a4f65
commit 976dc99afd

View File

@ -510,16 +510,16 @@ class MainWindow(QtGui.QMainWindow):
if item: if item:
firstFile = item.sibling(item.row(), 0).data() 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 self._syncplayClient.userlist.currentUser.file is None or firstFile <> self._syncplayClient.userlist.currentUser.file["name"]:
if isURL(firstFile): if isURL(firstFile):
menu.addAction(QtGui.QPixmap(resourcespath + u"world_go.png"), getMessage("openstreamurl-menu-label"), lambda: self.openFile(firstFile)) menu.addAction(QtGui.QPixmap(resourcespath + u"world_go.png"), getMessage("openstreamurl-menu-label"), lambda: self.openFile(firstFile))
else: elif pathFound:
pathFound = self._syncplayClient.fileSwitch.findFilepath(firstFile)
if pathFound:
menu.addAction(QtGui.QPixmap(resourcespath + u"film_go.png"), getMessage("openmedia-menu-label"), lambda: self.openFile(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"), if pathFound:
getMessage('open-containing-folder'), menu.addAction(QtGui.QPixmap(resourcespath + u"folder_film.png"),
lambda: utils.open_system_file_browser(pathFound)) getMessage('open-containing-folder'),
lambda: utils.open_system_file_browser(pathFound))
if self._syncplayClient.isUntrustedTrustableURI(firstFile): if self._syncplayClient.isUntrustedTrustableURI(firstFile):
domain = utils.getDomainFromURL(firstFile) domain = utils.getDomainFromURL(firstFile)
menu.addAction(QtGui.QPixmap(resourcespath + u"shield_add.png"),getMessage("addtrusteddomain-menu-label").format(domain), lambda: self.addTrustedDomain(domain)) menu.addAction(QtGui.QPixmap(resourcespath + u"shield_add.png"),getMessage("addtrusteddomain-menu-label").format(domain), lambda: self.addTrustedDomain(domain))