Use the build system “meson” (close #32)

Replace the build system “setuptools” with “meson”.
This commit is contained in:
coderkun 2022-06-05 18:13:22 +02:00
commit fac7a85566
37 changed files with 848 additions and 361 deletions

6
.gitignore vendored
View file

@ -3,7 +3,5 @@ __pycache__/
*.py[cod] *.py[cod]
*$py.class *$py.class
# Files created by setuptools /build/
build/ /install/
dist/
*.egg-info/

View file

@ -12,62 +12,42 @@ Dependencies:
* "GTK":http://www.gtk.org 3 (>= 3.22) ("python-gobject":https://live.gnome.org/PyGObject) * "GTK":http://www.gtk.org 3 (>= 3.22) ("python-gobject":https://live.gnome.org/PyGObject)
* "Avahi":http://www.avahi.org (optional) * "Avahi":http://www.avahi.org (optional)
* "python-keyring":http://pypi.python.org/pypi/keyring (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. Additionally a "MPD":http://www.musicpd.org server (version >= 0.21.0) is required at runtime.
h2. Building 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 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 _mesons_ @devenv@ command:
bc. $ ~/.local/bin/mcg bc. $ meson devenv -C build src/mcg
or if _~/.local/bin/_ is on your PATH
bc. $ mcg
h2. Installing 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 distributions package manager is the preferred way of installing applications system-wide._ Note: _On Linux using the distributions 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.
h2. Screenshots h2. Screenshots

View file

Before

Width:  |  Height:  |  Size: 7 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Before After
Before After

7
data/icons/meson.build Normal file
View file

@ -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)
)

View file

@ -4,7 +4,7 @@ Name=CoverGrid (mcg)
Comment=CoverGrid for the Music Player Daemon Comment=CoverGrid for the Music Player Daemon
Keywords=mpd; Keywords=mpd;
Type=Application Type=Application
Icon=mcg.svg Icon=xyz.suruatoel.mcg
Exec=mcg Exec=mcg
Categories=AudioVideo; Categories=AudioVideo;
StartupNotify=true StartupNotify=true

34
data/meson.build Normal file
View file

@ -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')

View file

@ -13,7 +13,7 @@
<property name="version">3.0.2</property> <property name="version">3.0.2</property>
<property name="comments" translatable="yes">CoverGrid is a client for the Music Player Daemon, focusing on albums instead of single tracks.</property> <property name="comments" translatable="yes">CoverGrid is a client for the Music Player Daemon, focusing on albums instead of single tracks.</property>
<property name="website">http://www.suruatoel.xyz/codes/mcg</property> <property name="website">http://www.suruatoel.xyz/codes/mcg</property>
<property name="logo-icon-name"/> <property name="logo-icon-name">xyz.suruatoel.mcg</property>
<property name="license-type">gpl-3-0</property> <property name="license-type">gpl-3-0</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox"> <object class="GtkBox">

View file

@ -4,7 +4,7 @@
<requires lib="gtk+" version="3.20"/> <requires lib="gtk+" version="3.20"/>
<template class="McgAppWindow" parent="GtkApplicationWindow"> <template class="McgAppWindow" parent="GtkApplicationWindow">
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="icon-name">mcg</property> <property name="icon-name">xyz.suruatoel.mcg</property>
<signal name="size-allocate" handler="on_resize" swapped="no"/> <signal name="size-allocate" handler="on_resize" swapped="no"/>
<signal name="window-state-event" handler="on_state" swapped="no"/> <signal name="window-state-event" handler="on_state" swapped="no"/>
<child> <child>

View file

@ -3,7 +3,6 @@
<gresource prefix="/xyz/suruatoel/mcg"> <gresource prefix="/xyz/suruatoel/mcg">
<file>gtk.css</file> <file>gtk.css</file>
<file>noise-texture.png</file> <file>noise-texture.png</file>
<file>icons/mcg.svg</file>
<file>ui/window.ui</file> <file>ui/window.ui</file>
<file>ui/gtk.menu.ui</file> <file>ui/gtk.menu.ui</file>
<file>ui/info-dialog.ui</file> <file>ui/info-dialog.ui</file>

View file

@ -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())

19
meson.build Normal file
View file

@ -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,
)

1
po/LINGUAS Normal file
View file

@ -0,0 +1 @@
en de

29
po/POTFILES Normal file
View file

@ -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

View file

