[gnome-games] developer-list-item: Update label on change



commit 3f6600e1865948330d1d631b40e68e5d13ce2ddb
Author: theawless <theawless gmail com>
Date:   Sat Aug 25 23:35:49 2018 +0530

    developer-list-item: Update label on change

 po/POTFILES.in                  | 1 +
 src/ui/developer-list-item.vala | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 184566f5..8155d72d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -64,6 +64,7 @@ src/retro/retro-runner.vala
 src/retro/retro-simple-type.vala
 src/ui/application.vala
 src/ui/application-window.vala
+src/ui/developer-list-item.vala
 src/ui/error-display.vala
 src/ui/gamepad-configurer.vala
 src/ui/gamepad-mapper.vala
diff --git a/src/ui/developer-list-item.vala b/src/ui/developer-list-item.vala
index ad510b31..7a2ab72a 100644
--- a/src/ui/developer-list-item.vala
+++ b/src/ui/developer-list-item.vala
@@ -5,11 +5,17 @@ private class Games.DeveloperListItem: Gtk.Label {
                get { return _developer; }
                set {
                        _developer = value;
-                       label = value.get_developer ();
+                       update_label ();
+                       value.changed.connect (update_label);
                }
        }
 
        public DeveloperListItem (Developer developer) {
                Object (developer: developer);
        }
+
+       private void update_label () {
+               var val = developer.get_developer ();
+               label = val == "" ? _("Unknown") : val;
+       }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]