Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ui: add GitHub repository link to About dialog
  • Loading branch information
HopeItBuilds committed Mar 21, 2026
commit ab46b1008b60811c4e8ae9909605d9e9bee1a2af
2 changes: 2 additions & 0 deletions ares/ares/ares.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const string License = "ISC";
const string LicenseURI = "https://opensource.org/licenses/ISC";
const string Website = "@ARES_WEBSITE@";
const string WebsiteURI = "https://@ARES_WEBSITE@/";
const string GitHub = "@ARES_GITHUB@";
const string GitHubURI = "https://@ARES_GITHUB_URI@/";
const u32 SerializerSignature = 0x31545342; //"BST1" (little-endian)

}
2 changes: 2 additions & 0 deletions ares/ares/ares.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ namespace ares {
extern const string LicenseURI;
extern const string Website;
extern const string WebsiteURI;
extern const string GitHub;
extern const string GitHubURI;
extern const u32 SerializerSignature;

namespace VFS {
Expand Down
2 changes: 2 additions & 0 deletions cmake/common/bootstrap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ endif()
# Set default global project variables
set(ARES_NAME "ares")
set(ARES_WEBSITE "ares-emu.net")
set(ARES_GITHUB "ares-emulator/ares")
set(ARES_GITHUB_URI "github.com/ares-emulator/ares")
set(
ARES_COMMENTS
"ares is a cross-platform, open source, multi-system emulator, focusing on accuracy and preservation."
Expand Down
7 changes: 4 additions & 3 deletions desktop-ui/presentation/presentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ Presentation::Presentation() {
.setCopyright(ares::Copyright)
.setLicense(ares::License, ares::LicenseURI)
.setWebsite(ares::Website, ares::WebsiteURI)
.setGitHub(ares::GitHub, ares::GitHubURI)
.setAlignment(presentation)
.show();
});
Expand All @@ -284,7 +285,7 @@ Presentation::Presentation() {
program.load(emulator, filenames.front());
}
});

Application::onOpenFile([&](auto filename) {
Program::Guard guard;
if(auto emulator = program.identify(filename)) {
Expand Down Expand Up @@ -563,7 +564,7 @@ auto Presentation::refreshSystemMenu() -> void {
if(auto dipSwitches = ares::Node::find<ares::Node::Object>(emulator->root, "DIP Switches")) {
Menu dipSwitchMenu{&systemMenu};
dipSwitchMenu.setText("DIP Switches");

for(auto dip : ares::Node::enumerate<ares::Node::Setting::Boolean>(emulator->root)) {
MenuCheckItem item{&dipSwitchMenu};
item.setText(dip->name());
Expand Down Expand Up @@ -792,7 +793,7 @@ auto Presentation::loadShaders() -> void {
hiro::MessageDialog()
.setTitle("Warning")
.setAlignment(hiro::Alignment::Center)
.setText({"Requested shader not found: ", location, settings.video.shader ,
.setText({"Requested shader not found: ", location, settings.video.shader ,
"\nUsing existing defined shader: ", location, existingShader})
.warning();
settings.video.shader = existingShader;
Expand Down
25 changes: 25 additions & 0 deletions hiro/extension/about-dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ auto AboutDialog::setWebsite(const string& website, const string& uri) -> type&
return *this;
}

auto AboutDialog::setGitHub(const string& github, const string& uri) -> type& {
state.github = github;
state.githubURI = uri;
return *this;
}

auto AboutDialog::show() -> void {
Window window;
window.onClose([&] { window.setModal(false); });
Expand Down Expand Up @@ -148,6 +154,25 @@ auto AboutDialog::show() -> void {
}
if(!state.website) websiteLayout.setVisible(false);

HorizontalLayout githubLayout{&layout, Size{~0, 0}, 0};
githubLayout.setCollapsible();
Label githubLabel{&githubLayout, Size{160, 0}, 3_sx};
githubLabel.setAlignment(1.0);
githubLabel.setFont(Font().setBold());
githubLabel.setText("GitHub:");
HorizontalLayout githubValueLayout{&githubLayout, Size{~0, 0}};
Label githubValue{&githubValueLayout, Size{0, 0}};
githubValue.setAlignment(0.0);
githubValue.setText(state.github);
if(state.githubURI) {
githubValue.setForegroundColor(SystemColor::Link).setFont(Font().setBold());
githubValue.setMouseCursor(MouseCursor::Hand);
githubValue.onMouseRelease([&](auto button) {
if(button == Mouse::Button::Left) invoke(state.githubURI);
});
}
if(!state.github) githubLayout.setVisible(false);

window.setTitle({"About ", state.name ? state.name : Application::name()});
window.setSize({max(480_sx, layout.minimumSize().width()), layout.minimumSize().height()});
window.setResizable(false);
Expand Down
3 changes: 3 additions & 0 deletions hiro/extension/about-dialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct AboutDialog {
auto setName(const string& name = "") -> type&;
auto setVersion(const string& version = "") -> type&;
auto setWebsite(const string& website = "", const string& uri = "") -> type&;
auto setGitHub(const string& github = "", const string& uri = "") -> type&;
auto show() -> void;

private:
Expand All @@ -28,6 +29,8 @@ struct AboutDialog {
string version;
string website;
string websiteURI;
string github;
string githubURI;
} state;
};

Expand Down
1 change: 1 addition & 0 deletions mia/program/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ProgramWindow::ProgramWindow() {
.setCopyright(ares::Copyright)
.setLicense(ares::License, ares::LicenseURI)
.setWebsite(ares::Website, ares::WebsiteURI)
.setGitHub(ares::GitHub, ares::GitHubURI)
.setAlignment(*this)
.show();
});
Expand Down