@ -1,11 +1,12 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: CoverGrid (mcg)\n" "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" "PO-Revision-Date: 2020-10-24 14:41+0200\n"
"Last-Translator: coderkun <olli@suruatoel.xyz>\n" "Last-Translator: coderkun <olli@suruatoel.xyz>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: de\n" "Language: de_DE\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
@ -13,8 +14,87 @@ msgstr ""
"X-Poedit-Basepath: ../../..\n" "X-Poedit-Basepath: ../../..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\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 #: data/ui/album-headerbar.ui:17
msgid "Title" msgid "Title"
@ -24,27 +104,27 @@ msgstr "Titel"
msgid "Artist" msgid "Artist"
msgstr "Künstler" msgstr "Künstler"
#: data/ui/connection-panel.ui:75 #: data/ui/connection-panel.ui:76
msgid "Enter hostname or IP address" msgid "Enter hostname or IP address"
msgstr "Hostnamen oder IP-Adresse eingeben" msgstr "Hostnamen oder IP-Adresse eingeben"
#: data/ui/connection-panel.ui:88 #: data/ui/connection-panel.ui:89
msgid "Enter password or leave blank" msgid "Enter password or leave blank"
msgstr "Passwort eingeben oder leer lassen" msgstr "Passwort eingeben oder leer lassen"
#: data/ui/connection-panel.ui:117 #: data/ui/connection-panel.ui:118
msgid "Host:" msgid "Host:"
msgstr "Host:" msgstr "Host:"
#: data/ui/connection-panel.ui:129 #: data/ui/connection-panel.ui:130
msgid "Port:" msgid "Port:"
msgstr "Port:" msgstr "Port:"
#: data/ui/connection-panel.ui:141 #: data/ui/connection-panel.ui:142
msgid "Password:" msgid "Password:"
msgstr "Passwort:" 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" msgid "Show the cover in fullscreen mode"
msgstr "Das Cover im Vollbildmodus anzeigen" msgstr "Das Cover im Vollbildmodus anzeigen"
@ -72,15 +152,15 @@ msgstr "Bibliothek durchsuchen"
msgid "Connection" msgid "Connection"
msgstr "Verbindung" msgstr "Verbindung"
#: data/ui/gtk.menu.ui:40 #: data/ui/gtk.menu.ui:40 src/window.py:113
msgid "Cover" msgid "Cover"
msgstr "Cover" msgstr "Cover"
#: data/ui/gtk.menu.ui:46 #: data/ui/gtk.menu.ui:46 src/window.py:114
msgid "Playlist" msgid "Playlist"
msgstr "Wiedergabeliste" msgstr "Wiedergabeliste"
#: data/ui/gtk.menu.ui:52 #: data/ui/gtk.menu.ui:52 src/window.py:115
msgid "Library" msgid "Library"
msgstr "Bibliothek" msgstr "Bibliothek"
@ -136,7 +216,7 @@ msgstr "nach Titel"
msgid "sort by year" msgid "sort by year"
msgstr "nach Jahr" 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" msgid "Search the library"
msgstr "Die Bibliothek durchsuchen" msgstr "Die Bibliothek durchsuchen"
@ -152,116 +232,116 @@ msgstr "Einstellungen und Aktionen"
msgid "remove" msgid "remove"
msgstr "entfernen" 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" msgid "Clear the playlist"
msgstr "Die Wiedergabeliste leeren" msgstr "Die Wiedergabeliste leeren"
#: data/ui/server-panel.ui:68 #: data/ui/server-panel.ui:69
msgid "File:" msgid "File:"
msgstr "Datei:" msgstr "Datei:"
#: data/ui/server-panel.ui:81 #: data/ui/server-panel.ui:82
msgid "Audio:" msgid "Audio:"
msgstr "Audio:" msgstr "Audio:"
#: data/ui/server-panel.ui:94 #: data/ui/server-panel.ui:95
msgid "Bitrate:" msgid "Bitrate:"
msgstr "Bitrate:" msgstr "Bitrate:"
#: data/ui/server-panel.ui:107 #: data/ui/server-panel.ui:108
msgid "Error:" msgid "Error:"
msgstr "Fehler:" msgstr "Fehler:"
#: data/ui/server-panel.ui:119 data/ui/server-panel.ui:135 #: data/ui/server-panel.ui:120 data/ui/server-panel.ui:136
#: data/ui/server-panel.ui:151 data/ui/server-panel.ui:167 #: data/ui/server-panel.ui:152 data/ui/server-panel.ui:168
msgid "<i>none</i>" msgid "<i>none</i>"
msgstr "<i>nichts</i>" msgstr "<i>nichts</i>"
#: data/ui/server-panel.ui:208 #: data/ui/server-panel.ui:221
msgid "Status" msgid "Status"
msgstr "Status" msgstr "Status"
#: data/ui/server-panel.ui:287 #: data/ui/server-panel.ui:301
msgid "Albums" msgid "Albums"
msgstr "Alben" msgstr "Alben"
#: data/ui/server-panel.ui:299 #: data/ui/server-panel.ui:313
msgid "Songs" msgid "Songs"
msgstr "Songs" msgstr "Songs"
#: data/ui/server-panel.ui:311 #: data/ui/server-panel.ui:325
msgid "Artists" msgid "Artists"
msgstr "Künstler" msgstr "Künstler"
#: data/ui/server-panel.ui:335 #: data/ui/server-panel.ui:349
msgid "Seconds" msgid "Seconds"
msgstr "Sekunden" msgstr "Sekunden"
#: data/ui/server-panel.ui:382 #: data/ui/server-panel.ui:396
msgid "Seconds played" msgid "Seconds played"
msgstr "Sekunden gespielt" msgstr "Sekunden gespielt"
#: data/ui/server-panel.ui:393 #: data/ui/server-panel.ui:407
msgid "Seconds running" msgid "Seconds running"
msgstr "Sekunden laufend" msgstr "Sekunden laufend"
#: data/ui/server-panel.ui:430 #: data/ui/server-panel.ui:465
msgid "Statistics" msgid "Statistics"
msgstr "Statistiken" msgstr "Statistiken"
#: data/ui/server-panel.ui:500 #: data/ui/server-panel.ui:535
msgid "Audio Devices" msgid "Audio Devices"
msgstr "Audiogeräte" msgstr "Audiogeräte"
#: data/ui/shortcuts-dialog.ui:14 #: data/ui/shortcuts-dialog.ui:15
msgid "General" msgid "General"
msgstr "Allgemein" msgstr "Allgemein"
#: data/ui/shortcuts-dialog.ui:19 #: data/ui/shortcuts-dialog.ui:20
msgid "Switch to the Connection panel" msgid "Switch to the Connection panel"
msgstr "Zum Verbindungspaneel wechseln" msgstr "Zum Verbindungspaneel wechseln"
#: data/ui/shortcuts-dialog.ui:26 #: data/ui/shortcuts-dialog.ui:27
msgid "Switch to the Cover panel" msgid "Switch to the Cover panel"
msgstr "Zum Cover-Paneel wechseln" msgstr "Zum Cover-Paneel wechseln"
#: data/ui/shortcuts-dialog.ui:33 #: data/ui/shortcuts-dialog.ui:34
msgid "Switch to the Playlist panel" msgid "Switch to the Playlist panel"
msgstr "Zum Wiedergabelistenpaneel wechseln" msgstr "Zum Wiedergabelistenpaneel wechseln"
#: data/ui/shortcuts-dialog.ui:40 #: data/ui/shortcuts-dialog.ui:41
msgid "Switch to the Library panel" msgid "Switch to the Library panel"
msgstr "Zum Bibliothekspaneel wechseln" msgstr "Zum Bibliothekspaneel wechseln"
#: data/ui/shortcuts-dialog.ui:47 #: data/ui/shortcuts-dialog.ui:48
msgid "Show the keyboard shortcuts" msgid "Show the keyboard shortcuts"
msgstr "Die Tastenkombinationen anzeigen (dieser Dialog)" msgstr "Die Tastenkombinationen anzeigen (dieser Dialog)"
#: data/ui/shortcuts-dialog.ui:54 #: data/ui/shortcuts-dialog.ui:55
msgid "Open the info dialog" msgid "Open the info dialog"
msgstr "Den Infodialog öffnen" msgstr "Den Infodialog öffnen"
#: data/ui/shortcuts-dialog.ui:61 #: data/ui/shortcuts-dialog.ui:62
msgid "Quit the application" msgid "Quit the application"
msgstr "Die Anwendung beenden" msgstr "Die Anwendung beenden"
#: data/ui/shortcuts-dialog.ui:69 #: data/ui/shortcuts-dialog.ui:70
msgid "Player" msgid "Player"
msgstr "Wiedergabeprogramm" 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" msgid "Connect or disconnect"
msgstr "Die Verbindung herstellen oder trennen" 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" msgid "Switch between play and pause"
msgstr "Zwischen Abspielen und Pause wechseln" msgstr "Zwischen Abspielen und Pause wechseln"
#: data/ui/shortcuts-dialog.ui:96 #: data/ui/shortcuts-dialog.ui:97
msgid "Cover Panel" msgid "Cover Panel"
msgstr "Cover-Paneel" msgstr "Cover-Paneel"
#: data/ui/shortcuts-dialog.ui:109 #: data/ui/shortcuts-dialog.ui:110
msgid "Library Panel" msgid "Library Panel"
msgstr "Bibliothekspaneel" msgstr "Bibliothekspaneel"
@ -273,31 +353,32 @@ msgstr "Zu MPD verbinden"
msgid "Adjust the volume" msgid "Adjust the volume"
msgstr "Die Lautstärke anpassen" msgstr "Die Lautstärke anpassen"
#: mcg/librarypanel.py:421 #: src/librarypanel.py:419
msgid "Loading albums" msgid "Loading albums"
msgstr "Alben werden geladen" msgstr "Alben werden geladen"
#: mcg/librarypanel.py:523 #: src/librarypanel.py:519
msgid "Loading images" msgid "Loading images"
msgstr "Bilder werden geladen" msgstr "Bilder werden geladen"
#: mcg/utils.py:50 mcg/utils.py:67 #: src/utils.py:50 src/utils.py:67
msgid "{} feat. {}" msgid "{} feat. {}"
msgstr "{} mit {}" msgstr "{} mit {}"
#: mcg/utils.py:61 #: src/utils.py:61
msgid "{}:{} minutes" msgid "{}:{} minutes"
msgstr "{}:{} Minuten" msgstr "{}:{} Minuten"
#: src/window.py:112
msgid "Server"
msgstr "Server"
#~ msgid "Enter URL or local path" #~ msgid "Enter URL or local path"
#~ msgstr "URL oder lokalen Pfad eingeben" #~ msgstr "URL oder lokalen Pfad eingeben"
#~ msgid "Image Directory:" #~ msgid "Image Directory:"
#~ msgstr "Bildordner:" #~ msgstr "Bildordner:"
#~ msgid "Server"
#~ msgstr "Server"
#~ msgid "{} of {} images loaded" #~ msgid "{} of {} images loaded"
#~ msgstr "{} von {} Bildern geladen" #~ msgstr "{} von {} Bildern geladen"

