Don't use an infinite number of timers
authorRafaël Carré <funman@videolan.org>
Tue, 21 Nov 2006 17:05:38 +0000 (17:05 +0000)
committerRafaël Carré <funman@videolan.org>
Tue, 21 Nov 2006 17:05:38 +0000 (17:05 +0000)
Fixes dialog size, add tooltip

extras/dbus-vlc.glade
extras/dbus-vlc.py

index 3b88744..9500a96 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.0.2 on Tue Nov 21 16:05:19 2006 by fun@zod-->
+<!--Generated with glade3 3.0.2 on Tue Nov 21 18:02:27 2006 by fun@zod-->
 <glade-interface>
   <widget class="GtkWindow" id="window1">
     <property name="resizable">False</property>
                     <property name="visible">True</property>
                     <child>
                       <widget class="GtkHScale" id="time_s">
-                        <property name="width_request">183</property>
+                        <property name="width_request">180</property>
                         <property name="height_request">20</property>
                         <property name="visible">True</property>
                         <property name="adjustment">0 0 1000 10 100 0</property>
                         <property name="snap_to_ticks">True</property>
                         <property name="numeric">True</property>
                         <property name="update_policy">GTK_UPDATE_IF_VALID</property>
+                        <property name="tooltip" translatable="yes">Volume in %</property>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
                     <property name="visible">True</property>
                     <child>
                       <widget class="GtkLabel" id="item">
-                        <property name="width_request">185</property>
+                        <property name="width_request">180</property>
                         <property name="height_request">20</property>
                         <property name="visible">True</property>
                         <property name="justify">GTK_JUSTIFY_CENTER</property>
index f31332e..dab06d5 100755 (executable)
@@ -33,6 +33,7 @@ global timer
 global playing
 
 def itemchange_handler(item):
+    gobject.timeout_add( 2000, timeset)
     l_item.set_text(item)
 
 bus = dbus.SessionBus()
@@ -74,7 +75,6 @@ def GetPlayStatus(widget):
     status = str(interface.GetPlayStatus())
     if status == "playing":
         img_bt_toggle.set_from_stock("gtk-media-pause", gtk.ICON_SIZE_SMALL_TOOLBAR)
-        gobject.timeout_add( 2000, timeset)
         playing = True
     else:
         img_bt_toggle.set_from_stock("gtk-media-play", gtk.ICON_SIZE_SMALL_TOOLBAR)
@@ -191,6 +191,7 @@ vol.connect('scroll-event',     volchange)
 time_s.connect('adjust-bounds', timechange)
 
 time_s.set_update_policy(gtk.UPDATE_DISCONTINUOUS)
+gobject.timeout_add( 2000, timeset)
 
 library = "/media/mp3"