From bd45fdf1e16e7d4ff49e1472ee30f269867f531e Mon Sep 17 00:00:00 2001 From: Marvin W Date: Tue, 17 Dec 2019 23:52:05 +0100 Subject: Add version and adjust some cmake --- main/CMakeLists.txt | 2 +- main/data/menu_app.ui | 4 ++++ main/src/ui/application.vala | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 2e9e6632..893137ee 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -169,7 +169,7 @@ OPTIONS ${MAIN_EXTRA_OPTIONS} ) -add_definitions(${VALA_CFLAGS} -DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DLOCALE_INSTALL_DIR=\"${LOCALE_INSTALL_DIR}\") +add_definitions(${VALA_CFLAGS} -DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DLOCALE_INSTALL_DIR=\"${LOCALE_INSTALL_DIR}\" -DDINO_VERSION=\"${PROJECT_VERSION}\") add_executable(dino ${MAIN_VALA_C} ${MAIN_GRESOURCES_TARGET} src/emojichooser.c) add_dependencies(dino ${GETTEXT_PACKAGE}-translations) target_include_directories(dino PRIVATE src) diff --git a/main/data/menu_app.ui b/main/data/menu_app.ui index 20bd66b6..55eb9551 100644 --- a/main/data/menu_app.ui +++ b/main/data/menu_app.ui @@ -16,6 +16,10 @@ app.open_shortcuts Keyboard Shortcuts + + app.about + About Dino + diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala index 0f932d18..42f4d6d5 100644 --- a/main/src/ui/application.vala +++ b/main/src/ui/application.vala @@ -80,6 +80,10 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { settings_action.activate.connect(show_settings_window); add_action(settings_action); + SimpleAction about_action = new SimpleAction("about", null); + about_action.activate.connect(show_about_window); + add_action(about_action); + SimpleAction quit_action = new SimpleAction("quit", null); quit_action.activate.connect(quit); add_action(quit_action); @@ -169,6 +173,18 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { dialog.present(); } + private void show_about_window() { + show_about_dialog(get_active_window(), + logo_icon_name: "im.dino.Dino", + program_name: "Dino", + version: Dino.VERSION.strip().length == 0 ? null : Dino.VERSION, + comments: "Dino. Communicating happiness.", + website: "https://dino.im/", + website_label: "dino.im", + copyright: "Copyright © 2016-2019 - Dino Team", + license_type: License.GPL_3_0); + } + private void show_join_muc_dialog(Account? account, Jid jid) { Dialog dialog = new Dialog.with_buttons(_("Join Channel"), window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.USE_HEADER_BAR, _("Join"), ResponseType.OK, _("Cancel"), ResponseType.CANCEL); dialog.modal = true; -- cgit v1.2.3-70-g09d2