Skip to content
Snippets Groups Projects

#84 Hurtigtaster og enkelbruk dialoger

Merged Petter Sagvold requested to merge help_button_dialog into master
All threads resolved!
Files
3
+ 94
0
"""Includes two help-popups.
Has two dialogs that appear when actions from help are triggered.
"""
from PySide2.QtWidgets import (
QDialog,
QLabel,
QPushButton,
QVBoxLayout,
QHBoxLayout,
QFormLayout,
)
from PySide2.QtCore import Qt
class ShortcutsHelpDialog(QDialog):
"""The dialog for hotkeys.
This class contains the information for the shortcuts/hotkeys that
can be used in the application
"""
def __init__(self): # pylint: disable = R0915
super().__init__()
self.resize(300, 300)
self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)
self.layout = QVBoxLayout()
self.layout_label = QFormLayout()
self.layout_button = QHBoxLayout()
self.button_ok = QPushButton("Ok")
self.button_ok.clicked.connect(self.close)
self.layout_label.addRow(
QLabel("Opprett en ny SOI: "), QLabel("Ctrl + N")
)
self.layout_label.addRow(
QLabel("Åpne SOI fra fil: "), QLabel("Ctrl + O")
)
self.layout_label.addRow(
QLabel("Åpne SOI fra database: "), QLabel("Ctrl + D")
)
self.layout_label.addRow(
QLabel("Forhåndsvis SOI: "), QLabel("Ctrl + P")
)
self.layout_label.addRow(
QLabel("Lagre i database: "), QLabel("Ctrl + S")
)
self.layout_label.addRow(
QLabel("Eksporter komprimert SOI: "), QLabel("Ctrl + E")
)
self.layout_label.addRow(
QLabel("Legg til ny modul: "), QLabel("Ctrl + M")
)
self.layout_label.addRow(
QLabel("Endre oppsett SOI: "), QLabel("Ctrl + I")
)
self.layout_button.addWidget(self.button_ok, alignment=Qt.AlignRight)
self.layout.addLayout(self.layout_label)
self.layout.addLayout(self.layout_button)
self.setLayout(self.layout)
class BasicUsageHelpDialog(QDialog):
"""The dialog for easy use.
This class contains text that explains the user how to use the application.
"""
def __init__(self): # pylint: disable = R0915
super().__init__()
self.resize(300, 300)
self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)
self.text = QLabel(
"""Her skal det være mye tekst og bilder om hvordan
applikasjonen brukes"""
)
self.layout = QVBoxLayout()
self.layout_text = QVBoxLayout()
self.layout_button = QHBoxLayout()
self.button_ok = QPushButton("Ok")
self.button_ok.clicked.connect(self.close)
self.layout_text.addWidget(self.text)
self.layout_button.addWidget(self.button_ok, alignment=Qt.AlignRight)
self.layout.addLayout(self.layout_text)
self.layout.addLayout(self.layout_button)
self.setLayout(self.layout)
Loading