Skip to content

Commit

Permalink
#1362 Add "About" entry to help menu of plug-in
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Dec 17, 2024
1 parent 1a133a4 commit 00f86a1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ Generate the report:

[source]
----
cargo about generate --fail --workspace --all-features --threshold 0.93 about.hbs > third-party-licenses.html
cargo about generate --fail --workspace --all-features --threshold 0.93 about.hbs > about.html
----

== Release
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions main/src/infrastructure/plugin/backbone_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,12 @@ impl BackboneShell {
BackboneShell::helgoboss_resource_dir_path().join("ReaLearn")
}

pub fn helgobox_data_dir_path() -> Utf8PathBuf {
Reaper::get()
.resource_path()
.join("Data/helgoboss/helgobox")
}

pub fn realearn_data_dir_path() -> Utf8PathBuf {
Reaper::get()
.resource_path()
Expand Down
8 changes: 8 additions & 0 deletions main/src/infrastructure/ui/header_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ impl HeaderPanel {
),
item("Contact developer", HelpMenuAction::ContactDeveloper),
item("Donate", HelpMenuAction::Donate),
item("About", HelpMenuAction::OpenAboutPage),
];
anonymous_menu(entries)
};
Expand All @@ -973,6 +974,7 @@ impl HeaderPanel {
HelpMenuAction::OpenRealearnForum => self.open_realearn_forum(),
HelpMenuAction::ContactDeveloper => self.contact_developer(),
HelpMenuAction::OpenRealearnWebsite => self.open_realearn_website(),
HelpMenuAction::OpenAboutPage => self.open_about_page(),
HelpMenuAction::Donate => self.donate(),
};
Ok(())
Expand Down Expand Up @@ -2619,6 +2621,11 @@ impl HeaderPanel {
open_in_browser("https://www.helgoboss.org/projects/realearn/");
}

fn open_about_page(&self) {
let about_html = BackboneShell::helgobox_data_dir_path().join("doc/about.html");
open_in_browser(about_html.as_str());
}

fn register_listeners(self: SharedView<Self>) {
let shared_session = self.session();
let session = shared_session.borrow();
Expand Down Expand Up @@ -3204,6 +3211,7 @@ enum HelpMenuAction {
OpenRealearnControllerList,
OpenRealearnForum,
OpenRealearnWebsite,
OpenAboutPage,
ContactDeveloper,
Donate,
}
Expand Down

0 comments on commit 00f86a1

Please sign in to comment.