Skip to content
Snippets Groups Projects
Commit e8f3304b authored by Kien Le's avatar Kien Le
Browse files

Add documentation

parent 2b468f00
No related branches found
No related tags found
1 merge request!218Fix program not fitting on low resolution screens
......@@ -15,7 +15,6 @@ from sohstationviewer.conf.config_processor import (
BadConfigError,
)
# Enable Layer-backing for MacOs version >= 11
# Only needed if using the pyside2 library with version>=5.15.
# Layer-backing is always enabled in pyside6.
......@@ -37,19 +36,23 @@ def fix_relative_paths() -> None:
os.chdir(current_file_dir)
def check_if_user_want_to_reset_config():
bad_config_dialog = QMessageBox()
bad_config_dialog.setText('Something went wrong when reading the '
'config.')
bad_config_dialog.setDetailedText(traceback.format_exc())
bad_config_dialog.setInformativeText('Do you want to reset the config '
'file?')
bad_config_dialog.setStandardButtons(QMessageBox.Ok |
QMessageBox.Close)
bad_config_dialog.setDefaultButton(QMessageBox.Ok)
bad_config_dialog.setIcon(QMessageBox.Critical)
reset_choice = bad_config_dialog.exec_()
return reset_choice == QMessageBox.Ok
def check_if_user_want_to_reset_config() -> bool:
"""
Show a dialog asking the user if they want to reset the config.
:return: whether the user wants to reset the config.
"""
bad_config_dialog = QMessageBox()
bad_config_dialog.setText('Something went wrong when reading the '
'config.')
bad_config_dialog.setDetailedText(traceback.format_exc())
bad_config_dialog.setInformativeText('Do you want to reset the config '
'file?')
bad_config_dialog.setStandardButtons(QMessageBox.Ok |
QMessageBox.Close)
bad_config_dialog.setDefaultButton(QMessageBox.Ok)
bad_config_dialog.setIcon(QMessageBox.Critical)
reset_choice = bad_config_dialog.exec_()
return reset_choice == QMessageBox.Ok
def main():
......@@ -80,9 +83,6 @@ def main():
sys.exit(1)
config.apply_config(wnd)
screen_width, screen_height = app.primaryScreen().size().toTuple()
wnd.resize(screen_width * (2 / 3), screen_height * (2 / 3))
wnd.show()
sys.exit(app.exec_())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment