diff --git a/data/camera.ui b/data/camera.ui index 23dd058..d976169 100644 --- a/data/camera.ui +++ b/data/camera.ui @@ -229,9 +229,11 @@ - - 0 - Settings aren't functional yet + + About + 10 + 10 + app.about diff --git a/meson.build b/meson.build index 163fc20..468a7c2 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('megapixels', 'c') +project('megapixels', 'c', version: '1.1.0') gnome = import('gnome') gtkdep = dependency('gtk4') @@ -20,6 +20,8 @@ configure_file( output: 'config.h', configuration: conf) +add_global_arguments('-DVERSION="@0@"'.format(meson.project_version()), language: 'c') + # Define DEBUG for debug builds only (debugoptimized is not included on this one) if get_option('buildtype') == 'debug' add_global_arguments('-DDEBUG', language: 'c') diff --git a/src/main.c b/src/main.c index b096e8e..1126ae1 100644 --- a/src/main.c +++ b/src/main.c @@ -456,6 +456,19 @@ run_capture_action(GSimpleAction *action, GVariant *param, gpointer user_data) mp_io_pipeline_capture(); } +void +run_about_action(GSimpleAction *action, GVariant *param, GApplication *app) +{ + gtk_show_about_dialog(NULL, "program-name", "Megapixels", + "title", "Megapixels", + "logo-icon-name", "org.postmarketos.Megapixels", + "comments", "The postmarketOS camera application", + "website", "https://sr.ht/~martijnbraam/megapixels", + "version", VERSION, + "license-type", GTK_LICENSE_GPL_3_0_ONLY, + NULL); +} + void run_quit_action(GSimpleAction *action, GVariant *param, GApplication *app) { @@ -889,6 +902,7 @@ activate(GtkApplication *app, gpointer data) create_simple_action(app, "close-settings", G_CALLBACK(run_close_settings_action)); create_simple_action(app, "open-last", G_CALLBACK(run_open_last_action)); create_simple_action(app, "open-photos", G_CALLBACK(run_open_photos_action)); + create_simple_action(app, "about", G_CALLBACK(run_about_action)); create_simple_action(app, "quit", G_CALLBACK(run_quit_action)); // Setup shortcuts