Skip to content

Commit f94fc89

Browse files
ruevsphkahler
authored andcommitted
UI: Add a link to the GitHub commit in the Help menu
The "Go to GitHub commit" item in the Help menu opens the URL https://github.com/solvespace/solvespace/commits/5efc148 and allows the user to see the date of the commit that SolveSpace was built from. Closes solvespace#1172
1 parent bb7a6cb commit f94fc89

4 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/config.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define SOLVESPACE_CONFIG_H
33

44
#define PACKAGE_VERSION "@PROJECT_VERSION@~@solvespace_GIT_HASH@"
5+
#define GIT_HASH_URL "https://github.com/solvespace/solvespace/commit/@solvespace_GIT_HASH@"
56

67
/* Non-OS X *nix only */
78
#define UNIX_DATADIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATAROOTDIR@/solvespace"

src/graphicswin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ const MenuEntry Menu[] = {
183183
{ 0, N_("&Help"), Command::NONE, 0, KN, mHelp },
184184
{ 1, N_("&Language"), Command::LOCALE, 0, KN, mHelp },
185185
{ 1, N_("&Website / Manual"), Command::WEBSITE, 0, KN, mHelp },
186+
{ 1, N_("&Go to GitHub commit"), Command::GITHUB, 0, KN, mHelp },
186187
#ifndef __APPLE__
187188
{ 1, N_("&About"), Command::ABOUT, 0, KN, mHelp },
188189
#endif

src/solvespace.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,10 @@ void SolveSpaceUI::MenuHelp(Command id) {
10561056
PACKAGE_VERSION, 2022);
10571057
break;
10581058

1059+
case Command::GITHUB:
1060+
Platform::OpenInBrowser(GIT_HASH_URL);
1061+
break;
1062+
10591063
default: ssassert(false, "Unexpected menu ID");
10601064
}
10611065
}

src/ui.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ enum class Command : uint32_t {
172172
// Help
173173
LOCALE,
174174
WEBSITE,
175+
GITHUB,
175176
ABOUT,
176177
};
177178

0 commit comments

Comments
 (0)