mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-26 09:21:23 -05:00
Fix syntax for opening explorer and selecting the filename. Fix a bug in the downloads_dir for Windows (need to use a backslash)
This commit is contained in:
parent
388f968556
commit
f45eae5768
@ -105,8 +105,12 @@ class Settings(object):
|
|||||||
"""
|
"""
|
||||||
Returns the path of the default Downloads directory for receive mode.
|
Returns the path of the default Downloads directory for receive mode.
|
||||||
"""
|
"""
|
||||||
# TODO: Test in Windows, though it looks like it should work
|
# On Windows, os.path.expanduser() needs to use backslash, or else it
|
||||||
# https://docs.python.org/3/library/os.path.html#os.path.expanduser
|
# retains the forward slash, which breaks opening the folder in explorer.
|
||||||
|
p = platform.system()
|
||||||
|
if p == 'Windows':
|
||||||
|
return os.path.expanduser('~\OnionShare')
|
||||||
|
else:
|
||||||
return os.path.expanduser('~/OnionShare')
|
return os.path.expanduser('~/OnionShare')
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
|
@ -96,7 +96,7 @@ class File(QtWidgets.QWidget):
|
|||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
elif self.common.platform == 'Windows':
|
elif self.common.platform == 'Windows':
|
||||||
subprocess.Popen(['explorer', '/select', abs_filename])
|
subprocess.Popen(['explorer', '/select,{}'.format(abs_filename)])
|
||||||
|
|
||||||
|
|
||||||
class Upload(QtWidgets.QWidget):
|
class Upload(QtWidgets.QWidget):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user