[gnome-music/wip/cdavis/about-window] application: Port about to AdwAboutWindow




commit 8681345cdd99769793c26a4ed56c354c59a44518
Author: Christopher Davis <christopherdavis gnome org>
Date:   Thu Jul 7 18:49:52 2022 -0400

    application: Port about to AdwAboutWindow
    
    AdwAboutWindow doesn't support subclassing,
    so move the definition to application.py.

 data/meson.build                   |   3 +-
 data/org.gnome.Music.gresource.xml |   1 -
 data/ui/AboutDialog.ui.in          | 226 -------------------------------------
 data/ui/meson.build                |  24 ----
 gnome-music.in                     |   4 +-
 gnomemusic/application.py          | 128 ++++++++++++++++++++-
 meson.build                        |  17 ++-
 7 files changed, 142 insertions(+), 261 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index cbc6233a3..e67c1a31e 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -6,8 +6,7 @@ gnome.compile_resources(
   gresource_bundle: true,
   source_dir: meson.current_build_dir(),
   install_dir: PKGDATA_DIR,
-  install: true,
-  dependencies: about_dialog
+  install: true
 )
 
 schema_src = PROJECT_RDNN_NAME + '.gschema.xml'
diff --git a/data/org.gnome.Music.gresource.xml b/data/org.gnome.Music.gresource.xml
index 2be39220b..77029c6d6 100644
--- a/data/org.gnome.Music.gresource.xml
+++ b/data/org.gnome.Music.gresource.xml
@@ -4,7 +4,6 @@
     <file alias="gtk/help-overlay.ui" preprocess="xml-stripblanks">ui/help-overlay.ui</file>
     <file>style.css</file>
     <file>icons/welcome-music.svg</file>
-    <file preprocess="xml-stripblanks">ui/AboutDialog.ui</file>
     <file preprocess="xml-stripblanks">ui/AlbumCover.ui</file>
     <file preprocess="xml-stripblanks">ui/AlbumCoverListItem.ui</file>
     <file preprocess="xml-stripblanks">ui/AlbumWidget.ui</file>
diff --git a/gnome-music.in b/gnome-music.in
index 3cc186f00..7f69c1b06 100755
--- a/gnome-music.in
+++ b/gnome-music.in
@@ -51,7 +51,7 @@ Adw.init()
 
 LOCALE_DIR = '@localedir@'
 PKGDATA_DIR = '@pkgdatadir@'
-
+VERSION = '@version@'
 
 def set_exception_hook():
     """Configures sys.excepthook to enforce Gtk application exiting."""
@@ -92,7 +92,7 @@ def run_application():
     """Runs GNOME Music application and returns its exit code."""
     from gnomemusic.application import Application
 
-    app = Application('@application_id@')
+    app = Application('@application_id@', VERSION)
     signal.signal(signal.SIGINT, signal.SIG_DFL)
     return app.run(sys.argv)
 
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index 30ba7606d..25515f0a5 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -46,14 +46,13 @@ from gnomemusic.pauseonsuspend import PauseOnSuspend
 from gnomemusic.player import Player
 from gnomemusic.scrobbler import LastFmScrobbler
 from gnomemusic.search import Search
-from gnomemusic.widgets.aboutdialog import AboutDialog
 from gnomemusic.widgets.lastfmdialog import LastfmDialog
 from gnomemusic.window import Window
 
 
 class Application(Adw.Application):
 
-    def __init__(self, application_id):
+    def __init__(self, application_id, version):
         super().__init__(
             application_id=application_id,
             flags=Gio.ApplicationFlags.FLAGS_NONE)
@@ -62,6 +61,8 @@ class Application(Adw.Application):
         GLib.set_prgname(application_id)
         GLib.setenv("PULSE_PROP_media.role", "music", True)
 
+        self._version = version
+
         self._window = None
 
         self._log = MusicLogger()
@@ -225,8 +226,127 @@ class Application(Adw.Application):
         self._lastfm_dialog.present()
 
     def _about(self, action, param):