View file

@ -1,7 +1,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: CoverGrid (mcg)\n" "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" "PO-Revision-Date: 2020-10-24 14:40+0200\n"
"Last-Translator: coderkun <olli@suruatoel.xyz>\n" "Last-Translator: coderkun <olli@suruatoel.xyz>\n"
"Language-Team: \n" "Language-Team: \n"
@ -15,6 +16,87 @@ msgstr ""
"X-Poedit-SearchPath-0: mcg\n" "X-Poedit-SearchPath-0: mcg\n"
"X-Poedit-SearchPath-1: data/ui\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 #: data/ui/album-headerbar.ui:17
msgid "Title" msgid "Title"
msgstr "Title" msgstr "Title"
@ -23,27 +105,27 @@ msgstr "Title"
msgid "Artist" msgid "Artist"
msgstr "Artist" msgstr "Artist"
#: data/ui/connection-panel.ui:75 #: data/ui/connection-panel.ui:76
msgid "Enter hostname or IP address" msgid "Enter hostname or IP address"
msgstr "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" msgid "Enter password or leave blank"
msgstr "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:" msgid "Host:"
msgstr "Host:" msgstr "Host:"
#: data/ui/connection-panel.ui:129 #: data/ui/connection-panel.ui:130
msgid "Port:" msgid "Port:"
msgstr "Port:" msgstr "Port:"
#: data/ui/connection-panel.ui:141 #: data/ui/connection-panel.ui:142
msgid "Password:" msgid "Password:"
msgstr "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" msgid "Show the cover in fullscreen mode"
msgstr "Show the cover in fullscreen mode" msgstr "Show the cover in fullscreen mode"
@ -71,15 +153,15 @@ msgstr "Search Library"
msgid "Connection" msgid "Connection"
msgstr "Connection" msgstr "Connection"
#: data/ui/gtk.menu.ui:40 #: data/ui/gtk.menu.ui:40 src/window.py:113
msgid "Cover" msgid "Cover"
msgstr "Cover" msgstr "Cover"
#: data/ui/gtk.menu.ui:46 #: data/ui/gtk.menu.ui:46 src/window.py:114
msgid "Playlist" msgid "Playlist"
msgstr "Playlist" msgstr "Playlist"
#: data/ui/gtk.menu.ui:52 #: data/ui/gtk.menu.ui:52 src/window.py:115
msgid "Library" msgid "Library"
msgstr "Library" msgstr "Library"
@ -135,7 +217,7 @@ msgstr "by Title"
msgid "sort by year" msgid "sort by year"
msgstr "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" msgid "Search the library"
msgstr "Search the library" msgstr "Search the library"
@ -151,116 +233,116 @@ msgstr "Settings and actions"
msgid "remove" msgid "remove"
msgstr "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" msgid "Clear the playlist"
msgstr "Clear the playlist" msgstr "Clear the playlist"
#: data/ui/server-panel.ui:68 #: data/ui/server-panel.ui:69
msgid "File:" msgid "File:"
msgstr "File:" msgstr "File:"
#: data/ui/server-panel.ui:81 #: data/ui/server-panel.ui:82
msgid "Audio:" msgid "Audio:"
msgstr "Audio:" msgstr "Audio:"
#: data/ui/server-panel.ui:94 #: data/ui/server-panel.ui:95
msgid "Bitrate:" msgid "Bitrate:"
msgstr "Bitrate:" msgstr "Bitrate:"
#: data/ui/server-panel.ui:107 #: data/ui/server-panel.ui:108
msgid "Error:" msgid "Error:"
msgstr "Error:" msgstr "Error:"
#: data/ui/server-panel.ui:119 data/ui/server-panel.ui:135 #: data/ui/server-panel.ui:120 data/ui/server-panel.ui:136
#: data/ui/server-panel.ui:151 data/ui/server-panel.ui:167 #: data/ui/server-panel.ui:152 data/ui/server-panel.ui:168
msgid "<i>none</i>" msgid "<i>none</i>"
msgstr "<i>none</i>" msgstr "<i>none</i>"
#: data/ui/server-panel.ui:208 #: data/ui/server-panel.ui:221
msgid "Status" msgid "Status"
msgstr "Status" msgstr "Status"
#: data/ui/server-panel.ui:287 #: data/ui/server-panel.ui:301
msgid "Albums" msgid "Albums"
msgstr "Albums" msgstr "Albums"
#: data/ui/server-panel.ui:299 #: data/ui/server-panel.ui:313
msgid "Songs" msgid "Songs"
msgstr "Songs" msgstr "Songs"
#: data/ui/server-panel.ui:311 #: data/ui/server-panel.ui:325
msgid "Artists" msgid "Artists"
msgstr "Artists" msgstr "Artists"
#: data/ui/server-panel.ui:335 #: data/ui/server-panel.ui:349
msgid "Seconds" msgid "Seconds"
msgstr "Seconds" msgstr "Seconds"
#: data/ui/server-panel.ui:382 #: data/ui/server-panel.ui:396
msgid "Seconds played" msgid "Seconds played"
msgstr "Seconds" msgstr "Seconds"
#: data/ui/server-panel.ui:393 #: data/ui/server-panel.ui:407
msgid "Seconds running" msgid "Seconds running"
msgstr "Seconds running" msgstr "Seconds running"
#: data/ui/server-panel.ui:430 #: data/ui/server-panel.ui:465
msgid "Statistics" msgid "Statistics"
msgstr "Statistics" msgstr "Statistics"
#: data/ui/server-panel.ui:500 #: data/ui/server-panel.ui:535
msgid "Audio Devices" msgid "Audio Devices"
msgstr "Audio Devices" msgstr "Audio Devices"
#: data/ui/shortcuts-dialog.ui:14 #: data/ui/shortcuts-dialog.ui:15
msgid "General" msgid "General"
msgstr "General" msgstr "General"
#: data/ui/shortcuts-dialog.ui:19 #: data/ui/shortcuts-dialog.ui:20
msgid "Switch to the Connection panel" msgid "Switch to the Connection panel"
msgstr "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" msgid "Switch to the Cover panel"
msgstr "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" msgid "Switch to the Playlist panel"
msgstr "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" msgid "Switch to the Library panel"
msgstr "Switch to the Cover panel" msgstr "Switch to the Cover panel"
#: data/ui/shortcuts-dialog.ui:47 #: data/ui/shortcuts-dialog.ui:48
msgid "Show the keyboard shortcuts" msgid "Show the keyboard shortcuts"
msgstr "Show the keyboard shortcuts (this dialog)" msgstr "Show the keyboard shortcuts (this dialog)"
#: data/ui/shortcuts-dialog.ui:54 #: data/ui/shortcuts-dialog.ui:55
msgid "Open the info dialog" msgid "Open the info dialog"
msgstr "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" msgid "Quit the application"
msgstr "Quit the application" msgstr "Quit the application"
#: data/ui/shortcuts-dialog.ui:69 #: data/ui/shortcuts-dialog.ui:70
msgid "Player" msgid "Player"
msgstr "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" msgid "Connect or disconnect"
msgstr "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" msgid "Switch between play and pause"
msgstr "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" msgid "Cover Panel"
msgstr "Cover Panel" msgstr "Cover Panel"
#: data/ui/shortcuts-dialog.ui:109 #: data/ui/shortcuts-dialog.ui:110
msgid "Library Panel" msgid "Library Panel"
msgstr "Library Panel" msgstr "Library Panel"
@ -272,26 +354,25 @@ msgstr "Connect to MPD"
msgid "Adjust the volume" msgid "Adjust the volume"
msgstr "Adjust the volume" msgstr "Adjust the volume"
#: mcg/librarypanel.py:421 #: src/librarypanel.py:419
msgid "Loading albums" msgid "Loading albums"
msgstr "Loading albums" msgstr "Loading albums"
#: mcg/librarypanel.py:523 #: src/librarypanel.py:519
msgid "Loading images" msgid "Loading images"
msgstr "Loading images" msgstr "Loading images"
#: mcg/utils.py:50 mcg/utils.py:67 #: src/utils.py:50 src/utils.py:67
msgid "{} feat. {}" msgid "{} feat. {}"
msgstr "{} feat. {}" msgstr "{} feat. {}"
#: mcg/utils.py:61 #: src/utils.py:61
msgid "{}:{} minutes" msgid "{}:{} minutes"
msgstr "{}:{} minutes" msgstr "{}:{} minutes"
#, fuzzy #: src/window.py:112
#~| msgid "Connection" msgid "Server"
#~ msgid "Connection state" msgstr "Server"
#~ msgstr "Connection"
#~ msgid "Enter URL or local path" #~ msgid "Enter URL or local path"
#~ msgstr "Enter URL or local path" #~ msgstr "Enter URL or local path"
@ -299,9 +380,6 @@ msgstr "{}:{} minutes"
#~ msgid "Image Directory:" #~ msgid "Image Directory:"
#~ msgstr "Image Directory:" #~ msgstr "Image Directory:"
#~ msgid "Server"
#~ msgstr "Server"
#~ msgid "{} of {} images loaded" #~ msgid "{} of {} images loaded"
#~ msgstr "{} of {} images loaded" #~ msgstr "{} of {} images loaded"

