diff --git a/.gitignore b/.gitignore
index 244c3ee..f42fdfe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,5 @@ __pycache__/
*.py[cod]
*$py.class
-# Files created by setuptools
-build/
-dist/
-*.egg-info/
+/build/
+/install/
diff --git a/README.textile b/README.textile
index 98c9d12..ea0a822 100644
--- a/README.textile
+++ b/README.textile
@@ -12,62 +12,42 @@ Dependencies:
* "GTK":http://www.gtk.org 3 (>= 3.22) ("python-gobject":https://live.gnome.org/PyGObject)
* "Avahi":http://www.avahi.org (optional)
* "python-keyring":http://pypi.python.org/pypi/keyring (optional)
-* "python-setuptools":https://pypi.python.org/pypi/setuptools (building)
+* "meson":https://mesonbuild.com/ and "ninja":https://ninja-build.org/ (building)
Additionally a "MPD":http://www.musicpd.org server (version >= 0.21.0) is required at runtime.
+
h2. Building
-Build the application with _setuptools_:
+Build the application with _meson_ and _ninja_:
-bc. $ python3 setup.py build
+bc. $ meson build
+$ ninja -C build
h2. Running/Testing
-For testing the application and running it without (system-wide) installation, donwload/clone the code, build it as described above and then use _setuptools_ to install it for the current user:
+For testing the application and running it without (system-wide) installation,
+donwload/clone the code, build it with the @--prefix@ option and install it
+with @ninja@:
-bc. $ python3 setup.py develop --user
+bc. $ meson --prefix $(pwd)/install build
+$ ninja -C build
+$ ninja -C build install
-After that you can run it with
+After that you can run it with _meson’s_ @devenv@ command:
-bc. $ ~/.local/bin/mcg
-
-or if _~/.local/bin/_ is on your PATH
-
-bc. $ mcg
+bc. $ meson devenv -C build src/mcg
h2. Installing
-Install the application system-wide with _setuptools_:
+Install the application system-wide with _meson_ (after building):
-bc. # python3 setup.py install
+bc. $ ninja -C build install
-Note: _On Linux using the distribution’s package manager is the preferred way of installing applications system-wide._
-
-
-h2. Packaging
-
-Create a distribution package with _setuptools_:
-
-bc. $ python3 setup.py sdist
-
-
-h2. Cover/image configuration
-
-Since MPD itself does not provide the cover/image/album art binaries, yet, _mcg_ has to look for them itself. In order to find the images a base folder has to be configured on the Connection tab as “Image Directory”. This value can either be a local (absolute) folder (e. g. /home/user/music/) or an http URL (e. g. http://localhost/music/). _mcg_ then adds the (relative) folder of the audio file to this paths and tries different names for the actual file:
-
-# the album name
-# “cover”
-# “folder”
-
-The following file extensions are used:
-
-# png
-# jpg
-
-The first combination that results in an existing file is used as cover image. If no matching file exists, _mcg_ will try to traverse the directory for any image file as fallback—this is done for local paths only though, not for http URLs.
+Note: _On Linux using the distribution’s package manager is the preferred way
+of installing applications system-wide._
h2. Screenshots
diff --git a/data/icons/mcg.svg b/data/icons/hicolor/scalable/apps/xyz.suruatoel.mcg.svg
similarity index 100%
rename from data/icons/mcg.svg
rename to data/icons/hicolor/scalable/apps/xyz.suruatoel.mcg.svg
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..20bdb7c
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,7 @@
+application_id = 'xyz.suruatoel.mcg'
+
+scalable_dir = join_paths('hicolor', 'scalable', 'apps')
+install_data(
+ join_paths(scalable_dir, ('@0@.svg').format(application_id)),
+ install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir)
+)
diff --git a/data/mcg.desktop b/data/mcg.desktop
index 81a2717..2b6067e 100644
--- a/data/mcg.desktop
+++ b/data/mcg.desktop
@@ -4,7 +4,7 @@ Name=CoverGrid (mcg)
Comment=CoverGrid for the Music Player Daemon
Keywords=mpd;
Type=Application
-Icon=mcg.svg
+Icon=xyz.suruatoel.mcg
Exec=mcg
Categories=AudioVideo;
StartupNotify=true
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..4de86c0
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,34 @@
+i18n = import('i18n')
+
+desktop_file = i18n.merge_file(
+ input: 'mcg.desktop',
+ output: 'mcg.desktop',
+ type: 'desktop',
+ po_dir: '../po',
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'applications')
+)
+
+desktop_utils = find_program('desktop-file-validate', required: false)
+if desktop_utils.found()
+ test('Validate desktop file', desktop_utils,
+ args: [desktop_file]
+ )
+endif
+
+gnome = import('gnome')
+pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
+
+gnome.compile_resources('mcg',
+ 'xyz.suruatoel.mcg.gresource.xml',
+ gresource_bundle: true,
+ install: true,
+ install_dir: pkgdatadir,
+)
+
+install_data('xyz.suruatoel.mcg.gschema.xml',
+ install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
+)
+gnome.compile_schemas(depend_files: files('xyz.suruatoel.mcg.gschema.xml'))
+
+subdir('icons')
diff --git a/data/ui/info-dialog.ui b/data/ui/info-dialog.ui
index 7fef32c..924c75f 100644
--- a/data/ui/info-dialog.ui
+++ b/data/ui/info-dialog.ui
@@ -13,7 +13,7 @@
3.0.2
CoverGrid is a client for the Music Player Daemon, focusing on albums instead of single tracks.
http://www.suruatoel.xyz/codes/mcg
-
+ xyz.suruatoel.mcg
gpl-3-0
diff --git a/data/ui/window.ui b/data/ui/window.ui
index 1fb9a36..5e24217 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -4,7 +4,7 @@
False
- mcg
+ xyz.suruatoel.mcg
diff --git a/data/xyz.suruatoel.mcg.gresource.xml b/data/xyz.suruatoel.mcg.gresource.xml
index 66dfc0e..9ebd10e 100644
--- a/data/xyz.suruatoel.mcg.gresource.xml
+++ b/data/xyz.suruatoel.mcg.gresource.xml
@@ -3,7 +3,6 @@
gtk.css
noise-texture.png
- icons/mcg.svg
ui/window.ui
ui/gtk.menu.ui
ui/info-dialog.ui
diff --git a/mcg/mcg.py b/mcg/mcg.py
deleted file mode 100755
index 17efe38..0000000
--- a/mcg/mcg.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env python3
-
-
-import sys
-
-from mcg import Environment
-
-
-
-
-def setup_resources():
- from gi.repository import Gio
-
- resource = Gio.resource_load(
- Environment.get_data('xyz.suruatoel.mcg.gresource')
- )
- Gio.Resource._register(resource)
-
-
-def setup_locale():
- import gettext
-
- gettext.bindtextdomain('mcg', Environment.get_locale())
- gettext.textdomain('mcg')
-
-
-def run_application():
- from mcg.application import Application
-
- app = Application()
- return app.run(sys.argv)
-
-
-def main():
- setup_resources()
- setup_locale()
- return run_application()
-
-
-
-
-if __name__ == "__main__":
- main()
- sys.exit(main())
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..809a8bb
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,19 @@
+project('mcg',
+ version: '3.0.2',
+ meson_version: '>= 0.59.0',
+ default_options: [
+ 'warning_level=2',
+ 'werror=false',
+ ],
+)
+
+subdir('data')
+subdir('src')
+subdir('po')
+
+gnome = import('gnome')
+gnome.post_install(
+ glib_compile_schemas: true,
+ gtk_update_icon_cache: true,
+ update_desktop_database: true,
+)
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..3ae2b72
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1 @@
+en de
diff --git a/po/POTFILES b/po/POTFILES
new file mode 100644
index 0000000..30a190f
--- /dev/null
+++ b/po/POTFILES
@@ -0,0 +1,29 @@
+data/xyz.suruatoel.mcg.gschema.xml
+data/ui/album-headerbar.ui
+data/ui/connection-panel.ui
+data/ui/cover-panel.ui
+data/ui/cover-toolbar.ui
+data/ui/gtk.menu.ui
+data/ui/info-dialog.ui
+data/ui/library-panel.ui
+data/ui/library-toolbar.ui
+data/ui/playlist-panel.ui
+data/ui/playlist-toolbar.ui
+data/ui/server-panel.ui
+data/ui/server-toolbar.ui
+data/ui/shortcuts-dialog.ui
+data/ui/window.ui
+src/albumheaderbar.py
+src/application.py
+src/client.py
+src/connectionpanel.py
+src/coverpanel.py
+src/infodialog.py
+src/librarypanel.py
+src/main.py
+src/playlistpanel.py
+src/serverpanel.py
+src/shortcutsdialog.py
+src/utils.py
+src/window.py
+src/zeroconf.py
diff --git a/locale/de/LC_MESSAGES/mcg.mo b/po/de.mo
similarity index 100%
rename from locale/de/LC_MESSAGES/mcg.mo
rename to po/de.mo
diff --git a/locale/de/LC_MESSAGES/mcg.po b/po/de.po
similarity index 61%
rename from locale/de/LC_MESSAGES/mcg.po
rename to po/de.po
index b25d54b..107757f 100644
--- a/locale/de/LC_MESSAGES/mcg.po
+++ b/po/de.po
@@ -1,11 +1,12 @@
msgid ""
msgstr ""
"Project-Id-Version: CoverGrid (mcg)\n"
-"POT-Creation-Date: 2020-10-24 14:41+0200\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2022-09-05 15:08+0200\n"
"PO-Revision-Date: 2020-10-24 14:41+0200\n"
"Last-Translator: coderkun \n"
"Language-Team: \n"
-"Language: de\n"
+"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -13,8 +14,87 @@ msgstr ""
"X-Poedit-Basepath: ../../..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
-"X-Poedit-SearchPath-0: mcg\n"
-"X-Poedit-SearchPath-1: data/ui\n"
+
+#: data/xyz.suruatoel.mcg.gschema.xml:11
+msgid "MPD host"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:12
+msgid "MPD host to connect to"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:16
+msgid "MPD port"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:17
+msgid "MPD port to connect to"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:21
+#, fuzzy
+msgid "Connection state"
+msgstr "Verbindung"
+
+#: data/xyz.suruatoel.mcg.gschema.xml:22
+msgid "State of last connection"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:26
+msgid "Window width"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:27
+msgid "The window width in pixels."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:31
+msgid "Window height"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:32
+msgid "The window height in pixels."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:36
+msgid "Window maximized"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:37
+msgid "Whether or not the window is in maximized state."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:42
+msgid "Last selected panel"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:43
+msgid "The index of the last selected panel."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:48
+msgid "Size of library items"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:49
+msgid "The size of items displayed in the library."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:53
+msgid "Sort criterium for library items"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:54
+msgid "The sort criterium of items displayed in the library."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:58
+msgid "Sort type for library items"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:59
+msgid "The sort type of items displayed in the library."
+msgstr ""
#: data/ui/album-headerbar.ui:17
msgid "Title"
@@ -24,27 +104,27 @@ msgstr "Titel"
msgid "Artist"
msgstr "Künstler"
-#: data/ui/connection-panel.ui:75
+#: data/ui/connection-panel.ui:76
msgid "Enter hostname or IP address"
msgstr "Hostnamen oder IP-Adresse eingeben"
-#: data/ui/connection-panel.ui:88
+#: data/ui/connection-panel.ui:89
msgid "Enter password or leave blank"
msgstr "Passwort eingeben oder leer lassen"
-#: data/ui/connection-panel.ui:117
+#: data/ui/connection-panel.ui:118
msgid "Host:"
msgstr "Host:"
-#: data/ui/connection-panel.ui:129
+#: data/ui/connection-panel.ui:130
msgid "Port:"
msgstr "Port:"
-#: data/ui/connection-panel.ui:141
+#: data/ui/connection-panel.ui:142
msgid "Password:"
msgstr "Passwort:"
-#: data/ui/cover-toolbar.ui:15 data/ui/shortcuts-dialog.ui:101
+#: data/ui/cover-toolbar.ui:15 data/ui/shortcuts-dialog.ui:102
msgid "Show the cover in fullscreen mode"
msgstr "Das Cover im Vollbildmodus anzeigen"
@@ -72,15 +152,15 @@ msgstr "Bibliothek durchsuchen"
msgid "Connection"
msgstr "Verbindung"
-#: data/ui/gtk.menu.ui:40
+#: data/ui/gtk.menu.ui:40 src/window.py:113
msgid "Cover"
msgstr "Cover"
-#: data/ui/gtk.menu.ui:46
+#: data/ui/gtk.menu.ui:46 src/window.py:114
msgid "Playlist"
msgstr "Wiedergabeliste"
-#: data/ui/gtk.menu.ui:52
+#: data/ui/gtk.menu.ui:52 src/window.py:115
msgid "Library"
msgstr "Bibliothek"
@@ -136,7 +216,7 @@ msgstr "nach Titel"
msgid "sort by year"
msgstr "nach Jahr"
-#: data/ui/library-toolbar.ui:169 data/ui/shortcuts-dialog.ui:114
+#: data/ui/library-toolbar.ui:169 data/ui/shortcuts-dialog.ui:115
msgid "Search the library"
msgstr "Die Bibliothek durchsuchen"
@@ -152,116 +232,116 @@ msgstr "Einstellungen und Aktionen"
msgid "remove"
msgstr "entfernen"
-#: data/ui/playlist-toolbar.ui:37 data/ui/shortcuts-dialog.ui:88
+#: data/ui/playlist-toolbar.ui:37 data/ui/shortcuts-dialog.ui:89
msgid "Clear the playlist"
msgstr "Die Wiedergabeliste leeren"
-#: data/ui/server-panel.ui:68
+#: data/ui/server-panel.ui:69
msgid "File:"
msgstr "Datei:"
-#: data/ui/server-panel.ui:81
+#: data/ui/server-panel.ui:82
msgid "Audio:"
msgstr "Audio:"
-#: data/ui/server-panel.ui:94
+#: data/ui/server-panel.ui:95
msgid "Bitrate:"
msgstr "Bitrate:"
-#: data/ui/server-panel.ui:107
+#: data/ui/server-panel.ui:108
msgid "Error:"
msgstr "Fehler:"
-#: data/ui/server-panel.ui:119 data/ui/server-panel.ui:135
-#: data/ui/server-panel.ui:151 data/ui/server-panel.ui:167
+#: data/ui/server-panel.ui:120 data/ui/server-panel.ui:136
+#: data/ui/server-panel.ui:152 data/ui/server-panel.ui:168
msgid "none "
msgstr "nichts "
-#: data/ui/server-panel.ui:208
+#: data/ui/server-panel.ui:221
msgid "Status"
msgstr "Status"
-#: data/ui/server-panel.ui:287
+#: data/ui/server-panel.ui:301
msgid "Albums"
msgstr "Alben"
-#: data/ui/server-panel.ui:299
+#: data/ui/server-panel.ui:313
msgid "Songs"
msgstr "Songs"
-#: data/ui/server-panel.ui:311
+#: data/ui/server-panel.ui:325
msgid "Artists"
msgstr "Künstler"
-#: data/ui/server-panel.ui:335
+#: data/ui/server-panel.ui:349
msgid "Seconds"
msgstr "Sekunden"
-#: data/ui/server-panel.ui:382
+#: data/ui/server-panel.ui:396
msgid "Seconds played"
msgstr "Sekunden gespielt"
-#: data/ui/server-panel.ui:393
+#: data/ui/server-panel.ui:407
msgid "Seconds running"
msgstr "Sekunden laufend"
-#: data/ui/server-panel.ui:430
+#: data/ui/server-panel.ui:465
msgid "Statistics"
msgstr "Statistiken"
-#: data/ui/server-panel.ui:500
+#: data/ui/server-panel.ui:535
msgid "Audio Devices"
msgstr "Audiogeräte"
-#: data/ui/shortcuts-dialog.ui:14
+#: data/ui/shortcuts-dialog.ui:15
msgid "General"
msgstr "Allgemein"
-#: data/ui/shortcuts-dialog.ui:19
+#: data/ui/shortcuts-dialog.ui:20
msgid "Switch to the Connection panel"
msgstr "Zum Verbindungspaneel wechseln"
-#: data/ui/shortcuts-dialog.ui:26
+#: data/ui/shortcuts-dialog.ui:27
msgid "Switch to the Cover panel"
msgstr "Zum Cover-Paneel wechseln"
-#: data/ui/shortcuts-dialog.ui:33
+#: data/ui/shortcuts-dialog.ui:34
msgid "Switch to the Playlist panel"
msgstr "Zum Wiedergabelistenpaneel wechseln"
-#: data/ui/shortcuts-dialog.ui:40
+#: data/ui/shortcuts-dialog.ui:41
msgid "Switch to the Library panel"
msgstr "Zum Bibliothekspaneel wechseln"
-#: data/ui/shortcuts-dialog.ui:47
+#: data/ui/shortcuts-dialog.ui:48
msgid "Show the keyboard shortcuts"
msgstr "Die Tastenkombinationen anzeigen (dieser Dialog)"
-#: data/ui/shortcuts-dialog.ui:54
+#: data/ui/shortcuts-dialog.ui:55
msgid "Open the info dialog"
msgstr "Den Infodialog öffnen"
-#: data/ui/shortcuts-dialog.ui:61
+#: data/ui/shortcuts-dialog.ui:62
msgid "Quit the application"
msgstr "Die Anwendung beenden"
-#: data/ui/shortcuts-dialog.ui:69
+#: data/ui/shortcuts-dialog.ui:70
msgid "Player"
msgstr "Wiedergabeprogramm"
-#: data/ui/shortcuts-dialog.ui:74 data/ui/window.ui:139
+#: data/ui/shortcuts-dialog.ui:75 data/ui/window.ui:139
msgid "Connect or disconnect"
msgstr "Die Verbindung herstellen oder trennen"
-#: data/ui/shortcuts-dialog.ui:81 data/ui/window.ui:161
+#: data/ui/shortcuts-dialog.ui:82 data/ui/window.ui:161
msgid "Switch between play and pause"
msgstr "Zwischen Abspielen und Pause wechseln"
-#: data/ui/shortcuts-dialog.ui:96
+#: data/ui/shortcuts-dialog.ui:97
msgid "Cover Panel"
msgstr "Cover-Paneel"
-#: data/ui/shortcuts-dialog.ui:109
+#: data/ui/shortcuts-dialog.ui:110
msgid "Library Panel"
msgstr "Bibliothekspaneel"
@@ -273,31 +353,32 @@ msgstr "Zu MPD verbinden"
msgid "Adjust the volume"
msgstr "Die Lautstärke anpassen"
-#: mcg/librarypanel.py:421
+#: src/librarypanel.py:419
msgid "Loading albums"
msgstr "Alben werden geladen"
-#: mcg/librarypanel.py:523
+#: src/librarypanel.py:519
msgid "Loading images"
msgstr "Bilder werden geladen"
-#: mcg/utils.py:50 mcg/utils.py:67
+#: src/utils.py:50 src/utils.py:67
msgid "{} feat. {}"
msgstr "{} mit {}"
-#: mcg/utils.py:61
+#: src/utils.py:61
msgid "{}:{} minutes"
msgstr "{}:{} Minuten"
+#: src/window.py:112
+msgid "Server"
+msgstr "Server"
+
#~ msgid "Enter URL or local path"
#~ msgstr "URL oder lokalen Pfad eingeben"
#~ msgid "Image Directory:"
#~ msgstr "Bildordner:"
-#~ msgid "Server"
-#~ msgstr "Server"
-
#~ msgid "{} of {} images loaded"
#~ msgstr "{} von {} Bildern geladen"
diff --git a/locale/en/LC_MESSAGES/mcg.mo b/po/en.mo
similarity index 100%
rename from locale/en/LC_MESSAGES/mcg.mo
rename to po/en.mo
diff --git a/locale/en/LC_MESSAGES/mcg.po b/po/en.po
similarity index 60%
rename from locale/en/LC_MESSAGES/mcg.po
rename to po/en.po
index bd019a5..9d0eba8 100644
--- a/locale/en/LC_MESSAGES/mcg.po
+++ b/po/en.po
@@ -1,7 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: CoverGrid (mcg)\n"
-"POT-Creation-Date: 2020-10-24 14:39+0200\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2022-09-05 15:08+0200\n"
"PO-Revision-Date: 2020-10-24 14:40+0200\n"
"Last-Translator: coderkun \n"
"Language-Team: \n"
@@ -15,6 +16,87 @@ msgstr ""
"X-Poedit-SearchPath-0: mcg\n"
"X-Poedit-SearchPath-1: data/ui\n"
+#: data/xyz.suruatoel.mcg.gschema.xml:11
+msgid "MPD host"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:12
+msgid "MPD host to connect to"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:16
+msgid "MPD port"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:17
+msgid "MPD port to connect to"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:21
+#, fuzzy
+msgid "Connection state"
+msgstr "Connection"
+
+#: data/xyz.suruatoel.mcg.gschema.xml:22
+msgid "State of last connection"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:26
+msgid "Window width"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:27
+msgid "The window width in pixels."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:31
+msgid "Window height"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:32
+msgid "The window height in pixels."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:36
+msgid "Window maximized"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:37
+msgid "Whether or not the window is in maximized state."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:42
+msgid "Last selected panel"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:43
+msgid "The index of the last selected panel."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:48
+msgid "Size of library items"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:49
+msgid "The size of items displayed in the library."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:53
+msgid "Sort criterium for library items"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:54
+msgid "The sort criterium of items displayed in the library."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:58
+msgid "Sort type for library items"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:59
+msgid "The sort type of items displayed in the library."
+msgstr ""
+
#: data/ui/album-headerbar.ui:17
msgid "Title"
msgstr "Title"
@@ -23,27 +105,27 @@ msgstr "Title"
msgid "Artist"
msgstr "Artist"
-#: data/ui/connection-panel.ui:75
+#: data/ui/connection-panel.ui:76
msgid "Enter hostname or IP address"
msgstr "Enter hostname or IP address"
-#: data/ui/connection-panel.ui:88
+#: data/ui/connection-panel.ui:89
msgid "Enter password or leave blank"
msgstr "Enter password or leave blank"
-#: data/ui/connection-panel.ui:117
+#: data/ui/connection-panel.ui:118
msgid "Host:"
msgstr "Host:"
-#: data/ui/connection-panel.ui:129
+#: data/ui/connection-panel.ui:130
msgid "Port:"
msgstr "Port:"
-#: data/ui/connection-panel.ui:141
+#: data/ui/connection-panel.ui:142
msgid "Password:"
msgstr "Password:"
-#: data/ui/cover-toolbar.ui:15 data/ui/shortcuts-dialog.ui:101
+#: data/ui/cover-toolbar.ui:15 data/ui/shortcuts-dialog.ui:102
msgid "Show the cover in fullscreen mode"
msgstr "Show the cover in fullscreen mode"
@@ -71,15 +153,15 @@ msgstr "Search Library"
msgid "Connection"
msgstr "Connection"
-#: data/ui/gtk.menu.ui:40
+#: data/ui/gtk.menu.ui:40 src/window.py:113
msgid "Cover"
msgstr "Cover"
-#: data/ui/gtk.menu.ui:46
+#: data/ui/gtk.menu.ui:46 src/window.py:114
msgid "Playlist"
msgstr "Playlist"
-#: data/ui/gtk.menu.ui:52
+#: data/ui/gtk.menu.ui:52 src/window.py:115
msgid "Library"
msgstr "Library"
@@ -135,7 +217,7 @@ msgstr "by Title"
msgid "sort by year"
msgstr "by Year"
-#: data/ui/library-toolbar.ui:169 data/ui/shortcuts-dialog.ui:114
+#: data/ui/library-toolbar.ui:169 data/ui/shortcuts-dialog.ui:115
msgid "Search the library"
msgstr "Search the library"
@@ -151,116 +233,116 @@ msgstr "Settings and actions"
msgid "remove"
msgstr "remove"
-#: data/ui/playlist-toolbar.ui:37 data/ui/shortcuts-dialog.ui:88
+#: data/ui/playlist-toolbar.ui:37 data/ui/shortcuts-dialog.ui:89
msgid "Clear the playlist"
msgstr "Clear the playlist"
-#: data/ui/server-panel.ui:68
+#: data/ui/server-panel.ui:69
msgid "File:"
msgstr "File:"
-#: data/ui/server-panel.ui:81
+#: data/ui/server-panel.ui:82
msgid "Audio:"
msgstr "Audio:"
-#: data/ui/server-panel.ui:94
+#: data/ui/server-panel.ui:95
msgid "Bitrate:"
msgstr "Bitrate:"
-#: data/ui/server-panel.ui:107
+#: data/ui/server-panel.ui:108
msgid "Error:"
msgstr "Error:"
-#: data/ui/server-panel.ui:119 data/ui/server-panel.ui:135
-#: data/ui/server-panel.ui:151 data/ui/server-panel.ui:167
+#: data/ui/server-panel.ui:120 data/ui/server-panel.ui:136
+#: data/ui/server-panel.ui:152 data/ui/server-panel.ui:168
msgid "none "
msgstr "none "
-#: data/ui/server-panel.ui:208
+#: data/ui/server-panel.ui:221
msgid "Status"
msgstr "Status"
-#: data/ui/server-panel.ui:287
+#: data/ui/server-panel.ui:301
msgid "Albums"
msgstr "Albums"
-#: data/ui/server-panel.ui:299
+#: data/ui/server-panel.ui:313
msgid "Songs"
msgstr "Songs"
-#: data/ui/server-panel.ui:311
+#: data/ui/server-panel.ui:325
msgid "Artists"
msgstr "Artists"
-#: data/ui/server-panel.ui:335
+#: data/ui/server-panel.ui:349
msgid "Seconds"
msgstr "Seconds"
-#: data/ui/server-panel.ui:382
+#: data/ui/server-panel.ui:396
msgid "Seconds played"
msgstr "Seconds"
-#: data/ui/server-panel.ui:393
+#: data/ui/server-panel.ui:407
msgid "Seconds running"
msgstr "Seconds running"
-#: data/ui/server-panel.ui:430
+#: data/ui/server-panel.ui:465
msgid "Statistics"
msgstr "Statistics"
-#: data/ui/server-panel.ui:500
+#: data/ui/server-panel.ui:535
msgid "Audio Devices"
msgstr "Audio Devices"
-#: data/ui/shortcuts-dialog.ui:14
+#: data/ui/shortcuts-dialog.ui:15
msgid "General"
msgstr "General"
-#: data/ui/shortcuts-dialog.ui:19
+#: data/ui/shortcuts-dialog.ui:20
msgid "Switch to the Connection panel"
msgstr "Switch to the Connection panel"
-#: data/ui/shortcuts-dialog.ui:26
+#: data/ui/shortcuts-dialog.ui:27
msgid "Switch to the Cover panel"
msgstr "Switch to the Cover panel"
-#: data/ui/shortcuts-dialog.ui:33
+#: data/ui/shortcuts-dialog.ui:34
msgid "Switch to the Playlist panel"
msgstr "Switch to the Playlist panel"
-#: data/ui/shortcuts-dialog.ui:40
+#: data/ui/shortcuts-dialog.ui:41
msgid "Switch to the Library panel"
msgstr "Switch to the Cover panel"
-#: data/ui/shortcuts-dialog.ui:47
+#: data/ui/shortcuts-dialog.ui:48
msgid "Show the keyboard shortcuts"
msgstr "Show the keyboard shortcuts (this dialog)"
-#: data/ui/shortcuts-dialog.ui:54
+#: data/ui/shortcuts-dialog.ui:55
msgid "Open the info dialog"
msgstr "Open the info dialog"
-#: data/ui/shortcuts-dialog.ui:61
+#: data/ui/shortcuts-dialog.ui:62
msgid "Quit the application"
msgstr "Quit the application"
-#: data/ui/shortcuts-dialog.ui:69
+#: data/ui/shortcuts-dialog.ui:70
msgid "Player"
msgstr "Player"
-#: data/ui/shortcuts-dialog.ui:74 data/ui/window.ui:139
+#: data/ui/shortcuts-dialog.ui:75 data/ui/window.ui:139
msgid "Connect or disconnect"
msgstr "Connect or disconnect"
-#: data/ui/shortcuts-dialog.ui:81 data/ui/window.ui:161
+#: data/ui/shortcuts-dialog.ui:82 data/ui/window.ui:161
msgid "Switch between play and pause"
msgstr "Switch between play and pause"
-#: data/ui/shortcuts-dialog.ui:96
+#: data/ui/shortcuts-dialog.ui:97
msgid "Cover Panel"
msgstr "Cover Panel"
-#: data/ui/shortcuts-dialog.ui:109
+#: data/ui/shortcuts-dialog.ui:110
msgid "Library Panel"
msgstr "Library Panel"
@@ -272,26 +354,25 @@ msgstr "Connect to MPD"
msgid "Adjust the volume"
msgstr "Adjust the volume"
-#: mcg/librarypanel.py:421
+#: src/librarypanel.py:419
msgid "Loading albums"
msgstr "Loading albums"
-#: mcg/librarypanel.py:523
+#: src/librarypanel.py:519
msgid "Loading images"
msgstr "Loading images"
-#: mcg/utils.py:50 mcg/utils.py:67
+#: src/utils.py:50 src/utils.py:67
msgid "{} feat. {}"
msgstr "{} feat. {}"
-#: mcg/utils.py:61
+#: src/utils.py:61
msgid "{}:{} minutes"
msgstr "{}:{} minutes"
-#, fuzzy
-#~| msgid "Connection"
-#~ msgid "Connection state"
-#~ msgstr "Connection"
+#: src/window.py:112
+msgid "Server"
+msgstr "Server"
#~ msgid "Enter URL or local path"
#~ msgstr "Enter URL or local path"
@@ -299,9 +380,6 @@ msgstr "{}:{} minutes"
#~ msgid "Image Directory:"
#~ msgstr "Image Directory:"
-#~ msgid "Server"
-#~ msgstr "Server"
-
#~ msgid "{} of {} images loaded"
#~ msgstr "{} of {} images loaded"
diff --git a/po/mcg.pot b/po/mcg.pot
new file mode 100644
index 0000000..19fd383
--- /dev/null
+++ b/po/mcg.pot
@@ -0,0 +1,373 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the mcg package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: mcg\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2022-09-05 15:08+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: data/xyz.suruatoel.mcg.gschema.xml:11
+msgid "MPD host"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:12
+msgid "MPD host to connect to"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:16
+msgid "MPD port"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:17
+msgid "MPD port to connect to"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:21
+msgid "Connection state"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:22
+msgid "State of last connection"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:26
+msgid "Window width"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:27
+msgid "The window width in pixels."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:31
+msgid "Window height"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:32
+msgid "The window height in pixels."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:36
+msgid "Window maximized"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:37
+msgid "Whether or not the window is in maximized state."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:42
+msgid "Last selected panel"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:43
+msgid "The index of the last selected panel."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:48
+msgid "Size of library items"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:49
+msgid "The size of items displayed in the library."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:53
+msgid "Sort criterium for library items"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:54
+msgid "The sort criterium of items displayed in the library."
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:58
+msgid "Sort type for library items"
+msgstr ""
+
+#: data/xyz.suruatoel.mcg.gschema.xml:59
+msgid "The sort type of items displayed in the library."
+msgstr ""
+
+#: data/ui/album-headerbar.ui:17
+msgid "Title"
+msgstr ""
+
+#: data/ui/album-headerbar.ui:34
+msgid "Artist"
+msgstr ""
+
+#: data/ui/connection-panel.ui:76
+msgid "Enter hostname or IP address"
+msgstr ""
+
+#: data/ui/connection-panel.ui:89
+msgid "Enter password or leave blank"
+msgstr ""
+
+#: data/ui/connection-panel.ui:118
+msgid "Host:"
+msgstr ""
+
+#: data/ui/connection-panel.ui:130
+msgid "Port:"
+msgstr ""
+
+#: data/ui/connection-panel.ui:142
+msgid "Password:"
+msgstr ""
+
+#: data/ui/cover-toolbar.ui:15 data/ui/shortcuts-dialog.ui:102
+msgid "Show the cover in fullscreen mode"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:7
+msgid "Connect"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:12
+msgid "Play"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:17
+msgid "Clear Playlist"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:22
+msgid "Toggle Fullscreen"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:27
+msgid "Search Library"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:34
+msgid "Connection"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:40 src/window.py:113
+msgid "Cover"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:46 src/window.py:114
+msgid "Playlist"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:52 src/window.py:115
+msgid "Library"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:60
+msgid "Keyboard Shortcuts"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:65
+msgid "Info"
+msgstr ""
+
+#: data/ui/gtk.menu.ui:70
+msgid "Quit"
+msgstr ""
+
+#: data/ui/info-dialog.ui:14
+msgid ""
+"CoverGrid is a client for the Music Player Daemon, focusing on albums "
+"instead of single tracks."
+msgstr ""
+
+#: data/ui/library-panel.ui:27
+msgid "search library"
+msgstr ""
+
+#: data/ui/library-panel.ui:166 data/ui/playlist-panel.ui:57
+msgid "cancel"
+msgstr ""
+
+#: data/ui/library-panel.ui:179 data/ui/library-panel.ui:264
+msgid "queue"
+msgstr ""
+
+#: data/ui/library-panel.ui:277 data/ui/playlist-panel.ui:168
+msgid "play"
+msgstr ""
+
+#: data/ui/library-toolbar.ui:76
+msgid "Sort"
+msgstr ""
+
+#: data/ui/library-toolbar.ui:86
+msgid "sort by artist"
+msgstr ""
+
+#: data/ui/library-toolbar.ui:102
+msgid "sort by title"
+msgstr ""
+
+#: data/ui/library-toolbar.ui:118
+msgid "sort by year"
+msgstr ""
+
+#: data/ui/library-toolbar.ui:169 data/ui/shortcuts-dialog.ui:115
+msgid "Search the library"
+msgstr ""
+
+#: data/ui/library-toolbar.ui:192 data/ui/playlist-toolbar.ui:15
+msgid "Select multiple albums"
+msgstr ""
+
+#: data/ui/library-toolbar.ui:214
+msgid "Settings and actions"
+msgstr ""
+
+#: data/ui/playlist-panel.ui:70 data/ui/playlist-panel.ui:155
+msgid "remove"
+msgstr ""
+
+#: data/ui/playlist-toolbar.ui:37 data/ui/shortcuts-dialog.ui:89
+msgid "Clear the playlist"
+msgstr ""
+
+#: data/ui/server-panel.ui:69
+msgid "File:"
+msgstr ""
+
+#: data/ui/server-panel.ui:82
+msgid "Audio:"
+msgstr ""
+
+#: data/ui/server-panel.ui:95
+msgid "Bitrate:"
+msgstr ""
+
+#: data/ui/server-panel.ui:108
+msgid "Error:"
+msgstr ""
+
+#: data/ui/server-panel.ui:120 data/ui/server-panel.ui:136
+#: data/ui/server-panel.ui:152 data/ui/server-panel.ui:168
+msgid "none "
+msgstr ""
+
+#: data/ui/server-panel.ui:221
+msgid "Status"
+msgstr ""
+
+#: data/ui/server-panel.ui:301
+msgid "Albums"
+msgstr ""
+
+#: data/ui/server-panel.ui:313
+msgid "Songs"
+msgstr ""
+
+#: data/ui/server-panel.ui:325
+msgid "Artists"
+msgstr ""
+
+#: data/ui/server-panel.ui:349
+msgid "Seconds"
+msgstr ""
+
+#: data/ui/server-panel.ui:396
+msgid "Seconds played"
+msgstr ""
+
+#: data/ui/server-panel.ui:407
+msgid "Seconds running"
+msgstr ""
+
+#: data/ui/server-panel.ui:465
+msgid "Statistics"
+msgstr ""
+
+#: data/ui/server-panel.ui:535
+msgid "Audio Devices"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:15
+msgid "General"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:20
+msgid "Switch to the Connection panel"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:27
+msgid "Switch to the Cover panel"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:34
+msgid "Switch to the Playlist panel"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:41
+msgid "Switch to the Library panel"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:48
+msgid "Show the keyboard shortcuts"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:55
+msgid "Open the info dialog"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:62
+msgid "Quit the application"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:70
+msgid "Player"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:75 data/ui/window.ui:139
+msgid "Connect or disconnect"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:82 data/ui/window.ui:161
+msgid "Switch between play and pause"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:97
+msgid "Cover Panel"
+msgstr ""
+
+#: data/ui/shortcuts-dialog.ui:110
+msgid "Library Panel"
+msgstr ""
+
+#: data/ui/window.ui:108
+msgid "Connect to MPD"
+msgstr ""
+
+#: data/ui/window.ui:181
+msgid "Adjust the volume"
+msgstr ""
+
+#: src/librarypanel.py:419
+msgid "Loading albums"
+msgstr ""
+
+#: src/librarypanel.py:519
+msgid "Loading images"
+msgstr ""
+
+#: src/utils.py:50 src/utils.py:67
+msgid "{} feat. {}"
+msgstr ""
+
+#: src/utils.py:61
+msgid "{}:{} minutes"
+msgstr ""
+
+#: src/window.py:112
+msgid "Server"
+msgstr ""
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..704ca6e
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+i18n = import('i18n')
+
+i18n.gettext(meson.project_name(), preset: 'glib')
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 4f03440..0000000
--- a/setup.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-
-import os
-import subprocess
-
-from setuptools import setup
-from setuptools.command.build_py import build_py
-from setuptools.dist import Distribution
-
-
-
-
-class MCGDistribution(Distribution):
- global_options = Distribution.global_options + [
- ("no-compile-schemas", None, "Don't compile gsettings schemas")
- ]
-
-
- def __init__(self, *args, **kwargs):
- self.no_compile_schemas = False
- super(self.__class__, self).__init__(*args, **kwargs)
-
-
-
-
-class build_mcg(build_py):
-
-
- def run(self, *args, **kwargs):
- self._build_gresources()
- if not self.distribution.no_compile_schemas:
- self._build_gschemas()
-
- # This will copy the package_data and data_files, so we need to do this
- # *after* we've compiled resources and schemas.
- super(self.__class__, self).run(*args, **kwargs)
-
-
- def _build_gresources(self):
- print("compiling gresources")
- subprocess.run(['glib-compile-resources', 'xyz.suruatoel.mcg.gresource.xml'], cwd='data')
-
-
- def _build_gschemas(self):
- print("compiling gschemas")
- subprocess.run(['glib-compile-schemas', 'data'])
-
-
-
-
-setup(
- distclass = MCGDistribution,
- cmdclass = {
- 'build_py': build_mcg
- },
- name = "mcg",
- version = '3.0.2',
- description = "CoverGrid (mcg) is a client for the Music Player Daemon, focusing on albums instead of single tracks.",
- url = "http://www.suruatoel.xyz/codes/mcg",
- author = "coderkun",
- author_email = "olli@suruatoel.xyz",
- license = "GPL",
- packages = [
- 'mcg',
- 'mcg/data'
- ],
- package_dir = {
- 'mcg': 'mcg',
- 'mcg/data': 'data'
- },
- package_data = {
- 'mcg': [
- 'LICENSE',
- 'README.textile'
- ],
- 'mcg/data': [
- 'xyz.suruatoel.mcg.gresource'
- ]
- },
- extras_require = {
- 'keyring support': ["python-keyring"]
- },
- entry_points = {
- "gui_scripts": [
- "mcg = mcg.mcg:main"
- ]
- },
- data_files = [
- (os.path.join('share', 'applications'), [
- "data/mcg.desktop"
- ]),
- (os.path.join('share', 'icons'), [
- "data/icons/mcg.svg"
- ]),
- (os.path.join('share', 'glib-2.0', 'schemas'), [
- "data/xyz.suruatoel.mcg.gschema.xml",
- "data/gschemas.compiled",
- ]),
- (os.path.join('share', 'locale', 'en', 'LC_MESSAGES'), [
- 'locale/en/LC_MESSAGES/mcg.mo'
- ]),
- (os.path.join('share', 'locale', 'de', 'LC_MESSAGES'), [
- 'locale/de/LC_MESSAGES/mcg.mo'
- ])
- ],
- classifiers = [
- "Development Status :: 3 - Alpha",
- "Environment :: X11 Applications :: GTK"
- "Intended Audience :: End Users/Desktop"
- "License :: OSI Approved :: GNU General Public License (GPL)"
- "Operating System :: OS Independent"
- "Programming Language :: Python :: 3"
- "Topic :: Desktop Environment :: Gnome"
- "Topic :: Multimedia :: Sound/Audio"
- "Topic :: Multimedia :: Sound/Audio :: Players"
- ]
-)
diff --git a/mcg/__init__.py b/src/__init__.py
similarity index 100%
rename from mcg/__init__.py
rename to src/__init__.py
diff --git a/mcg/albumheaderbar.py b/src/albumheaderbar.py
similarity index 100%
rename from mcg/albumheaderbar.py
rename to src/albumheaderbar.py
diff --git a/mcg/application.py b/src/application.py
similarity index 71%
rename from mcg/application.py
rename to src/application.py
index 326c242..c9f18e6 100644
--- a/mcg/application.py
+++ b/src/application.py
@@ -8,8 +8,8 @@ import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gio, Gtk, Gdk, GLib
-from mcg.window import Window
-from mcg.infodialog import InfoDialog
+from .window import Window
+from .infodialog import InfoDialog
@@ -20,32 +20,14 @@ class Application(Gtk.Application):
DOMAIN = 'mcg'
- def _get_option(shortname, longname, description):
- option = GLib.OptionEntry()
- option.short_name = ord(shortname)
- option.long_name = longname
- option.description = description
- return option
-
-
def __init__(self):
- Gtk.Application.__init__(self, application_id=Application.ID, flags=Gio.ApplicationFlags.FLAGS_NONE)
+ super().__init__(application_id=Application.ID, flags=Gio.ApplicationFlags.FLAGS_NONE)
self._window = None
self._info_dialog = None
self._verbosity = logging.WARNING
- self.add_main_option_entries([
- Application._get_option("v", "verbose", "Be verbose: show info messages"),
- Application._get_option("d", "debug", "Enable debugging: show debug messages")
- ])
- self.connect('handle-local-options', self.handle_local_options)
-
-
- def handle_local_options(self, widget, options):
- if options.contains("debug") and options.lookup_value('debug'):
- self._verbosity = logging.DEBUG
- elif options.contains("verbose") and options.lookup_value('verbose'):
- self._verbosity = logging.INFO
- return -1
+ #self.create_action('quit', self.quit, ['q'])
+ #self.create_action('about', self.on_about_action)
+ #self.create_action('preferences', self.on_preferences_action)
def do_startup(self):
diff --git a/mcg/client.py b/src/client.py
similarity index 100%
rename from mcg/client.py
rename to src/client.py
diff --git a/mcg/connectionpanel.py b/src/connectionpanel.py
similarity index 100%
rename from mcg/connectionpanel.py
rename to src/connectionpanel.py
diff --git a/mcg/coverpanel.py b/src/coverpanel.py
similarity index 100%
rename from mcg/coverpanel.py
rename to src/coverpanel.py
diff --git a/mcg/infodialog.py b/src/infodialog.py
similarity index 54%
rename from mcg/infodialog.py
rename to src/infodialog.py
index b4c0bc5..f6421e6 100644
--- a/mcg/infodialog.py
+++ b/src/infodialog.py
@@ -13,12 +13,3 @@ from gi.repository import Gtk, GdkPixbuf
@Gtk.Template(resource_path='/xyz/suruatoel/mcg/ui/info-dialog.ui')
class InfoDialog(Gtk.AboutDialog):
__gtype_name__ = 'McgInfoDialog'
-
-
- def __init__(self):
- super().__init__()
-
- self._logger = logging.getLogger(__name__)
- self.set_logo(
- GdkPixbuf.Pixbuf.new_from_resource("/xyz/suruatoel/mcg/icons/mcg.svg")
- )
diff --git a/mcg/librarypanel.py b/src/librarypanel.py
similarity index 99%
rename from mcg/librarypanel.py
rename to src/librarypanel.py
index b44bf5b..48b5342 100644
--- a/mcg/librarypanel.py
+++ b/src/librarypanel.py
@@ -3,7 +3,7 @@
import gi
gi.require_version('Gtk', '3.0')
-import gettext
+import locale
import logging
import math
import threading
@@ -416,7 +416,7 @@ class LibraryPanel(Gtk.Stack):
def init_albums(self):
- self.progress_bar.set_text(gettext.gettext("Loading albums"))
+ self.progress_bar.set_text(locale.gettext("Loading albums"))
def load_albums(self):
@@ -516,7 +516,7 @@ class LibraryPanel(Gtk.Stack):
i += 1
GObject.idle_add(self.progress_bar.set_fraction, i/n)
- GObject.idle_add(self.progress_bar.set_text, gettext.gettext("Loading images"))
+ GObject.idle_add(self.progress_bar.set_text, locale.gettext("Loading images"))
if self._library_stop.is_set():
self._library_lock.release()
return
diff --git a/src/main.py b/src/main.py
new file mode 100644
index 0000000..d1b5a53
--- /dev/null
+++ b/src/main.py
@@ -0,0 +1,11 @@
+import sys
+import gi
+gi.require_version('Gtk', '3.0')
+
+from .application import Application
+
+
+
+def main(version):
+ app = Application()
+ return app.run(sys.argv)
diff --git a/src/mcg.in b/src/mcg.in
new file mode 100755
index 0000000..5166fe0
--- /dev/null
+++ b/src/mcg.in
@@ -0,0 +1,25 @@
+#!@PYTHON@
+
+import os
+import sys
+import signal
+import locale
+
+VERSION = '@VERSION@'
+pkgdatadir = '@pkgdatadir@'
+localedir = '@localedir@'
+
+sys.path.insert(1, pkgdatadir)
+signal.signal(signal.SIGINT, signal.SIG_DFL)
+locale.bindtextdomain('mcg', localedir)
+locale.textdomain('mcg')
+
+if __name__ == '__main__':
+ import gi
+
+ from gi.repository import Gio
+ resource = Gio.Resource.load(os.path.join(pkgdatadir, 'mcg.gresource'))
+ resource._register()
+
+ from mcg import main
+ sys.exit(main.main(VERSION))
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..2ea68ea
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,38 @@
+pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
+moduledir = join_paths(pkgdatadir, 'mcg')
+
+python = import('python')
+
+conf = configuration_data()
+conf.set('PYTHON', python.find_installation('python3').full_path())
+conf.set('VERSION', meson.project_version())
+conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
+conf.set('pkgdatadir', pkgdatadir)
+
+configure_file(
+ input: 'mcg.in',
+ output: 'mcg',
+ configuration: conf,
+ install: true,
+ install_dir: get_option('bindir')
+)
+
+mcg_sources = [
+ '__init__.py',
+ 'main.py',
+ 'albumheaderbar.py',
+ 'application.py',
+ 'client.py',
+ 'connectionpanel.py',
+ 'coverpanel.py',
+ 'infodialog.py',
+ 'librarypanel.py',
+ 'playlistpanel.py',
+ 'serverpanel.py',
+ 'shortcutsdialog.py',
+ 'utils.py',
+ 'window.py',
+ 'zeroconf.py',
+]
+
+install_data(mcg_sources, install_dir: moduledir)
diff --git a/mcg/playlistpanel.py b/src/playlistpanel.py
similarity index 100%
rename from mcg/playlistpanel.py
rename to src/playlistpanel.py
diff --git a/mcg/serverpanel.py b/src/serverpanel.py
similarity index 100%
rename from mcg/serverpanel.py
rename to src/serverpanel.py
diff --git a/mcg/shortcutsdialog.py b/src/shortcutsdialog.py
similarity index 100%
rename from mcg/shortcutsdialog.py
rename to src/shortcutsdialog.py
diff --git a/mcg/utils.py b/src/utils.py
similarity index 90%
rename from mcg/utils.py
rename to src/utils.py
index 12a3ce4..713c85c 100644
--- a/mcg/utils.py
+++ b/src/utils.py
@@ -4,7 +4,7 @@
import gi
gi.require_version('Gtk', '3.0')
import hashlib
-import gettext
+import locale
import os
import urllib
@@ -47,7 +47,7 @@ class Utils:
def create_artists_label(album):
label = ', '.join(album.get_albumartists())
if album.get_artists():
- label = gettext.gettext("{} feat. {}").format(
+ label = locale.gettext("{} feat. {}").format(
label,
", ".join(album.get_artists())
)
@@ -58,13 +58,13 @@ class Utils:
minutes = album.get_length() // 60
seconds = album.get_length() - minutes * 60
- return gettext.gettext("{}:{} minutes").format(minutes, seconds)
+ return locale.gettext("{}:{} minutes").format(minutes, seconds)
def create_track_title(track):
title = track.get_title()
if track.get_artists():
- title = gettext.gettext("{} feat. {}").format(
+ title = locale.gettext("{} feat. {}").format(
title,
", ".join(track.get_artists())
)
diff --git a/mcg/window.py b/src/window.py
similarity index 98%
rename from mcg/window.py
rename to src/window.py
index cbdcc7a..c0dd46c 100644
--- a/mcg/window.py
+++ b/src/window.py
@@ -8,18 +8,19 @@ try:
use_keyring = True
except:
use_keyring = False
+import locale
import logging
from gi.repository import Gtk, Gdk, GObject, GLib, Gio
-from mcg import client
-from mcg.shortcutsdialog import ShortcutsDialog
-from mcg.connectionpanel import ConnectionPanel
-from mcg.serverpanel import ServerPanel
-from mcg.coverpanel import CoverPanel
-from mcg.playlistpanel import PlaylistPanel
-from mcg.librarypanel import LibraryPanel
-from mcg.zeroconf import ZeroconfProvider
+from . import client
+from .shortcutsdialog import ShortcutsDialog
+from .connectionpanel import ConnectionPanel
+from .serverpanel import ServerPanel
+from .coverpanel import CoverPanel
+from .playlistpanel import PlaylistPanel
+from .librarypanel import LibraryPanel
+from .zeroconf import ZeroconfProvider
@@ -108,10 +109,10 @@ class Window(Gtk.ApplicationWindow):
self._panels.append(self._library_panel)
# Stack
self.content_stack.add(self._connection_panel)
- self.panel_stack.add_titled(self._server_panel, 'server-panel', "Server")
- self.panel_stack.add_titled(self._cover_panel, 'cover-panel', "Cover")
- self.panel_stack.add_titled(self._playlist_panel, 'playlist-panel', "Playlist")
- self.panel_stack.add_titled(self._library_panel, 'library-panel', "Library")
+ self.panel_stack.add_titled(self._server_panel, 'server-panel', locale.gettext("Server"))
+ self.panel_stack.add_titled(self._cover_panel, 'cover-panel', locale.gettext("Cover"))
+ self.panel_stack.add_titled(self._playlist_panel, 'playlist-panel', locale.gettext("Playlist"))
+ self.panel_stack.add_titled(self._library_panel, 'library-panel', locale.gettext("Library"))
# Header
self._playlist_panel.get_headerbar_standalone().connect('close', self.on_panel_close_standalone)
self._library_panel.get_headerbar_standalone().connect('close', self.on_panel_close_standalone)
diff --git a/mcg/zeroconf.py b/src/zeroconf.py
similarity index 100%
rename from mcg/zeroconf.py
rename to src/zeroconf.py