-        about = AboutDialog()
-        about.props.transient_for = self._window
+        developers = [
+            "Abhinav Singh",
+            "Adam Blanchet",
+            "Adrian Solom",
+            "Alberto Fanjul",
+            "Alexander Mikhaylenko",
+            "Andre Klapper",
+            "Andreas Nilsson",
+            "Apostol Bakalov",
+            "Arnel A. Borja",
+            "Ashwani Singh Tanwar",
+            "Ashwin Mohan",
+            "Atharva Veer",
+            "Benoît Legat",
+            "Bilal Elmoussaoui",
+            "Billy Barrow",
+            "Bruce Cowan",
+            "Carlos Garnacho",
+            "Carlos Soriano",
+            "Chinmay Gurjar",
+            "Christophe van den Abbeele",
+            "Christopher Davis",
+            "Clayton G. Hobbs",
+            "Divyanshu Vishwakarma",
+            "Eslam Mostafa",
+            "Elias Entrup",
+            "Erik Inkinen",
+            "Evan Nehring",
+            "Evandro Giovanini",
+            "Fabiano Fidêncio",
+            "Felipe Borges",
+            "Florian Darfeuille",
+            "Gaurav Narula",
+            "Georges Basile Stavracas Neto",
+            "Guillaume Quintard",
+            "Gyanesh Malhotra",
+            "Harry Xie",
+            "Hugo Posnic",
+            "Ishaan Shah",
+            "Islam Bahnasy",
+            "Jakub Steiner",
+            "James A. Baker",
+            "Jan Alexander Steffens",
+            "Janne Körkkö",
+            "Jan-Michael Brummer",
+            "Jean Felder",
+            "Jeremy Bicha",
+            "Jesus Bermudez Velazquez",
+            "Jordan Petridis",
+            "Juan José González",
+            "Juan Suarez",
+            "Kainaat Singh",
+            "Kalev Lember",
+            "Kevin Haller",
+            "Konstantin Pospelov",
+            "Koushik Sahu",
+            "Lucy Coleclough",
+            "Marinus Schraal",
+            "Michael Catanzaro",
+            "Mohanna Datta Yelugoti",
+            "Nick Richards",
+            "Niels De Graef",
+            "Nikolay Yanchuk",
+            "Nils Reuße",
+            "Pablo Palácios",
+            "Phil Dawson",
+            "Piotr Drąg",
+            "Prashant Tyagi",
+            "Rafael Coelho",
+            "Rashi Sah",
+            "Rasmus Thomsen",
+            "Reuben Dsouza",
+            "Robert Greener",
+            "Sabri Ünal",
+            "Sagar Lakhani",
+            "Sai Suman Prayaga",
+            "Sam Hewitt",
+            "Sam Thursfield",
+            "Sambhav Kothari",
+            "Seif Lotfy",
+            "Shivani Poddar",
+            "Shivansh Handa",
+            "Simon McVittie",
+            "Sophie Herold",
+            "Subhadip Jana",
+            "Sumaid Syed",
+            "Suyash Garg",
+            "Tapasweni Pathak",
+            "Taylor Garcia",
+            "Tjipke van der Heide",
+            "Vadim Rutkovsky",
+            "Veerasamy Sevagen",
+            "Vineet Reddy",
+            "Weifang Lai",
+            "Yann Delaby",
+            "Yash Singh",
+            "Yosef Or Boczko"
+        ]
+
+        designers = [
+            "Allan Day",
+            "Jakub Steiner",
+            "William Jon McCann"
+        ]
+
+        about = Adw.AboutWindow(
+            application_name=_("Music"),
+            application_icon=self.props.application_id,
+            developer_name=_("The GNOME Project"),
+            transient_for=self._window,
+            developers=developers,
+            designers=designers,
+            translator_credits=_("translator-credits"),
+            version=self._version,
+            website="https://wiki.gnome.org/Apps/Music";,
+            issue_url=
+                "https://gitlab.gnome.org/GNOME/gnome-music/-/issues/new";,
+            copyright=_("Copyright © 2018 GNOME Music Developers"),
+            license_type=Gtk.License.GPL_2_0)
+
+        # about.props.transient_for = self._window
         about.present()
 
     def do_startup(self):
diff --git a/meson.build b/meson.build
index b3892a2d7..02cbbb2b3 100644
--- a/meson.build
+++ b/meson.build
@@ -39,13 +39,26 @@ APPLICATION_ID = 'org.gnome.Music@0@'.format(PROFILE)
 PYTHON_DIR = py_installation.get_path('purelib')
 PKGDATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), APPLICATION_ID)
 PKGLIB_DIR = join_paths(get_option('prefix'), get_option('libdir'), APPLICATION_ID)
+VCS_TAG = ''
+if get_option('profile') != 'default'
+  git = find_program('git', required : false)
+  if git.found()
+    VCS_TAG = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
+  endif
+  if VCS_TAG == ''
+    VCS_TAG = '-devel'
+  else
+    VCS_TAG = '-@0@'.format(VCS_TAG)
+  endif
+endif
+
 
 # Dependencies
 dependency('glib-2.0', version: '>= 2.67.1')
 dependency('goa-1.0', version: '>= 3.35.90')
 dependency('gobject-introspection-1.0', version: '>= 1.35.0')
 dependency('gtk4', version: '>= 4.5.0')
-dependency('libadwaita-1', version: '>= 1.0')
+dependency('libadwaita-1', version: '>= 1.2.alpha')
 dependency('libmediaart-2.0', version: '>= 1.9.1')
 dependency('libsoup-2.4')
 dependency('tracker-sparql-3.0', version: '>= 2.99.3')
@@ -55,7 +68,6 @@ dependency('py3cairo', version: '>= 1.14.0')
 dependency('grilo-0.3', version: '>= 0.3.13', fallback: ['grilo', 'libgrl_dep'])
 dependency('grilo-plugins-0.3', version: '>= 0.3.12', fallback: ['grilo-plugins', 'grilo_plugins_dep'])
 
-subdir('data/ui')
 subdir('data')
 subdir('help')
 subdir('po')
@@ -73,6 +85,7 @@ bin_config.set('pkgdatadir', PKGDATA_DIR)
 bin_config.set('localedir', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
 bin_config.set('pythondir', PYTHON_DIR)
 bin_config.set('schemasdir', PKGDATA_DIR)
+bin_config.set('version', meson.project_version() + VCS_TAG)
 
 bin_config.set('local_build', 'False')
 


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