373
po/mcg.pot Normal file
View file

@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 "<i>none</i>"
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 ""

3
po/meson.build Normal file
View file

@ -0,0 +1,3 @@
i18n = import('i18n')
i18n.gettext(meson.project_name(), preset: 'glib')

119
setup.py
View file

@ -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"
]
)

View file

@ -8,8 +8,8 @@ import gi
gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0')
from gi.repository import Gio, Gtk, Gdk, GLib from gi.repository import Gio, Gtk, Gdk, GLib
from mcg.window import Window from .window import Window
from mcg.infodialog import InfoDialog from .infodialog import InfoDialog
@ -20,32 +20,14 @@ class Application(Gtk.Application):
DOMAIN = 'mcg' 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): 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._window = None
self._info_dialog = None self._info_dialog = None
self._verbosity = logging.WARNING self._verbosity = logging.WARNING
self.add_main_option_entries([ #self.create_action('quit', self.quit, ['<primary>q'])
Application._get_option("v", "verbose", "Be verbose: show info messages"), #self.create_action('about', self.on_about_action)
Application._get_option("d", "debug", "Enable debugging: show debug messages") #self.create_action('preferences', self.on_preferences_action)
])
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
def do_startup(self): def do_startup(self):

View file

@ -13,12 +13,3 @@ from gi.repository import Gtk, GdkPixbuf
@Gtk.Template(resource_path='/xyz/suruatoel/mcg/ui/info-dialog.ui') @Gtk.Template(resource_path='/xyz/suruatoel/mcg/ui/info-dialog.ui')
class InfoDialog(Gtk.AboutDialog): class InfoDialog(Gtk.AboutDialog):
__gtype_name__ = 'McgInfoDialog' __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")
)

