Commits

Damián Nohales committed 8c35df4

When search results is empty, disable search widgets

  • Participants
  • Parent commits a4249e7

Comments (0)

Files changed (1)

     def fill_results(self, results):
         self.app.entry_search.set_sensitive(True)
         self.app.result.clear()
-        if results:
+        if results and len(results) > 0:
+            self.app.vbox_results.set_sensitive(True)
+            self.app.entry_filter.set_sensitive(True)
+            self.app.result.get_view().set_headers_visible(True)
             for song_data in results:
                 self.app.result.append_song(Song(song_data))
+        else:
+            self.app.vbox_results.set_sensitive(False)
+            self.app.entry_filter.set_sensitive(False)
+            self.app.result.get_view().set_headers_visible(False)
+            self.app.result.get_model().get_model().append([
+                None,
+                _("No songs found"),
+                "",
+                ""
+            ])
 
 
 class UpdateThread(threading.Thread):