Added about dialg

This commit is contained in:
Marcel Kapfer 2020-05-03 17:23:12 +02:00
parent 2e4a336219
commit 9ac8f50e8c
Signed by: mmk2410
GPG key ID: CADE6F0C09F21B09

View file

@ -10,8 +10,21 @@ MIT License
"""
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QTableWidgetItem
import recipe
from writer.MoinMoinWriter import MoinMoinWriter
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QTableWidgetItem, QDialog
from ui_mainwindow import Ui_MainWindow
from ui_code_dialog import Ui_WikiCode
from ui_about_dialog import Ui_About
class AboutDialog(QDialog, Ui_About):
def __init__(self, *args, **kwargs):
super(AboutDialog, self).__init__(*args, **kwargs)
self.setupUi(self)
self.b_close.clicked.connect(self.close)
self.show()
class WikiCodeDialog(QDialog, Ui_WikiCode):
def __init__(self, code, *args, **kwargs):
@ -38,6 +51,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.b_cancel.clicked.connect(self.close)
self.ma_close.triggered.connect(self.close)
# Connect about action
self.ma_information.triggered.connect(self.about)
# Conncect recipe name typing
self.e_recipe_name.textChanged.connect(self.updateTitle)
@ -251,6 +267,14 @@ class MainWindow(QMainWindow, Ui_MainWindow):
dialog = WikiCodeDialog(code)
dialog.exec_()
def about(self):
"""
Show an about dialog.
"""
dialog = AboutDialog()
dialog.exec_()
def close(self):
"""
Close the application. A warning is shown before.