From 558bfbab432caaafa324e669d0987457b5e48b80 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 26 Apr 2025 16:34:56 +0200 Subject: ui: implement basic about dialog --- app/CMakeLists.txt | 10 ++++++++++ app/ch.arknet.Turns.metainfo.xml | 38 ++++++++++++++++++++++++++++++++++++++ app/src/main.cpp | 13 ++++++++++++- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 app/ch.arknet.Turns.metainfo.xml (limited to 'app') diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index ed740b2..669cfeb 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -17,6 +17,11 @@ target_link_libraries("app" PRIVATE "$<$:-Wl,--no-whole-archive>" ) +target_add_glib_resources("app" + PREFIX "metainfo" + UI_FILES "ch.arknet.Turns.metainfo.xml" +) + set_target_properties("app" PROPERTIES OUTPUT_NAME "turns" ) @@ -25,6 +30,11 @@ install(TARGETS "app" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ) +install(FILES + "${CMAKE_CURRENT_SOURCE_DIR}/ch.arknet.Turns.metainfo.xml" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo" +) + configure_file("desktop.in" "turns.desktop" ) diff --git a/app/ch.arknet.Turns.metainfo.xml b/app/ch.arknet.Turns.metainfo.xml new file mode 100644 index 0000000..621c1ee --- /dev/null +++ b/app/ch.arknet.Turns.metainfo.xml @@ -0,0 +1,38 @@ + + + ch.arknet.Turns + CC-BY-SA-4.0 + LGPL-2.1-or-later + Turns + Züge + A simple turn order tracker + +

+ Turns is an application to track turn order for TTRPGs like Dungeons and Dragons or Call of Cthulhu. +

+
+ + + +

This is the first public release

+
+
+
+ + keyboard + pointing + + + + Role-playing Games + Tabletop Games + + + Felix Morgner + + felix.morgner@gmail.com + ch.arknet.Turns.desktop + https://source.arknet.ch/fmorgner/turns + https://source.arknet.ch/fmorgner/turns/-/issues + https://source.arknet.ch/fmorgner/turns +
\ No newline at end of file diff --git a/app/src/main.cpp b/app/src/main.cpp index 7595dc3..8016a83 100644 --- a/app/src/main.cpp +++ b/app/src/main.cpp @@ -3,6 +3,7 @@ #include "turns/ui/init.hpp" #include "turns/ui/windows/tracker.hpp" +#include #include #include @@ -10,8 +11,11 @@ #include #include +#include #include +#include +#include #include #include #include @@ -19,7 +23,6 @@ #include #include -#include auto add_new_window(Glib::RefPtr app, Glib::RefPtr builder, Glib::RefPtr settings) { @@ -31,6 +34,13 @@ auto add_new_window(Glib::RefPtr app, Glib::RefPtr app) +{ + auto active_window = app->get_active_window(); + auto dialog = Gtk::make_managed("metainfo/ch.arknet.Turns.metainfo.xml", ""); + dialog->present(active_window); +} + auto main(int argc, char * argv[]) -> int { setlocale(LC_ALL, ""); @@ -50,6 +60,7 @@ auto main(int argc, char * argv[]) -> int style_manager->set_color_scheme(Adwaita::ColorScheme::PreferLight); app->add_action("quit", sigc::mem_fun(*app, &Adwaita::Application::quit)); + app->add_action("about", sigc::bind(&show_about, app)); app->set_accel_for_action("app.quit", "q"); app->set_accel_for_action("win.clear", "x"); app->set_accel_for_action("win.next", "space"); -- cgit v1.2.3