Skip to content

Commit

Permalink
add open commit button
Browse files Browse the repository at this point in the history
  • Loading branch information
HENDRIX-ZT2 committed Oct 29, 2024
1 parent b045482 commit 11b88c2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions __version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# this file is auto-generated by the pre-commit hook increment_version.py
VERSION = "2024.10.29"
COMMIT_HASH = "0d4400b09"
COMMIT_TIME = "Tue Oct 29 08:44:08 2024 +0100"
COMMIT_HASH = "b045482a4"
COMMIT_TIME = "Tue Oct 29 08:48:13 2024 +0100"
5 changes: 4 additions & 1 deletion gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3342,11 +3342,14 @@ def set_clean(self) -> None:
def set_dirty(self) -> None:
self.set_file_modified(True)

def open_repo(self) -> None:
webbrowser.open(f"https://github.com/OpenNaja/cobra-tools/tree/{COMMIT_HASH}", new=2)

def report_bug(self) -> None:
webbrowser.open("https://github.com/OpenNaja/cobra-tools/issues/new?assignees=&labels=&template=bug_report.md&title=", new=2)

def online_support(self) -> None:
webbrowser.open("https://github.com/OpenNaja/cobra-tools/wiki", new=2)
webbrowser.open("https://opennaja.github.io/cobra-tools/", new=2)

def add_to_menu(self, button_data: ButtonData) -> None:
for btn in button_data:
Expand Down
14 changes: 8 additions & 6 deletions ovl_tool_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def __init__(self, opts: GuiOptions):
file_menu = main_menu.addMenu('File')
edit_menu = main_menu.addMenu('Edit')
util_menu = main_menu.addMenu('Util')
devs_menu = main_menu.addMenu('Devs')
help_menu = main_menu.addMenu('Help')
devs_menu = main_menu.addMenu('Devs')
button_data = (
(file_menu, "New", self.file_widget.ask_open_dir, "CTRL+N", "new"),
(file_menu, "Open", self.file_widget.ask_open, "CTRL+O", "dir"),
Expand All @@ -138,16 +138,18 @@ def __init__(self, opts: GuiOptions):
(edit_menu, "Load Included OVL List", self.load_included_ovls, "", ""),
(edit_menu, "Export Included OVL List", self.save_included_ovls, "", ""),
(edit_menu, "Preferences", self.open_cfg_editor, "CTRL+,", "preferences"),
(util_menu, "Open Tools Dir", self.open_tools_dir, "", "home"),
(util_menu, "Export File List", self.save_file_list, "", ""),
(util_menu, "Compare with other OVL", self.compare_ovls, "", ""),
(help_menu, "Show Commit on GitHub", self.open_repo, "", "github"),
(help_menu, "Report Bug on GitHub", self.report_bug, "", "report"),
(help_menu, "Read Wiki Documentation", self.online_support, "", "manual"),
(devs_menu, "Inspect MS2", self.inspect_models, "", "ms2"),
(devs_menu, "Inspect FGM", self.walker_fgm, "", "fgm"),
(devs_menu, "Inspect MANIS", self.walker_manis, "", "manis"),
(devs_menu, "Generate Hash Table", self.walker_hash, "", ""),
(devs_menu, "Dump Debug Data", self.dump_debug_data, "", "dump_debug"),
(util_menu, "Open Tools Dir", self.open_tools_dir, "", "home"),
(util_menu, "Export File List", self.save_file_list, "", ""),
(util_menu, "Compare with other OVL", self.compare_ovls, "", ""),
(help_menu, "Report Bug", self.report_bug, "", "report"),
(help_menu, "Documentation", self.online_support, "", "manual"))
)
self.add_to_menu(button_data)

separator_action = self.actions['generate hash table']
Expand Down

0 comments on commit 11b88c2

Please sign in to comment.