[gnome-calculator/wip/cdavis/about-dialog] calculator: Port to AdwAboutWindow




commit 4353b9a3a80d5851bfd792b824e72476ca7728ea
Author: Christopher Davis <christopherdavis gnome org>
Date:   Thu Jul 7 15:02:13 2022 -0400

    calculator: Port to AdwAboutWindow
    
    While adw_show_about_window() exists, there's no Vala override for it,
    so just do it manually. Vala has a nice syntax for that anyway, and it's
    also checked at compile time now.

 meson.build               |  2 +-
 src/gnome-calculator.vala | 40 ++++++++++++++++++----------------------
 2 files changed, 19 insertions(+), 23 deletions(-)
---
diff --git a/meson.build b/meson.build
index 29b8c541..28b764ae 100644
--- a/meson.build
+++ b/meson.build
@@ -102,7 +102,7 @@ gnome.post_install(
   gtk_update_icon_cache: true,
 )
 
-libadwaita = dependency('libadwaita-1', version: '>= 1.0.0')
+libadwaita = dependency('libadwaita-1', version: '>= 1.2.alpha')
 gtksourceview = dependency('gtksourceview-5', version: '>= 5.3.0')
 subdir('data')
 subdir('lib')
diff --git a/src/gnome-calculator.vala b/src/gnome-calculator.vala
index 20902ab1..ad36f346 100644
--- a/src/gnome-calculator.vala
+++ b/src/gnome-calculator.vala
@@ -300,7 +300,7 @@ public class Calculator : Adw.Application
 
     private void about_cb ()
     {
-        string[] authors =
+        string[] developers =
         {
             "Robert Roth <robert roth off gmail com>",
             "Robert Ancell",
@@ -315,27 +315,23 @@ public class Calculator : Adw.Application
             null
         };
 
-        /* The translator credits. Please translate this with your name (s). */
-        var translator_credits = _("translator-credits");
-
-        Gtk.show_about_dialog (get_active_window (),
-                               "program-name",
-                               /* Program name in the about dialog */
-                               NAME_PREFIX + _("Calculator"),
-                               "title", _("About Calculator"),
-                               "version", VERSION,
-                               "website", "https://wiki.gnome.org/Apps/Calculator";,
-                               "copyright",
-                               "\xc2\xa9 1986–2022 The Calculator authors",
-                               /* We link to MPFR and MPC which are  LGPLv3+, so Calculator cannot be 
conveyed as GPLv2+ */
-                               "license-type", Gtk.License.GPL_3_0,
-                               "comments",
-                               /* Short description in the about dialog */
-                               _("Calculator with financial and scientific modes."),
-                               "authors", authors,
-                               "documenters", documenters,
-                               "translator_credits", translator_credits,
-                               "logo-icon-name", APP_ID);
+        var about = new Adw.AboutWindow () {
+            transient_for = get_active_window (),
+            application_name =  _("Calculator"),
+            application_icon = APP_ID,
+            version =  VERSION,
+            website = "https://wiki.gnome.org/Apps/Calculator";,
+            issue_url = "https://gitlab.gnome.org/GNOME/gnome-calculator/-/issues/new";,
+            copyright = "\xc2\xa9 1986–2022 The Calculator authors",
+            /* We link to MPFR and MPC which are  LGPLv3+, so Calculator cannot be conveyed as GPLv2+ */
+            license_type = Gtk.License.GPL_3_0,
+            developers = developers,
+            documenters = documenters,
+            /* The translator credits. Please translate this with your name (s). */
+            translator_credits = _("translator-credits")
+        };
+
+        about.present();
     }
 
     private void quit_cb ()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]