Added 'Open folder containing this file'
This commit is contained in:
parent
ddae114694
commit
e60e1054e1
@ -409,6 +409,7 @@ en = {
|
|||||||
"addurlstoplaylist-menu-label" : u"Add URL(s) to bottom of playlist",
|
"addurlstoplaylist-menu-label" : u"Add URL(s) to bottom of playlist",
|
||||||
"editplaylist-menu-label": u"Edit playlist",
|
"editplaylist-menu-label": u"Edit playlist",
|
||||||
|
|
||||||
|
"open-containing-folder": u"Open folder containing this file",
|
||||||
"addusersfiletoplaylist-menu-label" : u"Add {} file to playlist", # item owner indicator
|
"addusersfiletoplaylist-menu-label" : u"Add {} file to playlist", # item owner indicator
|
||||||
"addusersstreamstoplaylist-menu-label" : u"Add {} stream to playlist", # item owner indicator
|
"addusersstreamstoplaylist-menu-label" : u"Add {} stream to playlist", # item owner indicator
|
||||||
"openusersstream-menu-label" : u"Open {} stream", # [username]'s
|
"openusersstream-menu-label" : u"Open {} stream", # [username]'s
|
||||||
|
|||||||
@ -577,6 +577,10 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
if self._syncplayClient.isUntrustedTrustableURI(filename):
|
if self._syncplayClient.isUntrustedTrustableURI(filename):
|
||||||
domain = utils.getDomainFromURL(filename)
|
domain = utils.getDomainFromURL(filename)
|
||||||
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))
|
||||||
|
|
||||||
|
if not isURL(filename):
|
||||||
|
path = self._syncplayClient.fileSwitch.findFilepath(filename)
|
||||||
|
menu.addAction(QtGui.QPixmap(resourcespath + u"film_folder_edit.png"), getMessage('open-containing-folder'), lambda: utils.open_system_file_browser(path))
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
menu.exec_(self.listTreeView.viewport().mapToGlobal(position))
|
menu.exec_(self.listTreeView.viewport().mapToGlobal(position))
|
||||||
|
|||||||
@ -12,6 +12,8 @@ import string
|
|||||||
import urllib
|
import urllib
|
||||||
import ast
|
import ast
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
|
||||||
folderSearchEnabled = True
|
folderSearchEnabled = True
|
||||||
|
|
||||||
@ -311,6 +313,17 @@ def getDomainFromURL(URL):
|
|||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def open_system_file_browser(path):
|
||||||
|
if isURL(path):
|
||||||
|
return
|
||||||
|
path = os.path.dirname(path)
|
||||||
|
if platform.system() == "Windows":
|
||||||
|
os.startfile(path)
|
||||||
|
elif platform.system() == "Darwin":
|
||||||
|
subprocess.Popen(["open", path])
|
||||||
|
else:
|
||||||
|
subprocess.Popen(["xdg-open", path])
|
||||||
|
|
||||||
def getListOfPublicServers():
|
def getListOfPublicServers():
|
||||||
try:
|
try:
|
||||||
import urllib, syncplay, sys, messages, json
|
import urllib, syncplay, sys, messages, json
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user