Source code for mantidimaging.gui.windows.welcome_screen.view

# Copyright (C) 2024 ISIS Rutherford Appleton Laboratory UKRI
# SPDX - License - Identifier: GPL-3.0-or-later
from __future__ import annotations

from mantidimaging.core.utility import finder
from PyQt5.QtWidgets import QLabel

from mantidimaging.gui.mvp_base import BaseDialogView


[docs] class WelcomeScreenView(BaseDialogView): def __init__(self, parent, presenter): super().__init__(parent, "gui/ui/welcome_screen_dialog.ui") # The background image URL must use forward slashes on both Windows and Linux bg_image = finder.ROOT_PATH.replace('\\', '/') + '/gui/ui/images/welcome_screen_background.png' self.setStyleSheet("#WelcomeScreenDialog {" f"border-image:url({bg_image});" "min-width:30em; min-height:20em;max-width:30em; max-height:20em;}") self.presenter = presenter self.issue_box.setVisible(False) self.show_at_start.stateChanged.connect(presenter.show_at_start_changed) self.ok_button.clicked.connect(self.close)
[docs] def get_show_at_start(self): return self.show_at_start.isChecked()
[docs] def set_show_at_start(self, checked): self.show_at_start.setChecked(checked)
[docs] def set_version_label(self, contents): self.version_label.setText(contents)
[docs] def add_issues(self, contents): self.issue_box.setVisible(True) issues_label = QLabel(contents) issues_label.setOpenExternalLinks(True) self.issue_box_layout.addWidget(issues_label)