Commits

Damián Nohales committed 82d9ae5

Some minor GUI changes...

- Sensitivity changes on playlist buttons
- The song info button act on the current playing song
- Some minor changes in main_window.ui

Comments (0)

Files changed (2)

data/main_window.ui

                       <object class="GtkLabel" id="label4">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0.079999998211860657</property>
+                        <property name="xalign">0</property>
                         <property name="yalign">0.72000002861022949</property>
+                        <property name="xpad">10</property>
                         <property name="label" translatable="yes">&lt;b&gt;Search Results&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                       </object>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkHBox" id="hbox11">
+                      <object class="GtkHBox" id="hbox_filter">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
                       <object class="GtkLabel" id="label5">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0.059999998658895493</property>
+                        <property name="xalign">0</property>
+                        <property name="xpad">10</property>
                         <property name="label" translatable="yes">&lt;b&gt;Playlist&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                       </object>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
-                          <object class="GtkButton" id="button_delete">
+                          <object class="GtkButton" id="button_playlist_delete">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkButton" id="button_clear">
+                          <object class="GtkButton" id="button_playlist_clear">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
+                            <property name="tooltip_text" translatable="yes">Save playlist to file</property>
                             <property name="use_action_appearance">False</property>
                             <property name="image">image_save_as</property>
                             <property name="relief">none</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
+                            <property name="tooltip_text" translatable="yes">Load playlist from file</property>
                             <property name="use_action_appearance">False</property>
                             <property name="image">image_open</property>
                             <property name="relief">none</property>
                                 <property name="can_focus">True</property>
                                 <property name="selection_mode">multiple</property>
                                 <property name="reorderable">True</property>
+                                <signal name="selection-changed" handler="on_playlist_view_selection_changed" swapped="no"/>
                               </object>
                             </child>
                           </object>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkHScale" id="seekbar">
+                      <object class="GtkAlignment" id="alignment3">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="tooltip_text" translatable="yes">Seek is planned for
-future version</property>
-                        <property name="draw_value">False</property>
-                        <signal name="change-value" handler="on_seekbar_change_value" swapped="no"/>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">5</property>
+                        <property name="right_padding">7</property>
+                        <child>
+                          <object class="GtkHScale" id="seekbar">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="draw_value">False</property>
+                            <signal name="change-value" handler="on_seekbar_change_value" swapped="no"/>
+                          </object>
+                        </child>
                       </object>
                       <packing>
                         <property name="expand">True</property>
                       <object class="GtkLabel" id="songinfo">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0.98000001907348633</property>
+                        <property name="xalign">1</property>
+                        <property name="xpad">4</property>
                         <property name="label" translatable="yes">label</property>
                         <property name="justify">right</property>
                         <property name="ellipsize">end</property>
         
         self.label_player_time = builder.get_object('label_player_time')
         self.seekbar = builder.get_object('seekbar')
+        self.button_playlist_delete = builder.get_object('button_playlist_delete')
+        self.button_playlist_clear = builder.get_object('button_playlist_clear')
+        self.button_save_playlist = builder.get_object('button_save_playlist')
         self.button_lyrics = builder.get_object('button_lyrics')
         self.button_love = builder.get_object('button_love')
         self.button_songinfo = builder.get_object('button_songinfo')
         self.window.show_all()
         
         self.on_playlist_row_changed(self.playlist.get_model())
+        self.on_playlist_view_selection_changed(self.playlist.get_view())
         self.set_playing_song(None)
         self.set_search_sensitivity(False)
 
         if len(self.playlist.get_model()) > 0:
             self.playlist_sw.show_all()
             self.playlist_empty.hide_all()
+            self.button_playlist_clear.set_sensitive(True)
+            self.button_save_playlist.set_sensitive(True)
         else:
             self.playlist_empty.show_all()
             self.playlist_sw.hide_all()
+            self.button_playlist_clear.set_sensitive(False)
+            self.button_save_playlist.set_sensitive(False)
+            
+    def on_playlist_view_selection_changed(self, iconview):
+        if len(self.playlist.get_selected_rows()) > 0:
+            self.button_playlist_delete.set_sensitive(True)
+        else:
+            self.button_playlist_delete.set_sensitive(False)
     
     def on_add_to_playlist(self, widget, data = None):
         """
             self.button_play.set_image(self.widget_image_buffering)
             self.is_buffering = True
         elif message.type == gst.MESSAGE_EOS:
-            self.app.play_next()
+            self.play_next()
         elif message.type == gst.MESSAGE_ASYNC_DONE:
             self.is_buffering = False
             self.button_play.set_image(self.widget_image_stop)
         """
         self.playlist.set_playing_song(song)
         self.seekbar.set_value(0)
-        self.label_player_time.set_text("- / -")
+        self.label_player_time.set_text("00:00 / 00:00")
         self.player.set_state(gst.STATE_NULL)
 
         if song != None:
 
     def on_show_info(self, widget, data = None):
         """
-        Song infromation dialog for first item selected from the search results.
+        Song infromation dialog for current playing song
         """
-        select = self.result.get_view().get_selection().get_selected_rows()
-        if self.result.get_view().get_selection().count_selected_rows() > 0:
-            song = self.result.get_song(select[1][0])
-            dialog = guihelpers.SongInfoDialog(song)
+        if self.get_playing_song() != None:
+            dialog = guihelpers.SongInfoDialog(self.get_playing_song())
             dialog.show_all()
 
 
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.