Changed the app icon, also included it in the About box.

master
Pacman Ghost 5 years ago
parent 2845ce5aeb
commit b1639ebf66
  1. 33
      vasl_templates/about.py
  2. 225
      vasl_templates/ui/about.ui
  3. 1
      vasl_templates/webapp/config/constants.py
  4. BIN
      vasl_templates/webapp/static/images/app.ico
  5. BIN
      vasl_templates/webapp/static/images/app.snag

@ -1,14 +1,18 @@
"""Implement the "about" dialog."""
import sys
import os
import json
import time
import io
import re
from PyQt5 import uic
from PyQt5 import uic, QtCore
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QDesktopServices, QIcon, QCursor
from PyQt5.QtWidgets import QDialog
from vasl_templates.webapp.config.constants import APP_NAME, APP_VERSION, BASE_DIR
from vasl_templates.webapp.config.constants import APP_NAME, APP_VERSION, APP_HOME_URL, BASE_DIR, IS_FROZEN
# ---------------------------------------------------------------------
@ -22,11 +26,21 @@ class AboutDialog( QDialog ):
# initialize the UI
base_dir = os.path.split( __file__ )[0]
dname = os.path.join( base_dir, "ui/about.ui" )
uic.loadUi( dname, self )
fname = os.path.join( base_dir, "ui/about.ui" )
uic.loadUi( fname, self )
self.setFixedSize( self.size() )
self.close_button.clicked.connect( self.on_close )
# initialize the UI
if IS_FROZEN:
dname = os.path.join( sys._MEIPASS, "vasl_templates/webapp" ) #pylint: disable=no-member,protected-access
else:
dname = os.path.join( os.path.split(__file__)[0], "webapp" )
fname = os.path.join( dname, "static/images/app.ico" )
self.app_icon.setPixmap( QIcon( fname ).pixmap(64,64) )
self.app_icon.mouseReleaseEvent = self.on_app_icon_clicked
self.app_icon.setCursor( QCursor( QtCore.Qt.PointingHandCursor ) )
# get the build info
dname = os.path.join( BASE_DIR, "config" )
fname = os.path.join( dname, "build-info.json" )
@ -53,9 +67,14 @@ class AboutDialog( QDialog ):
self.build_info.setText( buf.getvalue() )
else:
self.build_info.setText( "" )
self.home_url.setText(
"Get the source code and releases from <a href='http://github.com/pacman-ghost/vasl-templates'>Github</a>."
)
mo = re.search( r"^https?://(.+)", APP_HOME_URL )
self.home_url.setText( "Visit us at <a href='{}'>{}</a>.".format(
APP_HOME_URL, mo.group(1) if mo else APP_HOME_URL
) )
def on_app_icon_clicked( self, event ): #pylint: disable=no-self-use,unused-argument
"""Click handler."""
QDesktopServices.openUrl( QUrl( APP_HOME_URL ) )
def on_close( self ):
"""Close the dialog."""

@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>428</width>
<height>142</height>
<width>410</width>
<height>150</height>
</rect>
</property>
<property name="windowTitle">
@ -19,113 +19,130 @@
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="app_name">
<property name="font">
<font>
<family>DejaVu Sans</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>*** APP NAME ***</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="build_info">
<property name="text">
<string>*** BUILD INFO ***</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="home_url">
<property name="text">
<string>*** HOME URL ***</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="license">
<property name="text">
<string>Licensed under the GNU Affero General Public License (v3).</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>5</number>
<widget class="QLabel" name="app_icon">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>64</width>
<height>64</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>80</x>
<y>20</y>
<width>321</width>
<height>44</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="app_name">
<property name="font">
<font>
<family>DejaVu Sans</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="leftMargin">
<number>0</number>
<property name="text">
<string>*** APP NAME ***</string>
</property>
<property name="topMargin">
<number>0</number>
</widget>
</item>
<item>
<widget class="QLabel" name="build_info">
<property name="font">
<font>
<family>DejaVu Sans</family>
<italic>true</italic>
</font>
</property>
<property name="rightMargin">
<number>0</number>
<property name="text">
<string>*** BUILD INFO ***</string>
</property>
<property name="bottomMargin">
<number>0</number>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>110</y>
<width>391</width>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>309</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="close_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Close</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
<property name="sizeHint" stdset="0">
<size>
<width>309</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="close_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Close</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="home_url">
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>391</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>*** HOME URL ***</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="license">
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<width>388</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Licensed under the GNU Affero General Public License (v3).</string>
</property>
</widget>
</widget>
<resources/>
<connections/>

@ -6,6 +6,7 @@ import os
APP_NAME = "VASL Templates"
APP_VERSION = "v0.10" # nb: also update setup.py
APP_DESCRIPTION = "Generate HTML for use in VASL scenarios."
APP_HOME_URL = "https://vasl-templates.org"
if getattr( sys, "frozen", False ):
IS_FROZEN = True

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Loading…
Cancel
Save