Commits

Vladimir Kolev committed 834cb4c

Option to clear the playlist was added

Comments (0)

Files changed (2)

data/main_window.ui

                                   </packing>
                                 </child>
                                 <child>
+                                  <object class="GtkButton" id="button3">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="image">image8</property>
+                                    <signal name="clicked" handler="clear_playlist"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                                <child>
                                   <object class="GtkToggleButton" id="togglebutton1">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
-                                    <property name="position">2</property>
+                                    <property name="position">3</property>
                                   </packing>
                                 </child>
                                 <child>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
-                                    <property name="position">3</property>
+                                    <property name="position">4</property>
                                   </packing>
                                 </child>
                               </object>
     <property name="visible">True</property>
     <property name="icon_name">media-playlist-shuffle</property>
   </object>
+  <object class="GtkImage" id="image8">
+    <property name="visible">True</property>
+    <property name="stock">gtk-clear</property>
+  </object>
 </interface>
             self.playlist.remove(seliter)
             self.playitems.pop(path[0])
 
+    def clear_playlist(self, widget, data=None):
+        """
+        Removes all items from the playlist
+        """
+        self.playlist.clear()
+        self.playitems = []
+        self.playing = None
+
+
     def toggle_repeat(self, widget, data=None):
         """
         Toggles the configuration option for looping trough the
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.