[gnome-music/wip/gbsneto/contained-playlists: 28/29] playlistdialog: Make dialog insensitive while creating playlist



commit a7397be09abc0671c9dc8c942f10a1c166f9a38d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Dec 1 21:12:27 2016 -0200

    playlistdialog: Make dialog insensitive while creating playlist
    
    When creating a playlist, the current behavior gives no feedback that
    the operation is going on, neither blocks the user from repeatedly
    click the Add button. This may lead to confusion and errors.
    
    Fix that by making the entire dialog insensitive while a playlist
    is being created.

 gnomemusic/widgets/playlistdialog.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/widgets/playlistdialog.py b/gnomemusic/widgets/playlistdialog.py
index eba1394..1671fe2 100644
--- a/gnomemusic/widgets/playlistdialog.py
+++ b/gnomemusic/widgets/playlistdialog.py
@@ -95,6 +95,7 @@ class PlaylistDialog():
         if self._new_playlist_entry.get_text() != '':
             self.playlists.create_playlist(self._new_playlist_entry.get_text())
             self._playlist_created = True
+            self.dialog_box.set_sensitive(False)
 
     @log
     def _on_playlist_added(self, playlists, playlist):
@@ -119,6 +120,7 @@ class PlaylistDialog():
         # select it and notify the window that we're done
         if self._playlist_created:
             self.listbox.select_row(row)
+            self.dialog_box.set_sensitive(True)
             self.dialog_box.response(Gtk.ResponseType.ACCEPT)
             return
 


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