File tree Expand file tree Collapse file tree 10 files changed +36
-26
lines changed Expand file tree Collapse file tree 10 files changed +36
-26
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
5
6
6
## [ Upcoming Release]
7
7
8
+ - The documentation link shown on the splash screen or help menu is now
9
+ set at compile time to be equal to ` docs.opensimcreator.com ` (#1048 ).
8
10
- Attempting to import an incorrect ` .osim ` file into the mesh importer now
9
11
results in a log error message rather than a crashing exception
10
12
(thanks @davidpagnon , #1050 ).
Original file line number Diff line number Diff line change @@ -179,13 +179,3 @@ TabRegistry& osc::OpenSimCreatorApp::upd_tab_registry()
179
179
{
180
180
return *singleton<TabRegistry>();
181
181
}
182
-
183
- std::string osc::OpenSimCreatorApp::docs_url () const
184
- {
185
- if (const auto runtime_url = settings ().find_value (" docs_url" )) {
186
- return to<std::string>(*runtime_url);
187
- }
188
- else {
189
- return " https://docs.opensimcreator.com" ;
190
- }
191
- }
Original file line number Diff line number Diff line change @@ -41,7 +41,5 @@ namespace osc
41
41
using App::show;
42
42
43
43
TabRegistry& upd_tab_registry ();
44
-
45
- std::string docs_url () const ;
46
44
};
47
45
}
Original file line number Diff line number Diff line change @@ -436,16 +436,19 @@ void osc::MainMenuAboutTab::onDraw()
436
436
{
437
437
ui::set_num_columns (2 );
438
438
439
- ui::draw_text (" OpenSim Creator Documentation" );
440
- ui::next_column ();
441
- ui::push_id (id++);
442
- if (ui::draw_button (OSC_ICON_LINK " open" ))
439
+ if (auto docsURL = App::get ().metadata ().documentation_url ())
443
440
{
444
- open_url_in_os_default_web_browser (OpenSimCreatorApp::get ().docs_url ());
441
+ ui::draw_text (" OpenSim Creator Documentation" );
442
+ ui::next_column ();
443
+ ui::push_id (id++);
444
+ if (ui::draw_button (OSC_ICON_LINK " open" ))
445
+ {
446
+ open_url_in_os_default_web_browser (*docsURL);
447
+ }
448
+ ui::draw_tooltip_body_only_if_item_hovered (" this will open the documentation in a separate browser window" );
449
+ ui::pop_id ();
450
+ ui::next_column ();
445
451
}
446
- ui::draw_tooltip_body_only_if_item_hovered (" this will open the (locally installed) documentation in a separate browser window" );
447
- ui::pop_id ();
448
- ui::next_column ();
449
452
450
453
if (auto repoURL = App::get ().metadata ().repository_url ())
451
454
{
Original file line number Diff line number Diff line change @@ -262,8 +262,10 @@ class osc::SplashTab::Impl final : public TabPrivate {
262
262
App::post_event<OpenTabEvent>(*parent (), std::move (tab));
263
263
}
264
264
ui::add_screenshot_annotation_to_last_drawn_item (" SplashTab/ImportMeshesMenuItem" );
265
- if (ui::draw_menu_item (OSC_ICON_BOOK " Open Documentation" )) {
266
- open_url_in_os_default_web_browser (OpenSimCreatorApp::get ().docs_url ());
265
+ if (const auto docsURL = App::get ().metadata ().documentation_url ()) {
266
+ if (ui::draw_menu_item (OSC_ICON_BOOK " Open Documentation" )) {
267
+ open_url_in_os_default_web_browser (*docsURL);
268
+ }
267
269
}
268
270
}
269
271
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ namespace osc
33
33
std::optional<CStringView> repository_url () const { return repository_url_; }
34
34
void set_repository_url (std::string_view new_repository_url) { repository_url_ = new_repository_url; }
35
35
36
+ std::optional<CStringView> documentation_url () const { return documentation_url_; }
37
+ void set_documentation_url (std::string_view new_documentation_url) { documentation_url_ = new_documentation_url; }
38
+
36
39
std::optional<CStringView> help_url () const { return help_url_; }
37
40
void set_help_url (std::string_view new_help_url) { help_url_ = new_help_url; }
38
41
@@ -51,6 +54,7 @@ namespace osc
51
54
std::optional<std::string> version_string_;
52
55
std::optional<std::string> build_id_;
53
56
std::optional<std::string> repository_url_;
57
+ std::optional<std::string> documentation_url_;
54
58
std::optional<std::string> help_url_;
55
59
};
56
60
}
Original file line number Diff line number Diff line change 6
6
"the internet location of the software's repo - used by in-app links, installers, etc."
7
7
)
8
8
mark_as_advanced (OSC_REPO_URL)
9
+ set (
10
+ OSC_DOCS_URL "https://docs.opensimcreator.com"
11
+ CACHE STRING
12
+ "a url for the software's documentation - used by in-app links, installers, etc."
13
+ )
14
+ mark_as_advanced (OSC_DOCS_URL)
9
15
set (
10
16
OSC_HELP_URL "https://github.com/ComputationalBiomechanicsLab/opensim-creator/discussions"
11
17
CACHE STRING
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ namespace
35
35
metadata.set_build_id (OSC_BUILD_ID);
36
36
metadata.set_repository_url (OSC_REPO_URL);
37
37
metadata.set_help_url (OSC_HELP_URL);
38
+ metadata.set_documentation_url (OSC_DOCS_URL);
38
39
return metadata;
39
40
}
40
41
}
Original file line number Diff line number Diff line change 28
28
29
29
// char[]
30
30
//
31
- // the internet location of the OSC repo. Used by in-app links, shortcuts, etc.
32
- // to the repo so that users can just click and go, rather than having to separately
33
- // browse to the repo
31
+ // a URL for OSC's source code repo. Used by in-app links, shortcuts, etc. so that
32
+ // users can just click and go, rather than having to separately browse to it.
34
33
#define OSC_REPO_URL "@OSC_REPO_URL@"
35
34
35
+ // char[]
36
+ //
37
+ // a URL for the OSC's documentation Used by in-app links, shortcuts, etc. so that
38
+ // users can just click and go, rather than having to separately browse to it.
39
+ #define OSC_DOCS_URL "@OSC_DOCS_URL@"
40
+
36
41
// char[]
37
42
//
38
43
// the internet location for a "help site", which is loosely defined as somewhere the user
Original file line number Diff line number Diff line change 12
12
# INSTALL configuration file.
13
13
14
14
resources = "@CMAKE_CURRENT_SOURCE_DIR@/../resources"
15
- docs_url = "file://@CMAKE_CURRENT_SOURCE_DIR@/../docs/build/index.html"
16
15
17
16
# change this if you need OSC to print more information to the log
18
17
# log_level = "trace" # trace < debug < info < warn < err < critical
You can’t perform that action at this time.
0 commit comments