Skip to content

Commit

Permalink
UI: Add a link to the GitHub commit at the bottom of the config screen
Browse files Browse the repository at this point in the history
The "Go to GitHub commit for 30~41eb60d3" link at the bottom of the
configuration screen opens the URL solvespace@41eb60d3
and allows the user to see the date of the commit that SolveSpace was
built from.

Closes solvespace#1172
  • Loading branch information
ruevs committed Jan 13, 2022
1 parent 41eb60d commit 129ff2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define SOLVESPACE_CONFIG_H

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

/* Non-OS X *nix only */
#define UNIX_DATADIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATAROOTDIR@/solvespace"
Expand Down
3 changes: 3 additions & 0 deletions src/confscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#if defined(_OPENMP)
#include <omp.h>
#endif
#include "config.h"

void TextWindow::ScreenChangeColor(int link, uint32_t v) {
SS.TW.ShowEditControlWithColorPicker(13, SS.modelColor[v]);
Expand Down Expand Up @@ -360,6 +361,8 @@ void TextWindow::ShowConfiguration() {
Printf(false, " %FtOpenMP enabled");
Printf(false, " %Ft threads %E%d", omp_get_max_threads());
#endif

Printf(false, " %Fl%Ls%fGo to GitHub commit for %s%E", &ScreenGoToWebsite, PACKAGE_VERSION);
}

bool TextWindow::EditControlDoneForConfiguration(const std::string &s) {
Expand Down
3 changes: 2 additions & 1 deletion src/textscreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Copyright 2008-2013 Jonathan Westhues.
//-----------------------------------------------------------------------------
#include "solvespace.h"
#include "config.h"

//-----------------------------------------------------------------------------
// A navigation bar that always appears at the top of the window, with a
Expand Down Expand Up @@ -90,7 +91,7 @@ void TextWindow::ScreenShowEditView(int link, uint32_t v) {
SS.TW.GoToScreen(Screen::EDIT_VIEW);
}
void TextWindow::ScreenGoToWebsite(int link, uint32_t v) {
Platform::OpenInBrowser("http://solvespace.com/txtlink");
Platform::OpenInBrowser(GIT_HASH_URL);
}
void TextWindow::ShowListOfGroups() {
const char *radioTrue = " " RADIO_TRUE " ",
Expand Down

0 comments on commit 129ff2f

Please sign in to comment.