Update of /cvsroot/freevo/freevo/src/gui/areas
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15528
Modified Files:
tvlisting_area.py
Log Message:
better channels.py support
Index: tvlisting_area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/areas/tvlisting_area.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tvlisting_area.py 5 Aug 2004 17:30:24 -0000 1.3
--- tvlisting_area.py 10 Aug 2004 19:38:02 -0000 1.4
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.4 2004/08/10 19:38:02 dischi
+ # better channels.py support
+ #
# Revision 1.3 2004/08/05 17:30:24 dischi
# cleanup
***************
*** 66,69 ****
--- 69,73 ----
self.last_settings = None
self.last_items_geometry = None
+ self.last_start_time = 0
***************
*** 170,176 ****
update the listing area
"""
-
- return
-
menu = self.menu
settings = self.settings
--- 174,177 ----
***************
*** 179,185 ****
content = self.calc_geometry(layout.content, copy_object=True)
! to_listing = menu.table
! n_cols = len(to_listing[0])-1
col_time = 30
--- 180,188 ----
content = self.calc_geometry(layout.content, copy_object=True)
! # to_listing = menu.table
! # n_cols = len(to_listing[0])-1
!
! n_cols = 4
col_time = 30
***************
*** 187,190 ****
--- 190,194 ----
self.get_items_geometry(settings, menu)[:-1]
+
label_val, head_val, selected_val, default_val, scheduled_val = self.all_vals
***************
*** 245,258 ****
r.width+1, head_h+1, r )
# use label padding for x; head padding for y
! self.drawstring( time.strftime( dateformat, time.localtime( to_listing[ 0 ][
1 ] ) ),
! head_val.font, content,
! x=( x_contents - r.width + pad_x ),
! y=( y_contents - r.height + ig.y ),
! width=( r.width - 2 * pad_x ), height=-1,
! align_v='center', align_h=head_val.align )
# Print the time at the table's top
x0 = x_contents
--- 249,276 ----
r.width+1, head_h+1, r )
+
# use label padding for x; head padding for y
! # self.drawstring( time.strftime( dateformat, time.localtime( to_listing[ 0
][ 1 ] ) ),
! # head_val.font, content,
! # x=( x_contents - r.width + pad_x ),
! # y=( y_contents - r.height + ig.y ),
! # width=( r.width - 2 * pad_x ), height=-1,
! # align_v='center', align_h=head_val.align )
+ start_time = self.last_start_time
+ if menu.selected.start == 0:
+ start_time = self.last_start_time - 60 * col_time
+
+ elif menu.selected.start < self.last_start_time:
+ if menu.selected.stop < self.last_start_time + (n_cols - 2) * col_time *
60:
+ start_time = menu.selected.start / (60 * col_time) * (60 * col_time)
+
+ elif menu.selected.start > self.last_start_time + (n_cols - 2) * col_time *
60:
+ start_time = menu.selected.start / (60 * col_time) * (60 * col_time)
+ self.last_start_time = start_time
+ stop_time = start_time + col_time * n_cols * 60
+
# Print the time at the table's top
x0 = x_contents
***************
*** 264,268 ****
self.drawstring( time.strftime( timeformat,
! time.localtime( to_listing[ 0 ][ i + 1 ]
) ),
head_val.font, content,
x=( x0 + ig.x ), y=( ty0 + ig.y ),
--- 282,286 ----
self.drawstring( time.strftime( timeformat,
! time.localtime(start_time +
col_time*i*60 ) ),
head_val.font, content,
x=( x0 + ig.x ), y=( ty0 + ig.y ),
***************
*** 271,284 ****
x0 += col_size
- # define start and stop time
- date = time.strftime("%x", time.localtime())
- start_time = to_listing[0][1]
- stop_time = to_listing[0][-1]
- stop_time += (col_time*60)
# selected program:
! selected_prog = to_listing[1]
! for i in range(2,len(to_listing)):
ty0 = y0
tx0 = content.x
--- 289,300 ----
x0 += col_size
# selected program:
! selected_prog = menu.selected
! all_channels = menu.channel_list.get_all()
! start_channel = all_channels.index(menu.channel) / num_rows * num_rows
!
! for channel in all_channels[start_channel:start_channel+num_rows]:
ty0 = y0
tx0 = content.x
***************
*** 300,304 ****
! channel_logo = config.TV_LOGOS + '/' + to_listing[i].id + '.png'
if os.path.isfile(channel_logo):
channel_logo = self.loadimage(channel_logo, (r.width+1-2*r.size,
--- 316,320 ----
! channel_logo = config.TV_LOGOS + '/' + channel.id + '.png'
if os.path.isfile(channel_logo):
channel_logo = self.loadimage(channel_logo, (r.width+1-2*r.size,
***************
*** 313,328 ****
else:
! self.drawstring(to_listing[i].displayname, label_val.font, content,
x=tx0, y=ty0, width=r.width+2*r.x, height=item_h)
self.drawbox(tx0 + r.x, ty0 + r.y, r.width+1, item_h, r)
!
! if to_listing[i].programs:
! for prg in to_listing[i].programs:
flag_left = 0
flag_right = 0
if prg.start < start_time:
! flag_left = 1
x0 = x_contents
t_start = start_time
--- 329,344 ----
else:
! self.drawstring(channel.name, label_val.font, content,
x=tx0, y=ty0, width=r.width+2*r.x, height=item_h)
self.drawbox(tx0 + r.x, ty0 + r.y, r.width+1, item_h, r)
! try:
! for prg in channel.get(start_time, stop_time):
flag_left = 0
flag_right = 0
if prg.start < start_time:
! if prg.valid:
! flag_left = 1
x0 = x_contents
t_start = start_time
***************
*** 332,336 ****
if prg.stop > stop_time:
! flag_right = 1
w = w_contents + x_contents - x0
x1 = x_contents + w_contents
--- 348,353 ----
if prg.stop > stop_time:
! if prg.valid:
! flag_right = 1
w = w_contents + x_contents - x0
x1 = x_contents + w_contents
***************
*** 339,349 ****
x1 = x_contents + int(float(prg.stop-start_time) * prop_1sec)
! if prg.title == selected_prog.title and \
! prg.channel_id == selected_prog.channel_id and \
! prg.start == selected_prog.start and \
! prg.stop == selected_prog.stop:
!
val = selected_val
-
elif prg.scheduled:
val = scheduled_val
--- 356,361 ----
x1 = x_contents + int(float(prg.stop-start_time) * prop_1sec)
! if prg == selected_prog:
val = selected_val
elif prg.scheduled:
val = scheduled_val
***************
*** 353,365 ****
font = val.font
! try:
! if prg.title == _('This channel has no data loaded'):
! val = copy.copy(val)
! val.align='center'
! except UnicodeError:
! pass
if x0 > x1:
! break
# text positions
--- 365,375 ----
font = val.font
! if not prg.valid:
! val = copy.copy(val)
! val.align='center'
if x0 > x1:
! print 'skip', x0, x1
! continue
# text positions
***************
*** 397,408 ****
align_v='center', align_h = val.align)
! i += 1
y0 += item_h - 1
# print arrow:
! if menu.display_up_arrow and area.images['uparrow']:
self.drawimage(area.images['uparrow'].filename, area.images['uparrow'])
! if menu.display_down_arrow and area.images['downarrow']:
if isinstance(area.images['downarrow'].y, str):
v = copy.copy(area.images['downarrow'])
--- 407,420 ----
align_v='center', align_h = val.align)
! except Exception, e:
! print 'ERROR', e
! print start_time, stop_time, channel.name
y0 += item_h - 1
# print arrow:
! if start_channel > 0 and area.images['uparrow']:
self.drawimage(area.images['uparrow'].filename, area.images['uparrow'])
! if len(all_channels) >= start_channel+num_rows and area.images['downarrow']:
if isinstance(area.images['downarrow'].y, str):
v = copy.copy(area.images['downarrow'])
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog