Merge branch “issue-41-progress-bars” (close #41)

This commit is contained in:
coderkun 2017-12-26 10:19:46 +01:00
commit 17990118c7
6 changed files with 160 additions and 61 deletions

View file

@ -1399,49 +1399,125 @@
</packing>
</child>
<child>
<object class="GtkRevealer" id="library-progress-revealer">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition_type">none</property>
<child>
<object class="GtkProgressBar" id="library-progress">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="fraction">0.5</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
<placeholder/>
</child>
<child>
<object class="GtkScrolledWindow" id="library-scroll">
<object class="GtkStack" id="library-stack">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_focus">False</property>
<property name="transition_type">crossfade</property>
<child>
<object class="GtkIconView" id="library-iconview">
<object class="GtkBox" id="library-progress-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<child type="center">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<child type="center">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
<object class="GtkImage" id="library-progress-image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="library-progress-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">{} of {} images loaded</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkProgressBar" id="library-progress">
<property name="width_request">200</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="fraction">0.5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title">page1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="library-scroll">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin">0</property>
<property name="item_orientation">horizontal</property>
<property name="row_spacing">0</property>
<property name="column_spacing">0</property>
<property name="tooltip_column">1</property>
<property name="item_padding">0</property>
<property name="activate_on_single_click">True</property>
<signal name="item-activated" handler="on_library-iconview_item_activated" swapped="no"/>
<signal name="selection-changed" handler="on_library-iconview_selection_changed" swapped="no"/>
<child>
<object class="GtkIconView" id="library-iconview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin">0</property>
<property name="item_orientation">horizontal</property>
<property name="row_spacing">0</property>
<property name="column_spacing">0</property>
<property name="tooltip_column">1</property>
<property name="item_padding">0</property>
<property name="activate_on_single_click">True</property>
<signal name="item-activated" handler="on_library-iconview_item_activated" swapped="no"/>
<signal name="selection-changed" handler="on_library-iconview_selection_changed" swapped="no"/>
<style>
<class name="no-bg"/>
</style>
</object>
</child>
<style>
<class name="no-bg"/>
</style>
</object>
<packing>
<property name="name">page0</property>
<property name="title">page0</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="no-bg"/>
</style>
</object>
<packing>
<property name="expand">True</property>

Binary file not shown.

View file

@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: CoverGrid (mcg)\n"
"POT-Creation-Date: 2017-12-25 17:10+0100\n"
"PO-Revision-Date: 2017-12-25 17:10+0100\n"
"POT-Creation-Date: 2017-12-25 17:40+0100\n"
"PO-Revision-Date: 2017-12-25 17:40+0100\n"
"Last-Translator: coderkun <olli@coderkun.de>\n"
"Language-Team: \n"
"Language: de\n"
@ -158,47 +158,51 @@ msgstr "Wiedergabeliste"
msgid "search library"
msgstr "Bibliothek durchsuchen"
#: data/gtk.glade:1545 data/gtk.menu.ui:42
#: data/gtk.glade:1444
msgid "{} of {} images loaded"
msgstr "{} von {} Bildern geladen"
#: data/gtk.glade:1621 data/gtk.menu.ui:42
msgid "Library"
msgstr "Bibliothek"
#: data/gtk.glade:1624 data/gtk.shortcuts.ui:74
#: data/gtk.glade:1700 data/gtk.shortcuts.ui:74
msgid "Connect or disconnect"
msgstr "Die Verbindung herstellen oder trennen"
#: data/gtk.glade:1646 data/gtk.shortcuts.ui:81
#: data/gtk.glade:1722 data/gtk.shortcuts.ui:81
msgid "Switch between play and pause"
msgstr "Zwischen Abspielen und Pause wechseln"
#: data/gtk.glade:1666
#: data/gtk.glade:1742
msgid "Adjust the volume"
msgstr "Die Lautstärke anpassen"
#: data/gtk.glade:1710
#: data/gtk.glade:1786
msgid "Connect to MPD"
msgstr "Zu MPD verbinden"
#: data/gtk.glade:1752 data/gtk.shortcuts.ui:101
#: data/gtk.glade:1828 data/gtk.shortcuts.ui:101
msgid "Show the cover in fullscreen mode"
msgstr "Das Cover im Vollbildmodus anzeigen"
#: data/gtk.glade:1775 data/gtk.glade:1924
#: data/gtk.glade:1851 data/gtk.glade:2000
msgid "Settings and actions"
msgstr "Einstellungen und Aktionen"
#: data/gtk.glade:1823 data/gtk.glade:1902
#: data/gtk.glade:1899 data/gtk.glade:1978
msgid "Select multiple albums"
msgstr "Mehrere Alben auswählen"
#: data/gtk.glade:1845 data/gtk.shortcuts.ui:88
#: data/gtk.glade:1921 data/gtk.shortcuts.ui:88
msgid "Clear the playlist"
msgstr "Die Wiedergabeliste leeren"
#: data/gtk.glade:1879 data/gtk.shortcuts.ui:114
#: data/gtk.glade:1955 data/gtk.shortcuts.ui:114
msgid "Search the library"
msgstr "Die Bibliothek durchsuchen"
#: data/gtk.glade:1969
#: data/gtk.glade:2045
msgid ""
"CoverGrid is a client for the Music Player Daemon, focusing on albums "
"instead of single tracks."

Binary file not shown.

View file

@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: CoverGrid (mcg)\n"
"POT-Creation-Date: 2017-12-25 17:08+0100\n"
"PO-Revision-Date: 2017-12-25 17:08+0100\n"
"POT-Creation-Date: 2017-12-25 17:40+0100\n"
"PO-Revision-Date: 2017-12-25 17:40+0100\n"
"Last-Translator: coderkun <olli@coderkun.de>\n"
"Language-Team: \n"
"Language: en\n"
@ -157,47 +157,51 @@ msgstr "Playlist"
msgid "search library"
msgstr "search library"
#: data/gtk.glade:1545 data/gtk.menu.ui:42
#: data/gtk.glade:1444
msgid "{} of {} images loaded"
msgstr "{} of {} images loaded"
#: data/gtk.glade:1621 data/gtk.menu.ui:42
msgid "Library"
msgstr "Library"
#: data/gtk.glade:1624 data/gtk.shortcuts.ui:74
#: data/gtk.glade:1700 data/gtk.shortcuts.ui:74
msgid "Connect or disconnect"
msgstr "Connect or disconnect"
#: data/gtk.glade:1646 data/gtk.shortcuts.ui:81
#: data/gtk.glade:1722 data/gtk.shortcuts.ui:81
msgid "Switch between play and pause"
msgstr "Switch between play and pause"
#: data/gtk.glade:1666
#: data/gtk.glade:1742
msgid "Adjust the volume"
msgstr "Adjust the volume"
#: data/gtk.glade:1710
#: data/gtk.glade:1786
msgid "Connect to MPD"
msgstr "Connect to MPD"
#: data/gtk.glade:1752 data/gtk.shortcuts.ui:101
#: data/gtk.glade:1828 data/gtk.shortcuts.ui:101
msgid "Show the cover in fullscreen mode"
msgstr "Show the cover in fullscreen mode"
#: data/gtk.glade:1775 data/gtk.glade:1924
#: data/gtk.glade:1851 data/gtk.glade:2000
msgid "Settings and actions"
msgstr "Settings and actions"
#: data/gtk.glade:1823 data/gtk.glade:1902
#: data/gtk.glade:1899 data/gtk.glade:1978
msgid "Select multiple albums"
msgstr "Select multiple albums"
#: data/gtk.glade:1845 data/gtk.shortcuts.ui:88
#: data/gtk.glade:1921 data/gtk.shortcuts.ui:88
msgid "Clear the playlist"
msgstr "Clear the playlist"
#: data/gtk.glade:1879 data/gtk.shortcuts.ui:114
#: data/gtk.glade:1955 data/gtk.shortcuts.ui:114
msgid "Search the library"
msgstr "Search the library"
#: data/gtk.glade:1969
#: data/gtk.glade:2045
msgid ""
"CoverGrid is a client for the Music Player Daemon, focusing on albums "
"instead of single tracks."

View file

@ -1563,8 +1563,14 @@ class LibraryPanel(GObject.GObject):
self._filter_bar = builder.get_object('library-filter-bar')
self._filter_entry = builder.get_object('library-filter')
# Progress Bar
self._progress_revealer = builder.get_object('library-progress-revealer')
self._stack = builder.get_object('library-stack')
self._progress_box = builder.get_object('library-progress-box')
self._pgross_image = builder.get_object('library-progress-image')
self._pgross_image.set_from_pixbuf(self._get_default_image())
self._progress_label = builder.get_object('library-progress-label')
self._loading_text = self._progress_label.get_label()
self._progress_bar = builder.get_object('library-progress')
self._scroll = builder.get_object('library-scroll')
# Toolbar menu
self._toolbar_search_bar = builder.get_object('library-toolbar-search')
self._toolbar_popover = builder.get_object('library-toolbar-popover')
@ -1859,7 +1865,7 @@ class LibraryPanel(GObject.GObject):
self._library_lock.acquire()
self._library_stop.clear()
self._albums = albums
GObject.idle_add(self._progress_revealer.set_reveal_child, True)
GObject.idle_add(self._stack.set_visible_child, self._progress_box)
GObject.idle_add(self._progress_bar.set_fraction, 0.0)
GObject.idle_add(self._library_grid.set_item_padding, size / 100)
self._library_grid.set_model(None)
@ -1897,6 +1903,7 @@ class LibraryPanel(GObject.GObject):
i += 1
GObject.idle_add(self._progress_bar.set_fraction, i/n)
GObject.idle_add(self._progress_label.set_markup, self._loading_text.format(i, n))
if self._library_stop.is_set():
self._library_lock.release()
return
@ -1905,7 +1912,7 @@ class LibraryPanel(GObject.GObject):
self._library_grid.thaw_child_notify()
self._library_grid.set_item_width(-1)
self._library_lock.release()
self._progress_revealer.set_reveal_child(False)
self._stack.set_visible_child(self._scroll)
def _set_widget_grid_size(self, grid_widget, size, vertical):
@ -2020,6 +2027,14 @@ class LibraryPanel(GObject.GObject):
self._standalone_image.show()
def _get_default_image(self):
return self._icon_theme.load_icon(
Window.STOCK_ICON_DEFAULT,
64,
Gtk.IconLookupFlags.FORCE_SVG & Gtk.IconLookupFlags.FORCE_SIZE
)
class StackSwitcher(GObject.GObject):