mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 09:52:37 +02:00
Move Windows icon into share, and make get_resource_path work in Windows
This commit is contained in:
parent
f0428c775b
commit
583f8de8ff
6 changed files with 15 additions and 7 deletions
|
@ -250,17 +250,25 @@ class Common(object):
|
|||
)
|
||||
else:
|
||||
if platform.system() == "Darwin":
|
||||
# macOS
|
||||
prefix = os.path.join(
|
||||
os.path.dirname(os.path.dirname(sys.executable)), "Resources/share"
|
||||
)
|
||||
elif platform.system() == "Linux":
|
||||
prefix = os.path.join(sys.prefix, "share", "dangerzone")
|
||||
else:
|
||||
# Linux
|
||||
prefix = os.path.join(sys.prefix, "share/dangerzone")
|
||||
# Windows
|
||||
prefix = os.path.join(os.path.dirname(sys.executable), "share")
|
||||
|
||||
resource_path = os.path.join(prefix, filename)
|
||||
return resource_path
|
||||
|
||||
def get_window_icon(self):
|
||||
if platform.system() == "Windows":
|
||||
path = self.get_resource_path("dangerzone.ico")
|
||||
else:
|
||||
path = self.get_resource_path("logo.png")
|
||||
return QtGui.QIcon(path)
|
||||
|
||||
def open_find_viewer(self, filename):
|
||||
if self.settings.get("open_app") in self.pdf_viewers:
|
||||
if platform.system() == "Darwin":
|
||||
|
|
|
@ -51,7 +51,7 @@ class DockerInstaller(QtWidgets.QDialog):
|
|||
self.common = common
|
||||
|
||||
self.setWindowTitle("dangerzone")
|
||||
self.setWindowIcon(QtGui.QIcon(self.common.get_resource_path("logo.png")))
|
||||
self.setWindowIcon(self.common.get_window_icon())
|
||||
|
||||
label = QtWidgets.QLabel()
|
||||
if platform.system() == "Darwin":
|
||||
|
|
|
@ -13,7 +13,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
self.common = common
|
||||
|
||||
self.setWindowTitle("dangerzone")
|
||||
self.setWindowIcon(QtGui.QIcon(self.common.get_resource_path("logo.png")))
|
||||
self.setWindowIcon(self.common.get_window_icon())
|
||||
|
||||
self.setMinimumWidth(600)
|
||||
self.setMinimumHeight(400)
|
||||
|
|
|
@ -24,7 +24,7 @@ else:
|
|||
datas = [("../../share", "share")]
|
||||
|
||||
if p == "Windows":
|
||||
icon = os.path.join(root, "install", "windows", "dangerzone.ico")
|
||||
icon = os.path.join(root, "share", "dangerzone.ico")
|
||||
else:
|
||||
icon = None
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<Package Id="*" Keywords="Installer" Description="Dangerzone $(var.ProductVersion) Installer" Manufacturer="First Look Media" InstallerVersion="100" Languages="1033" Compressed="yes" SummaryCodepage="1252" />
|
||||
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
|
||||
|
||||
<Icon Id="ProductIcon" SourceFile="..\..\install\windows\dangerzone.ico"/>
|
||||
<Icon Id="ProductIcon" SourceFile="..\..\share\dangerzone.ico"/>
|
||||
<Property Id="ARPPRODUCTICON" Value="ProductIcon"/>
|
||||
<Property Id="ARPHELPLINK" Value="https://github.com/firstlookmedia/dangerzone"/>
|
||||
<Property Id="ARPURLINFOABOUT" Value="https://tech.firstlook.media"/>
|
||||
|
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
Loading…
Reference in a new issue