[gnome-games] ui: Update MediaSelector on media number update
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] ui: Update MediaSelector on media number update
- Date: Tue, 5 Jun 2018 18:22:12 +0000 (UTC)
commit 1905831354f32c5d8cf2f1dfec54fefca7b37f17
Author: theawless <theawless gmail com>
Date: Sat Jul 1 23:30:51 2017 +0530
ui: Update MediaSelector on media number update
This syncs the checked media in both normal header bar and full screen
header bar.
https://bugzilla.gnome.org/show_bug.cgi?id=780838
src/ui/media-selector.vala | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/ui/media-selector.vala b/src/ui/media-selector.vala
index 4f2c4c2..812d489 100644
--- a/src/ui/media-selector.vala
+++ b/src/ui/media-selector.vala
@@ -5,16 +5,27 @@ private class Games.MediaSelector : Gtk.Popover {
private MediaSet _media_set;
public MediaSet media_set {
set {
+ if (media_set_changed_id != 0) {
+ _media_set.disconnect (media_set_changed_id);
+ media_set_changed_id = 0;
+ }
_media_set = value;
+ if (_media_set != null)
+ media_set_changed_id = _media_set.notify["selected-media-number"].connect
(reset_media);
- remove_media ();
- update_media ();
+ reset_media ();
}
}
+ private ulong media_set_changed_id = 0;
[GtkChild]
private Gtk.ListBox list_box;
+ private void reset_media () {
+ remove_media ();
+ update_media ();
+ }
+
private void update_media () {
var media_number = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]