mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-28 00:39:37 -05:00
When using <img>, put the src in quotes. Otherwise the filename is likely to have spaces in it, and the <img> src will break. Also, in Windows use backslashes for local resources instead of forward slashes
This commit is contained in:
parent
f41ad976ea
commit
3797e9e203
@ -57,7 +57,7 @@ def get_platform():
|
||||
"""
|
||||
Returns the platform OnionShare is running on.
|
||||
"""
|
||||
plat = platform.system()
|
||||
plat = platform.system()
|
||||
if re.match('^.*BSD$', plat):
|
||||
plat = 'BSD'
|
||||
return plat
|
||||
@ -69,6 +69,10 @@ def get_resource_path(filename):
|
||||
"""
|
||||
p = get_platform()
|
||||
|
||||
# On Windows, and in Windows dev mode, switch slashes in incoming filename to backslackes
|
||||
if p == 'Windows':
|
||||
filename = filename.replace('/', '\\')
|
||||
|
||||
if getattr(sys, 'onionshare_dev_mode', False):
|
||||
# Look for resources directory relative to python file
|
||||
prefix = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))), 'share')
|
||||
|
@ -684,7 +684,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||
self.info_completed_downloads_image = common.get_resource_path('images/download_completed_none.png')
|
||||
else:
|
||||
self.info_completed_downloads_image = common.get_resource_path('images/download_completed.png')
|
||||
self.info_completed_downloads_count.setText('<img src={0:s} /> {1:d}'.format(self.info_completed_downloads_image, count))
|
||||
self.info_completed_downloads_count.setText('<img src="{0:s}" /> {1:d}'.format(self.info_completed_downloads_image, count))
|
||||
self.info_completed_downloads_count.setToolTip(strings._('info_completed_downloads_tooltip', True).format(count))
|
||||
|
||||
def update_downloads_in_progress(self, count):
|
||||
@ -695,7 +695,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||
self.info_in_progress_downloads_image = common.get_resource_path('images/download_in_progress_none.png')
|
||||
else:
|
||||
self.info_in_progress_downloads_image = common.get_resource_path('images/download_in_progress.png')
|
||||
self.info_in_progress_downloads_count.setText('<img src={0:s} /> {1:d}'.format(self.info_in_progress_downloads_image, count))
|
||||
self.info_in_progress_downloads_count.setText('<img src="{0:s}" /> {1:d}'.format(self.info_in_progress_downloads_image, count))
|
||||
self.info_in_progress_downloads_count.setToolTip(strings._('info_in_progress_downloads_tooltip', True).format(count))
|
||||
|
||||
def closeEvent(self, e):
|
||||
|
Loading…
Reference in New Issue
Block a user