View file

@ -3,7 +3,7 @@
import gi import gi
gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0')
import gettext import locale
import logging import logging
import math import math
import threading import threading
@ -416,7 +416,7 @@ class LibraryPanel(Gtk.Stack):
def init_albums(self): 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): def load_albums(self):
@ -516,7 +516,7 @@ class LibraryPanel(Gtk.Stack):
i += 1 i += 1
GObject.idle_add(self.progress_bar.set_fraction, i/n) 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(): if self._library_stop.is_set():
self._library_lock.release() self._library_lock.release()
return return

11
src/main.py Normal file
View file

@ -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)

25
src/mcg.in Executable file
View file

@ -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))

38
src/meson.build Normal file
View file

@ -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)

View file

@ -4,7 +4,7 @@
import gi import gi
gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0')
import hashlib import hashlib
import gettext import locale
import os import os
import urllib import urllib
@ -47,7 +47,7 @@ class Utils:
def create_artists_label(album): def create_artists_label(album):
label = ', '.join(album.get_albumartists()) label = ', '.join(album.get_albumartists())
if album.get_artists(): if album.get_artists():
label = gettext.gettext("{} feat. {}").format( label = locale.gettext("{} feat. {}").format(
label, label,
", ".join(album.get_artists()) ", ".join(album.get_artists())
) )
@ -58,13 +58,13 @@ class Utils:
minutes = album.get_length() // 60 minutes = album.get_length() // 60
seconds = album.get_length() - minutes * 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): def create_track_title(track):
title = track.get_title() title = track.get_title()
if track.get_artists(): if track.get_artists():
title = gettext.gettext("{} feat. {}").format( title = locale.gettext("{} feat. {}").format(
title, title,
", ".join(track.get_artists()) ", ".join(track.get_artists())
) )

