parent
42610a6eb7
commit
6eba63909a
@ -0,0 +1,41 @@ |
|||||||
|
import os |
||||||
|
|
||||||
|
from PyQt5 import uic |
||||||
|
from PyQt5.QtWidgets import QDialog , QFrame |
||||||
|
from PyQt5.QtGui import QPixmap |
||||||
|
|
||||||
|
from constants import * |
||||||
|
import globals |
||||||
|
|
||||||
|
# --------------------------------------------------------------------- |
||||||
|
|
||||||
|
class AboutWidget( QDialog ) : |
||||||
|
"""Show an About box.""" |
||||||
|
|
||||||
|
def __init__( self , parent ) : |
||||||
|
# initialize |
||||||
|
super().__init__() |
||||||
|
# initialize the widget |
||||||
|
uic.loadUi( os.path.join(globals.base_dir,"ui/about_widget.ui") , self ) |
||||||
|
self.setMinimumSize( self.size() ) |
||||||
|
self.lbl_app_icon.setPixmap( |
||||||
|
QPixmap( os.path.join( globals.base_dir , "resources/app.ico" ) ) |
||||||
|
) |
||||||
|
self.lbl_app_icon.setFrameStyle( QFrame.NoFrame ) |
||||||
|
self.lbl_app_name.setText( "<html> {} <small>({})</small> </html>".format( APP_NAME , APP_VERSION ) ) |
||||||
|
self.lbl_avatar.setPixmap( |
||||||
|
QPixmap( os.path.join( globals.base_dir , "resources/pacman-ghost.png" ) ) \ |
||||||
|
.scaled( self.lbl_avatar.size() ) |
||||||
|
) |
||||||
|
self.lbl_avatar.setFrameStyle( QFrame.NoFrame ) |
||||||
|
# load the dialog |
||||||
|
try : |
||||||
|
with open( os.path.join( globals.base_dir , "license.txt" ) , "r" ) as fp : |
||||||
|
buf = fp.read() |
||||||
|
except Exception as ex : |
||||||
|
buf = str(ex) |
||||||
|
self.lbl_license.setText( buf ) |
||||||
|
self.lbl_license.setFrameStyle( QFrame.NoFrame ) |
||||||
|
# connect our handlers |
||||||
|
self.btn_ok.clicked.connect( self.close ) |
||||||
|
|
@ -0,0 +1,11 @@ |
|||||||
|
This software is provided 'as-is', without any express or implied warranty. |
||||||
|
|
||||||
|
In no event will the author be held liable for any damages arising from the use of this software. |
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any non-commercial purpose and to alter it and redistribute it freely, subject to the following restrictions: |
||||||
|
|
||||||
|
(*) The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software, an acknowledgment is requested but not required. |
||||||
|
|
||||||
|
(*) Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. Altered source is encouraged to be submitted back to the original author so it can be shared with the community. Please share your changes. |
||||||
|
|
||||||
|
(*) This notice may not be removed or altered from any source distribution. |
After Width: | Height: | Size: 5.7 KiB |
@ -0,0 +1,183 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<ui version="4.0"> |
||||||
|
<class>AboutDialog</class> |
||||||
|
<widget class="QDialog" name="AboutDialog"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>0</x> |
||||||
|
<y>0</y> |
||||||
|
<width>508</width> |
||||||
|
<height>434</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<layout class="QVBoxLayout" name="verticalLayout"> |
||||||
|
<item> |
||||||
|
<widget class="QWidget" name="widget" native="true"> |
||||||
|
<property name="minimumSize"> |
||||||
|
<size> |
||||||
|
<width>0</width> |
||||||
|
<height>50</height> |
||||||
|
</size> |
||||||
|
</property> |
||||||
|
<property name="maximumSize"> |
||||||
|
<size> |
||||||
|
<width>16777215</width> |
||||||
|
<height>50</height> |
||||||
|
</size> |
||||||
|
</property> |
||||||
|
<widget class="QLabel" name="lbl_app_icon"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>0</x> |
||||||
|
<y>0</y> |
||||||
|
<width>50</width> |
||||||
|
<height>50</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<property name="frameShape"> |
||||||
|
<enum>QFrame::Box</enum> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string/> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
<widget class="QLabel" name="lbl_app_name"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>60</x> |
||||||
|
<y>0</y> |
||||||
|
<width>281</width> |
||||||
|
<height>21</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<property name="font"> |
||||||
|
<font> |
||||||
|
<pointsize>16</pointsize> |
||||||
|
</font> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string>*** APP NAME ***</string> |
||||||
|
</property> |
||||||
|
<property name="alignment"> |
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
<widget class="QLabel" name="label_2"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>60</x> |
||||||
|
<y>26</y> |
||||||
|
<width>121</width> |
||||||
|
<height>21</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<property name="font"> |
||||||
|
<font> |
||||||
|
<pointsize>8</pointsize> |
||||||
|
<italic>true</italic> |
||||||
|
</font> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string><html> written by <i>Pacman Ghost</i> </html></string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
<widget class="QLabel" name="lbl_avatar"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>180</x> |
||||||
|
<y>25</y> |
||||||
|
<width>21</width> |
||||||
|
<height>21</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<property name="frameShape"> |
||||||
|
<enum>QFrame::Box</enum> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string/> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="label_3"> |
||||||
|
<property name="sizePolicy"> |
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> |
||||||
|
<horstretch>0</horstretch> |
||||||
|
<verstretch>0</verstretch> |
||||||
|
</sizepolicy> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string><html> Source code is available <a href="https://github.com/pacman-ghost/asl_cards">here</a>. </html></string> |
||||||
|
</property> |
||||||
|
<property name="openExternalLinks"> |
||||||
|
<bool>true</bool> |
||||||
|
</property> |
||||||
|
<property name="textInteractionFlags"> |
||||||
|
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="label_4"> |
||||||
|
<property name="sizePolicy"> |
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> |
||||||
|
<horstretch>0</horstretch> |
||||||
|
<verstretch>0</verstretch> |
||||||
|
</sizepolicy> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string><html> Released under an MIT-like license: </html></string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout"> |
||||||
|
<property name="leftMargin"> |
||||||
|
<number>20</number> |
||||||
|
</property> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="lbl_license"> |
||||||
|
<property name="minimumSize"> |
||||||
|
<size> |
||||||
|
<width>0</width> |
||||||
|
<height>100</height> |
||||||
|
</size> |
||||||
|
</property> |
||||||
|
<property name="font"> |
||||||
|
<font> |
||||||
|
<pointsize>9</pointsize> |
||||||
|
<italic>true</italic> |
||||||
|
</font> |
||||||
|
</property> |
||||||
|
<property name="frameShape"> |
||||||
|
<enum>QFrame::Box</enum> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string>*** LICENSE ***</string> |
||||||
|
</property> |
||||||
|
<property name="alignment"> |
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> |
||||||
|
</property> |
||||||
|
<property name="wordWrap"> |
||||||
|
<bool>true</bool> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</item> |
||||||
|
<item alignment="Qt::AlignRight"> |
||||||
|
<widget class="QPushButton" name="btn_ok"> |
||||||
|
<property name="text"> |
||||||
|
<string>OK</string> |
||||||
|
</property> |
||||||
|
<property name="default"> |
||||||
|
<bool>true</bool> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
<resources/> |
||||||
|
<connections/> |
||||||
|
</ui> |
Loading…
Reference in new issue