mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-29 17:19:50 +12:00
Merge branch 'gedakc-add-about-manuskript-dialog' into develop
This commit is contained in:
commit
0602fc3b33
BIN
icons/Manuskript/logo-400x104.png
Normal file
BIN
icons/Manuskript/logo-400x104.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
|
@ -9,8 +9,7 @@ from PyQt5.QtGui import QIcon
|
|||
from PyQt5.QtWidgets import QApplication, qApp
|
||||
|
||||
from manuskript.functions import appPath, writablePath
|
||||
|
||||
_version = "0.4.0"
|
||||
from manuskript.version import getVersion
|
||||
|
||||
faulthandler.enable()
|
||||
|
||||
|
@ -20,9 +19,9 @@ def run():
|
|||
app.setOrganizationName("manuskript")
|
||||
app.setOrganizationDomain("www.theologeek.ch")
|
||||
app.setApplicationName("manuskript")
|
||||
app.setApplicationVersion(_version)
|
||||
app.setApplicationVersion(getVersion())
|
||||
|
||||
print("Running manuskript version {}.".format(_version))
|
||||
print("Running manuskript version {}.".format(getVersion()))
|
||||
icon = QIcon()
|
||||
for i in [16, 32, 64, 128, 256, 512]:
|
||||
icon.addFile(appPath("icons/Manuskript/icon-{}px.png".format(i)))
|
||||
|
|
|
@ -18,6 +18,7 @@ from manuskript.models.plotModel import plotModel
|
|||
from manuskript.models.worldModel import worldModel
|
||||
from manuskript.settingsWindow import settingsWindow
|
||||
from manuskript.ui import style
|
||||
from manuskript.ui.about import aboutDialog
|
||||
from manuskript.ui.collapsibleDockWidgets import collapsibleDockWidgets
|
||||
from manuskript.ui.exporters.exporter import exporterDialog
|
||||
from manuskript.ui.helpLabel import helpLabel
|
||||
|
@ -107,6 +108,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.actCloseProject.triggered.connect(self.closeProject)
|
||||
self.actQuit.triggered.connect(self.close)
|
||||
self.actToolFrequency.triggered.connect(self.frequencyAnalyzer)
|
||||
self.actAbout.triggered.connect(self.about)
|
||||
self.generateViewMenu()
|
||||
|
||||
self.actModeGroup = QActionGroup(self)
|
||||
|
@ -798,6 +800,19 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.tblDebugPlots.selectionModel().currentIndex().row(),
|
||||
Plot.steps.value)))
|
||||
|
||||
###############################################################################
|
||||
# HELP
|
||||
###############################################################################
|
||||
|
||||
def about(self):
|
||||
self.dialog = aboutDialog(mw=self)
|
||||
self.dialog.setFixedSize(self.dialog.size())
|
||||
self.dialog.show()
|
||||
# Center about dialog
|
||||
r = self.dialog.geometry()
|
||||
r2 = self.geometry()
|
||||
self.dialog.move(r2.center() - r.center())
|
||||
|
||||
###############################################################################
|
||||
# GENERAL AKA UNSORTED
|
||||
###############################################################################
|
||||
|
|
52
manuskript/ui/about.py
Normal file
52
manuskript/ui/about.py
Normal file
|
@ -0,0 +1,52 @@
|
|||
# --!-- coding: utf8 --!--
|
||||
|
||||
from PyQt5.Qt import PYQT_VERSION_STR
|
||||
from PyQt5.QtCore import QT_VERSION_STR
|
||||
from PyQt5.QtGui import QIcon, QPixmap
|
||||
from PyQt5.QtWidgets import QWidget
|
||||
from platform import python_version
|
||||
|
||||
from manuskript.functions import appPath
|
||||
from manuskript.ui.about_ui import Ui_about
|
||||
from manuskript.version import getVersion
|
||||
|
||||
class aboutDialog(QWidget, Ui_about):
|
||||
def __init__(self, parent=None, mw=None):
|
||||
QWidget.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
self.populateFields()
|
||||
self.buttonBox.accepted.connect(self.accept)
|
||||
|
||||
def populateFields(self):
|
||||
# Fill in all the fields in the About dialog
|
||||
iconPic = appPath("icons/Manuskript/icon-64px.png")
|
||||
self.setWindowIcon(QIcon(iconPic))
|
||||
|
||||
logoPic = QPixmap(appPath("icons/Manuskript/logo-400x104.png"))
|
||||
self.labelLogo.setPixmap(logoPic)
|
||||
|
||||
self.labelManuskriptVersion.setText(
|
||||
"<b>" + self.tr("Version") + " " + getVersion() + "</b><br>"
|
||||
+ " "*5 + """<a href="http://www.theologeek.ch/manuskript/">
|
||||
http://www.theologeek.ch/manuskript/
|
||||
</a><br>"""
|
||||
+ " "*5 + "Copyright © 2015-2017 Olivier Keshavjee<br>"
|
||||
+ " "*5 + """<a href="https://www.gnu.org/licenses/gpl-3.0.en.html">
|
||||
GNU General Public License Version 3
|
||||
</a><br>"""
|
||||
)
|
||||
|
||||
self.labelManuskriptVersion.setOpenExternalLinks(True)
|
||||
|
||||
self.labelSoftwareVersion.setText(
|
||||
"<b>" + self.tr("Software Versions in Use:") + "</b><br>"
|
||||
+ " "*5 + self.tr("Python") + " " + python_version() + "<br>"
|
||||
+ " "*5 + self.tr("PyQt") + " " + PYQT_VERSION_STR + "<br>"
|
||||
+ " "*5 + self.tr("Qt") + " " + QT_VERSION_STR
|
||||
)
|
||||
#self.labelPythonVersion.setText()
|
||||
#self.labelPyQtVersion.setText()
|
||||
#self.labelQtVersion.setText()
|
||||
|
||||
def accept(self):
|
||||
self.close()
|
54
manuskript/ui/about_ui.py
Normal file
54
manuskript/ui/about_ui.py
Normal file
|
@ -0,0 +1,54 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'manuskript/ui/about_ui.ui'
|
||||
#
|
||||
# Created: Wed Oct 11 08:28:24 2017
|
||||
# by: PyQt5 UI code generator 5.2.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_about(object):
|
||||
def setupUi(self, about):
|
||||
about.setObjectName("about")
|
||||
about.setWindowModality(QtCore.Qt.ApplicationModal)
|
||||
about.resize(445, 370)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap("../../icons/Manuskript/icon-64px.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
about.setWindowIcon(icon)
|
||||
self.gridLayout = QtWidgets.QGridLayout(about)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.labelManuskriptVersion = QtWidgets.QLabel(about)
|
||||
self.labelManuskriptVersion.setText("Version")
|
||||
self.labelManuskriptVersion.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.labelManuskriptVersion.setObjectName("labelManuskriptVersion")
|
||||
self.gridLayout.addWidget(self.labelManuskriptVersion, 2, 0, 1, 2)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 5, 0, 1, 1)
|
||||
self.labelLogo = QtWidgets.QLabel(about)
|
||||
self.labelLogo.setText("")
|
||||
self.labelLogo.setPixmap(QtGui.QPixmap("../../icons/Manuskript/logo-400x104.png"))
|
||||
self.labelLogo.setObjectName("labelLogo")
|
||||
self.gridLayout.addWidget(self.labelLogo, 0, 0, 1, 2)
|
||||
self.labelSoftwareVersion = QtWidgets.QLabel(about)
|
||||
self.labelSoftwareVersion.setText("Software Versions in Use:")
|
||||
self.labelSoftwareVersion.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
|
||||
self.labelSoftwareVersion.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.labelSoftwareVersion.setObjectName("labelSoftwareVersion")
|
||||
self.gridLayout.addWidget(self.labelSoftwareVersion, 4, 0, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(about)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 7, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(about)
|
||||
self.buttonBox.accepted.connect(about.accept)
|
||||
QtCore.QMetaObject.connectSlotsByName(about)
|
||||
|
||||
def retranslateUi(self, about):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
about.setWindowTitle(_translate("about", "About Manuskript"))
|
||||
self.labelLogo.setToolTip(_translate("about", "Manuskript"))
|
||||
|
104
manuskript/ui/about_ui.ui
Normal file
104
manuskript/ui/about_ui.ui
Normal file
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>about</class>
|
||||
<widget class="QDialog" name="about">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::ApplicationModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>445</width>
|
||||
<height>370</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>About Manuskript</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>../../icons/Manuskript/icon-64px.png</normaloff>../../icons/Manuskript/icon-64px.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="labelManuskriptVersion">
|
||||
<property name="text">
|
||||
<string notr="true">Version</string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="labelLogo">
|
||||
<property name="toolTip">
|
||||
<string>Manuskript</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>../../icons/Manuskript/logo-400x104.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="labelSoftwareVersion">
|
||||
<property name="text">
|
||||
<string notr="true">Software Versions in Use:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>about</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
# Form implementation generated from reading ui file 'manuskript/ui/mainWindow.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.4.2
|
||||
# Created: Wed Oct 11 08:10:56 2017
|
||||
# by: PyQt5 UI code generator 5.2.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
@ -16,8 +17,8 @@ class Ui_MainWindow(object):
|
|||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.centralwidget)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 1, 0, 0)
|
||||
self.horizontalLayout_2.setSpacing(0)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 1, 0, 0)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.stack = QtWidgets.QStackedWidget(self.centralwidget)
|
||||
self.stack.setObjectName("stack")
|
||||
|
@ -821,6 +822,7 @@ class Ui_MainWindow(object):
|
|||
self.layoutWidget = QtWidgets.QWidget(self.splitterOutlineH)
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout_14 = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout_14.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_14.setObjectName("verticalLayout_14")
|
||||
self.splitterOutlineV = QtWidgets.QSplitter(self.layoutWidget)
|
||||
self.splitterOutlineV.setOrientation(QtCore.Qt.Vertical)
|
||||
|
@ -1016,7 +1018,7 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_2.addWidget(self.stack)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1112, 20))
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1112, 30))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuFile = QtWidgets.QMenu(self.menubar)
|
||||
self.menuFile.setObjectName("menuFile")
|
||||
|
@ -1159,6 +1161,8 @@ class Ui_MainWindow(object):
|
|||
self.actCompile.setObjectName("actCompile")
|
||||
self.actToolFrequency = QtWidgets.QAction(MainWindow)
|
||||
self.actToolFrequency.setObjectName("actToolFrequency")
|
||||
self.actAbout = QtWidgets.QAction(MainWindow)
|
||||
self.actAbout.setObjectName("actAbout")
|
||||
self.menuFile.addAction(self.actOpen)
|
||||
self.menuFile.addAction(self.menuRecents.menuAction())
|
||||
self.menuFile.addAction(self.actSave)
|
||||
|
@ -1169,6 +1173,7 @@ class Ui_MainWindow(object):
|
|||
self.menuFile.addSeparator()
|
||||
self.menuFile.addAction(self.actQuit)
|
||||
self.menuHelp.addAction(self.actShowHelp)
|
||||
self.menuHelp.addAction(self.actAbout)
|
||||
self.menuTools.addAction(self.actSpellcheck)
|
||||
self.menuTools.addAction(self.actToolFrequency)
|
||||
self.menuEdit.addAction(self.actLabels)
|
||||
|
@ -1323,19 +1328,21 @@ class Ui_MainWindow(object):
|
|||
self.actCompile.setText(_translate("MainWindow", "Co&mpile"))
|
||||
self.actCompile.setShortcut(_translate("MainWindow", "F6"))
|
||||
self.actToolFrequency.setText(_translate("MainWindow", "&Frequency Analyzer"))
|
||||
self.actAbout.setText(_translate("MainWindow", "&About"))
|
||||
self.actAbout.setToolTip(_translate("MainWindow", "About Manuskript"))
|
||||
|
||||
from manuskript.ui.cheatSheet import cheatSheet
|
||||
from manuskript.ui.editors.mainEditor import mainEditor
|
||||
from manuskript.ui.search import search
|
||||
from manuskript.ui.views.basicItemView import basicItemView
|
||||
from manuskript.ui.views.characterTreeView import characterTreeView
|
||||
from manuskript.ui.views.lineEditView import lineEditView
|
||||
from manuskript.ui.views.metadataView import metadataView
|
||||
from manuskript.ui.search import search
|
||||
from manuskript.ui.views.textEditView import textEditView
|
||||
from manuskript.ui.views.textEditCompleter import textEditCompleter
|
||||
from manuskript.ui.cheatSheet import cheatSheet
|
||||
from manuskript.ui.views.sldImportance import sldImportance
|
||||
from manuskript.ui.views.characterTreeView import characterTreeView
|
||||
from manuskript.ui.views.outlineView import outlineView
|
||||
from manuskript.ui.views.plotTreeView import plotTreeView
|
||||
from manuskript.ui.views.sldImportance import sldImportance
|
||||
from manuskript.ui.views.storylineView import storylineView
|
||||
from manuskript.ui.views.textEditCompleter import textEditCompleter
|
||||
from manuskript.ui.views.textEditView import textEditView
|
||||
from manuskript.ui.views.treeView import treeView
|
||||
from manuskript.ui.welcome import welcome
|
||||
from manuskript.ui.views.treeView import treeView
|
||||
from manuskript.ui.views.metadataView import metadataView
|
||||
from manuskript.ui.views.basicItemView import basicItemView
|
||||
from manuskript.ui.editors.mainEditor import mainEditor
|
||||
from manuskript.ui.views.storylineView import storylineView
|
||||
|
|
|
@ -1557,8 +1557,7 @@
|
|||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="emblem-favorite">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
|
@ -2045,7 +2044,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1112</width>
|
||||
<height>20</height>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
@ -2058,8 +2057,7 @@
|
|||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="folder-recent">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="actOpen"/>
|
||||
|
@ -2077,6 +2075,7 @@
|
|||
<string>&Help</string>
|
||||
</property>
|
||||
<addaction name="actShowHelp"/>
|
||||
<addaction name="actAbout"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuTools">
|
||||
<property name="title">
|
||||
|
@ -2385,8 +2384,7 @@ QListView::item:hover {
|
|||
<action name="actCloseProject">
|
||||
<property name="icon">
|
||||
<iconset theme="window-close">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Close project</string>
|
||||
|
@ -2405,6 +2403,14 @@ QListView::item:hover {
|
|||
<string>&Frequency Analyzer</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actAbout">
|
||||
<property name="text">
|
||||
<string>&About</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>About Manuskript</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
9
manuskript/version.py
Normal file
9
manuskript/version.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
# --!-- coding: utf8 --!--
|
||||
|
||||
# Single source the package version
|
||||
# https://packaging.python.org/guides/single-sourcing-package-version/
|
||||
|
||||
__version__ = "0.4.0"
|
||||
|
||||
def getVersion():
|
||||
return __version__
|
Loading…
Reference in a new issue