mirror of
https://github.com/Syncplay/syncplay
synced 2024-12-14 19:04:57 +00:00
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",
|
||||
"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
|
||||
"addusersstreamstoplaylist-menu-label" : u"Add {} stream to playlist", # item owner indicator
|
||||
"openusersstream-menu-label" : u"Open {} stream", # [username]'s
|
||||
|
@ -577,6 +577,10 @@ class MainWindow(QtGui.QMainWindow):
|
||||
if self._syncplayClient.isUntrustedTrustableURI(filename):
|
||||
domain = utils.getDomainFromURL(filename)
|
||||
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:
|
||||
return
|
||||
menu.exec_(self.listTreeView.viewport().mapToGlobal(position))
|
||||
|
@ -12,6 +12,8 @@ import string
|
||||
import urllib
|
||||
import ast
|
||||
import unicodedata
|
||||
import platform
|
||||
import subprocess
|
||||
|
||||
folderSearchEnabled = True
|
||||
|
||||
@ -311,6 +313,17 @@ def getDomainFromURL(URL):
|
||||
except:
|
||||
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():
|
||||
try:
|
||||
import urllib, syncplay, sys, messages, json
|
||||
|
Loading…
Reference in New Issue
Block a user