diff --git a/data/ui/info-dialog.ui b/data/ui/info-dialog.ui
deleted file mode 100644
index 99b3524..0000000
--- a/data/ui/info-dialog.ui
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
- False
- False
- True
- center
- dialog
- center
- CoverGrid
- 3.1
- 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/shortcuts-dialog.ui b/data/ui/shortcuts-dialog.ui
index 8109201..279c992 100644
--- a/data/ui/shortcuts-dialog.ui
+++ b/data/ui/shortcuts-dialog.ui
@@ -1,9 +1,10 @@
-
+
+
- True
+ 1
1
@@ -11,53 +12,45 @@
10
- 1
General
- 1
<primary>KP_1
Switch to the Connection panel
- 1
<primary>KP_2
Switch to the Cover panel
- 1
<primary>KP_3
Switch to the Playlist panel
- 1
<primary>KP_4
Switch to the Library panel
- 1
<primary>k
Show the keyboard shortcuts
- 1
<primary>i
Open the info dialog
- 1
<primary>q
Quit the application
@@ -66,25 +59,21 @@
- 1
Player
- 1
<primary>c
Connect or disconnect
- 1
<primary>p
Switch between play and pause
- 1
<primary>r
Clear the playlist
@@ -93,11 +82,9 @@
- 1
Cover Panel
- 1
F11
Show the cover in fullscreen mode
@@ -106,11 +93,9 @@
- 1
Library Panel
- 1
<primary>f
Search the library
diff --git a/data/xyz.suruatoel.mcg.gresource.xml b/data/xyz.suruatoel.mcg.gresource.xml
index 3511840..243d7d3 100644
--- a/data/xyz.suruatoel.mcg.gresource.xml
+++ b/data/xyz.suruatoel.mcg.gresource.xml
@@ -6,9 +6,8 @@
ui/window.ui
+ ui/shortcuts-dialog.ui
ui/connection-panel.ui
ui/album-headerbar.ui
ui/server-panel.ui
diff --git a/src/application.py b/src/application.py
index a7b522e..ecef96b 100644
--- a/src/application.py
+++ b/src/application.py
@@ -26,7 +26,9 @@ class Application(Gtk.Application):
self._window = None
self._info_dialog = None
self._verbosity = logging.WARNING
- #self.create_action('quit', self.quit, ['q'])
+ self.set_accels_for_action('window.close', ['q'])
+ self.set_accels_for_action('win.show-help-overlay', ['k'])
+ self.set_accels_for_action('app.info', ['i'])
#self.create_action('about', self.on_about_action)
#self.create_action('preferences', self.on_preferences_action)
@@ -51,11 +53,15 @@ class Application(Gtk.Application):
def on_menu_info(self, action, value):
# FIXME Info dialog
- #if not self._info_dialog:
- # self._info_dialog = InfoDialog()
- #self._info_dialog.run()
- #self._info_dialog.hide()
- pass
+ if not self._info_dialog:
+ self._info_dialog = Adw.AboutDialog()
+ self._info_dialog.set_application_icon("xyz.suruatoel.mcg")
+ self._info_dialog.set_application_name("CoverGrid")
+ self._info_dialog.set_version("3.1")
+ self._info_dialog.set_comments("CoverGrid is a client for the Music Player Daemon, focusing on albums instead of single tracks.")
+ self._info_dialog.set_website("https://www.suruatoel.xyz/codes/mcg")
+ self._info_dialog.set_license_type(Gtk.License.GPL_3_0)
+ self._info_dialog.present()
def on_menu_quit(self, action, value):
diff --git a/src/infodialog.py b/src/infodialog.py
deleted file mode 100644
index f6421e6..0000000
--- a/src/infodialog.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-
-
-import gi
-gi.require_version('Gtk', '3.0')
-import logging
-
-from gi.repository import Gtk, GdkPixbuf
-
-
-
-
-@Gtk.Template(resource_path='/xyz/suruatoel/mcg/ui/info-dialog.ui')
-class InfoDialog(Gtk.AboutDialog):
- __gtype_name__ = 'McgInfoDialog'
diff --git a/src/librarypanel.py b/src/librarypanel.py
index 70efc8c..5201b5c 100644
--- a/src/librarypanel.py
+++ b/src/librarypanel.py
@@ -232,12 +232,6 @@ class LibraryPanel(Adw.Bin):
self.select_button.set_active(False)
- # FIXME on_standalone_scroll_size_allocate()
- #@Gtk.Template.Callback()
- def on_standalone_scroll_size_allocate(self, widget, allocation):
- self._resize_standalone_image()
-
-
@Gtk.Template.Callback()
def on_standalone_play_clicked(self, widget):
self.emit('play', self._selected_albums[0].get_id())
diff --git a/src/shortcutsdialog.py b/src/shortcutsdialog.py
index f73864e..6bf16e5 100644
--- a/src/shortcutsdialog.py
+++ b/src/shortcutsdialog.py
@@ -2,8 +2,8 @@
import gi
-gi.require_version('Gtk', '3.0')
-
+gi.require_version('Gtk', '4.0')
+gi.require_version('Adw', '1')
from gi.repository import Gtk
diff --git a/src/window.py b/src/window.py
index 430bcb7..ae2a2e8 100644
--- a/src/window.py
+++ b/src/window.py
@@ -9,13 +9,14 @@ try:
use_keyring = True
except:
use_keyring = False
+use_keyring = False
import locale
import logging
from gi.repository import Gtk, Adw, Gdk, GObject, GLib, Gio
from . import client
-#from .shortcutsdialog import ShortcutsDialog
+from .shortcutsdialog import ShortcutsDialog
from .connectionpanel import ConnectionPanel
from .serverpanel import ServerPanel
from .coverpanel import CoverPanel
@@ -87,8 +88,8 @@ class Window(Adw.ApplicationWindow):
self._headerbar_connection_button_active = True
self._headerbar_playpause_button_active = True
- # FIXME Help/Shortcuts dialog
- #self.set_help_overlay(ShortcutsDialog())
+ # Help/Shortcuts dialog
+ self.set_help_overlay(ShortcutsDialog())
# Login screen
self._connection_panel = ConnectionPanel()