Added an report bug menu (create new github issue)

This commit is contained in:
Pakobbix 2023-05-15 22:27:10 +02:00
parent 99d1d92e14
commit 2df42114e9

View File

@ -84,12 +84,6 @@ class MainWindow(QMainWindow):
help_menu = menu.addMenu("Help") help_menu = menu.addMenu("Help")
# Help menu actions # Help menu actions
# About Action
about_action = QAction("About", self)
about_action.setToolTip("Opens the About Page")
about_action.triggered.connect(self.show_about_window)
help_menu.addAction(about_action)
# Github action # Github action
github_action = QAction("Github", self) github_action = QAction("Github", self)
github_action.setStatusTip("Opens the Github Page") github_action.setStatusTip("Opens the Github Page")
@ -108,6 +102,21 @@ class MainWindow(QMainWindow):
help_menu.addAction(version_action) help_menu.addAction(version_action)
version_action.triggered.connect(self.show_version_window) version_action.triggered.connect(self.show_version_window)
# About Action
about_action = QAction("About", self)
about_action.setToolTip("Opens the About Page")
about_action.triggered.connect(self.show_about_window)
help_menu.addAction(about_action)
# seperator
help_menu.addSeparator()
# Report Bug
report_bug_action = QAction("Report Bug", self)
report_bug_action.setToolTip("Opens the Github Issue Page with creating a new issue")
report_bug_action.triggered.connect(self.on_report_bug_clicked)
help_menu.addAction(report_bug_action)
layout = QGridLayout() layout = QGridLayout()
layout.setColumnMinimumWidth(3, 30) layout.setColumnMinimumWidth(3, 30)
@ -484,6 +493,16 @@ class MainWindow(QMainWindow):
except OSError: except OSError:
self.show_error_message("Error", f"Could not open the link. Please open it manually.\n{release_url}") self.show_error_message("Error", f"Could not open the link. Please open it manually.\n{release_url}")
def on_report_bug_clicked(self):
github_new_issue = "https://github.com/Pakobbix/StartUI-oobabooga-webui/issues/new"
if sys.platform == "win32":
os.startfile(github_new_issue)
else:
try:
subprocess.Popen(["xdg-open", github_new_issue])
except OSError:
self.show_error_message("Error", f"Could not open the link. Please open it manually.\n{github_new_issue}")
def on_Github_clicked(self): def on_Github_clicked(self):
startui_url = "https://github.com/Pakobbix/StartUI-oobabooga-webui/" startui_url = "https://github.com/Pakobbix/StartUI-oobabooga-webui/"
if sys.platform == "win32": if sys.platform == "win32":