Browse Source

Provide changelog as menu item

master
Nils 2 years ago
parent
commit
af779a2664
  1. 3
      CHANGELOG
  2. 1
      Makefile.in
  3. 1
      documentation/out/CHANGELOG
  4. 63
      qtgui/changelog.py
  5. 6
      qtgui/designer/mainwindow.py
  6. 6
      qtgui/designer/mainwindow.ui
  7. 3
      qtgui/mainwindow.py
  8. 3
      qtgui/resources/translations/config.pro

3
CHANGELOG

@ -4,6 +4,9 @@ Format: Double ## for a version number followed by a space, ISO-Date, Semantic V
Two empty lines before the next entry.
External contributors notice at the end of the line: (LastName, FirstName / nick)
## 2022-01-15 0.3.1
This CHANGELOG is now available through the programs help menu directly.
## 2021-07-08 0.3.0
Remove "Quick" mode. As it turns out "Full" mode is quick enough. Port convenience features to full mode.

1
Makefile.in

@ -50,6 +50,7 @@ install:
install -D -m 644 documentation/out/* -t $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)
install -D -m 644 README.md $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/README.md
install -D -m 644 LICENSE $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/LICENSE
install -D -m 644 CHANGELOG $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/CHANGELOG
install -D -m 644 desktop/desktop.desktop $(DESTDIR)$(PREFIX)/share/applications/org.laborejo.agordejo.desktop
install -D -m 644 desktop/agordejo-continue.desktop $(DESTDIR)$(PREFIX)/share/applications/org.laborejo.agordejo-continue.desktop

1
documentation/out/CHANGELOG

@ -0,0 +1 @@
../../CHANGELOG

63
qtgui/changelog.py

@ -0,0 +1,63 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2021, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
This application is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Lib
#System Wide Modules
from PyQt5 import QtCore, QtWidgets, QtGui
#Local Modules
from engine.config import * #imports METADATA
from engine.start import PATHS
class Changelog(QtWidgets.QWidget):
"""
A modal window that is hidden.
Just shows the file CHANGELOG
"""
def __init__(self, mainWindow):
super().__init__()
self.mainWindow = mainWindow
ourLayout = QtWidgets.QVBoxLayout()
#ourLayout.setSpacing(0)
#ourLayout.setContentsMargins(0,0,0,0)
self.setLayout(ourLayout)
self.setWindowTitle(METADATA["name"] + " " + QtCore.QCoreApplication.translate("TemplateChangelog", "Changelog"))
introtext = QtCore.QCoreApplication.translate("TemplateChangelog", "The Changelog is only available in English.")
ourLayout.addWidget(QtWidgets.QLabel(introtext))
textEdit = QtWidgets.QPlainTextEdit()
textEdit.setReadOnly(True)
with open(PATHS["doc"] + "/CHANGELOG", "r") as f:
textEdit.setPlainText(f.read())
ourLayout.addWidget(textEdit)
self.hide()
def closeEvent(self, event):
self.hide()

6
qtgui/designer/mainwindow.py

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
@ -273,7 +273,10 @@ class Ui_MainWindow(object):
self.actionSettings.setObjectName("actionSettings")
self.actionManual = QtWidgets.QAction(MainWindow)
self.actionManual.setObjectName("actionManual")
self.actionChangelog = QtWidgets.QAction(MainWindow)
self.actionChangelog.setObjectName("actionChangelog")
self.menuControl.addAction(self.actionManual)
self.menuControl.addAction(self.actionChangelog)
self.menuControl.addAction(self.actionRebuild_Program_Database)
self.menuControl.addAction(self.actionHide_in_System_Tray)
self.menuControl.addAction(self.actionSettings)
@ -374,3 +377,4 @@ class Ui_MainWindow(object):
self.actionClientRename.setShortcut(_translate("MainWindow", "F2"))
self.actionSettings.setText(_translate("MainWindow", "Settings"))
self.actionManual.setText(_translate("MainWindow", "Manual"))
self.actionChangelog.setText(_translate("MainWindow", "News and Changelog"))

6
qtgui/designer/mainwindow.ui

@ -564,6 +564,7 @@
<string>Control</string>
</property>
<addaction name="actionManual"/>
<addaction name="actionChangelog"/>
<addaction name="actionRebuild_Program_Database"/>
<addaction name="actionHide_in_System_Tray"/>
<addaction name="actionSettings"/>
@ -732,6 +733,11 @@
<string>Manual</string>
</property>
</action>
<action name="actionChangelog">
<property name="text">
<string>News and Changelog</string>
</property>
</action>
</widget>
<resources/>
<connections/>

3
qtgui/mainwindow.py

@ -39,6 +39,7 @@ from .systemtray import SystemTray
from .eventloop import EventLoop
from .designer.mainwindow import Ui_MainWindow
from .usermanual import UserManual
from .changelog import Changelog
from .helper import setPaletteAndFont
from .helper import iconFromString
from .sessiontreecontroller import SessionTreeController
@ -140,6 +141,7 @@ class MainWindow(QtWidgets.QMainWindow):
assert self.ui.tabbyCat.currentIndex() == 0, self.ui.tabbyCat.currentIndex() # this is critical. If you left the Qt Designer with the wrong tab open this is the error that happens. It will trigger the tab changed later that will go wrong because setup is not complete yet and you'll get AttributeError
self.userManual = UserManual(mainWindow=self)
self.changelog = Changelog(mainWindow=self)
self.ui.mainPageSwitcher.setCurrentIndex(0) #1 is messageLabel 0 is the tab widget
@ -399,6 +401,7 @@ class MainWindow(QtWidgets.QMainWindow):
def connectMenu(self):
#Control
self.ui.actionManual.triggered.connect(self.userManual.show)
self.ui.actionChangelog.triggered.connect(self.changelog.show)
self.ui.actionRebuild_Program_Database.triggered.connect(self.updateProgramDatabase)
self.ui.actionSettings.triggered.connect(self._reactMenu_settings)
self.ui.actionHide_in_System_Tray.triggered.connect(lambda: self.toggleVisible(force=False))

3
qtgui/resources/translations/config.pro

@ -1,3 +1,2 @@
SOURCES = ../../addclientprompt.py ../../descriptiontextwidget.py ../../mainwindow.py ../../projectname.py ../../sessiontreecontroller.py ../../opensessioncontroller.py ../../systemtray.py ../../waitdialog.py ../../usermanual.py ../../designer/mainwindow.py ../../designer/newsession.py ../../designer/projectname.py ../../designer/settings.py ../../designer/usermanual.py
SOURCES = ../../addclientprompt.py ../../changelog.py ../../descriptiontextwidget.py ../../mainwindow.py ../../projectname.py ../../sessiontreecontroller.py ../../opensessioncontroller.py ../../systemtray.py ../../waitdialog.py ../../usermanual.py ../../designer/mainwindow.py ../../designer/newsession.py ../../designer/projectname.py ../../designer/settings.py ../../designer/usermanual.py
TRANSLATIONS = de.ts it.ts

Loading…
Cancel
Save