Changeset 1594

Show
Ignore:
Timestamp:
2005-11-01 10:31:18 (3 years ago)
Author:
scott
Message:

- Added format_time function to format the time including zero fill.
- Changed the scrollbars around playlist treeview.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • annoamp/trunk/annoamp.py

    r1593 r1594  
    243243     
    244244def update_gui_time(time, duration): 
    245     xml.get_widget("time").set_text(str(time/3600)+ ":" + str(time/60%60) + ":" + str(time%60) + " / " + str(duration/3600)+ ":" + str(duration/60%60) + ":" + str(duration%60)) 
    246     xml.get_widget("slider").set_value(time) 
     245    xml.get_widget("time").set_text(format_time(time) + "/" + format_time(duration)) 
    247246     
    248247def update_gui_duration(duration): 
     
    254253        player.loadFile(chooser.get_filename(),playlist) 
    255254    chooser.destroy() 
     255     
     256def format_time(time): 
     257    hour = str(time/3600) 
     258    minute = time/60%60 
     259    if minute < 10: 
     260        minute = "0" + str(minute) 
     261    else: 
     262        minute = str(minute) 
     263    seconds = time%60 
     264    if seconds < 10: 
     265        seconds = "0" + str(seconds) 
     266    else: 
     267        seconds = str(seconds) 
     268    return hour + ":" + minute + ":" + seconds 
    256269 
    257270playlist = gtk.TreeStore(str, int) 
  • annoamp/trunk/annocast.glade

    r1593 r1594  
    231231          <property name="visible">True</property> 
    232232          <property name="can_focus">True</property> 
    233           <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> 
    234           <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> 
     233          <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> 
     234          <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> 
    235235          <property name="shadow_type">GTK_SHADOW_IN</property> 
    236236          <property name="window_placement">GTK_CORNER_TOP_LEFT</property>