View file

@ -8,18 +8,19 @@ try:
use_keyring = True use_keyring = True
except: except:
use_keyring = False use_keyring = False
import locale
import logging import logging
from gi.repository import Gtk, Gdk, GObject, GLib, Gio from gi.repository import Gtk, Gdk, GObject, GLib, Gio
from mcg import client from . import client
from mcg.shortcutsdialog import ShortcutsDialog from .shortcutsdialog import ShortcutsDialog
from mcg.connectionpanel import ConnectionPanel from .connectionpanel import ConnectionPanel
from mcg.serverpanel import ServerPanel from .serverpanel import ServerPanel
from mcg.coverpanel import CoverPanel from .coverpanel import CoverPanel
from mcg.playlistpanel import PlaylistPanel from .playlistpanel import PlaylistPanel
from mcg.librarypanel import LibraryPanel from .librarypanel import LibraryPanel
from mcg.zeroconf import ZeroconfProvider from .zeroconf import ZeroconfProvider
@ -108,10 +109,10 @@ class Window(Gtk.ApplicationWindow):
self._panels.append(self._library_panel) self._panels.append(self._library_panel)
# Stack # Stack
self.content_stack.add(self._connection_panel) self.content_stack.add(self._connection_panel)
self.panel_stack.add_titled(self._server_panel, 'server-panel', "Server") self.panel_stack.add_titled(self._server_panel, 'server-panel', locale.gettext("Server"))
self.panel_stack.add_titled(self._cover_panel, 'cover-panel', "Cover") self.panel_stack.add_titled(self._cover_panel, 'cover-panel', locale.gettext("Cover"))
self.panel_stack.add_titled(self._playlist_panel, 'playlist-panel', "Playlist") self.panel_stack.add_titled(self._playlist_panel, 'playlist-panel', locale.gettext("Playlist"))
self.panel_stack.add_titled(self._library_panel, 'library-panel', "Library") self.panel_stack.add_titled(self._library_panel, 'library-panel', locale.gettext("Library"))
# Header # Header
self._playlist_panel.get_headerbar_standalone().connect('close', self.on_panel_close_standalone) 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) self._library_panel.get_headerbar_standalone().connect('close', self.on_panel_close_standalone)