Damián Nohales avatar Damián Nohales committed 8c35df4

When search results is empty, disable search widgets

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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.