Update of /cvsroot/freevo/freevo/src/tv
In directory sc8-pr-cvs1:/tmp/cvs-serv28874
Modified Files:
program_display.py
Log Message:
Changes to make the list update when you remove a scheduled recording.
Also made the buttons in the program display on top of one another instead
of side by side. I will be adding more buttons (add to favorites, search
for more) and they will look and fit better this way. I think they would
all be better together in a ListBox.
Index: program_display.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/tv/program_display.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** program_display.py 13 Sep 2003 21:00:50 -0000 1.15
--- program_display.py 14 Oct 2003 02:30:12 -0000 1.16
***************
*** 10,13 ****
--- 10,21 ----
#-----------------------------------------------------------------------
# $Log$
+ # Revision 1.16 2003/10/14 02:30:12 rshortt
+ # Changes to make the list update when you remove a scheduled recording.
+ #
+ # Also made the buttons in the program display on top of one another instead
+ # of side by side. I will be adding more buttons (add to favorites, search
+ # for more) and they will look and fit better this way. I think they would
+ # all be better together in a ListBox.
+ #
# Revision 1.15 2003/09/13 21:00:50 outlyer
# OSDFont has 'name' as an attribute, while Font has 'filename' It was swapped
***************
*** 155,164 ****
self.b0 = Button('Remove', width=(width-60)/2)
! self.b0.set_h_align(Align.NONE)
self.add_child(self.b0)
self.b0.toggle_selected()
self.b1 = Button('CANCEL', width=(width-60)/2)
! self.b1.set_h_align(Align.NONE)
self.add_child(self.b1)
--- 163,172 ----
self.b0 = Button('Remove', width=(width-60)/2)
! self.b0.set_h_align(Align.CENTER)
self.add_child(self.b0)
self.b0.toggle_selected()
self.b1 = Button('CANCEL', width=(width-60)/2)
! self.b1.set_h_align(Align.CENTER)
self.add_child(self.b1)
***************
*** 188,192 ****
! if event in (em.INPUT_LEFT, em.INPUT_RIGHT):
self.b0.toggle_selected()
self.b1.toggle_selected()
--- 196,200 ----
! if event in (em.INPUT_UP, em.INPUT_DOWN):
self.b0.toggle_selected()
self.b1.toggle_selected()
***************
*** 196,205 ****
! if event in (em.INPUT_UP, em.INPUT_DOWN, em.INPUT_LEFT, em.INPUT_RIGHT):
! if DEBUG: print 'ProgramDisplay: should scroll'
! if hasattr(self,'options'):
! return self.options.eventhandler(event)
! else:
! return
elif event == em.INPUT_ENTER:
--- 204,215 ----
! # The following block of code was for when the options were in a list
! # box. Trying a different way (buttons) now.
! #if event in (em.INPUT_UP, em.INPUT_DOWN, em.INPUT_LEFT, em.INPUT_RIGHT):
! # if DEBUG: print 'ProgramDisplay: should scroll'
! # if hasattr(self,'options'):
! # return self.options.eventhandler(event)
! # else:
! # return
elif event == em.INPUT_ENTER:
***************
*** 213,228 ****
AlertBox(parent=self,
text='Scheduling Failed: %s' % msg).show()
elif 0:
tv.program_search.ProgramSearch(parent=self,
search=self.prog.title).show()
elif 0:
tv.edit_favorite.EditFavorite(parent=self,
subject=self.prog).show()
elif self.b0.selected:
(result, msg) = record_client.removeScheduledRecording(self.prog)
if result:
! AlertBox(parent=self,
! text='"%s" has been removed' % \
! self.prog.title, handler=self.destroy).show()
else:
AlertBox(parent=self,
--- 223,262 ----
AlertBox(parent=self,
text='Scheduling Failed: %s' % msg).show()
+
+ # XXX: search for other programs like this
elif 0:
tv.program_search.ProgramSearch(parent=self,
search=self.prog.title).show()
+
+ # XXX: add to favorites - should go to an edit favorites screen
elif 0:
tv.edit_favorite.EditFavorite(parent=self,
subject=self.prog).show()
+
+ # next will only happen if we are not viewing from the guide
elif self.b0.selected:
(result, msg) = record_client.removeScheduledRecording(self.prog)
if result:
! pop = PopupBox(parent=self,
! text='"%s" has been removed' % \
! self.prog.title)
! pop.show()
! time.sleep(2)
! pop.destroy()
!
! searcher = None
!
! if self.context == 'recording' and self.parent:
! for child in self.parent.children:
! if isinstance(child, ScheduledRecordings):
! searcher = child
! break
!
! self.destroy()
! if searcher:
! searcher.refreshList()
! searcher.draw()
! self.osd.update()
!
else:
AlertBox(parent=self,
***************
*** 268,284 ****
vertical_expansion)
!
! (self.result, recordings) = record_client.getScheduledRecordings()
! if self.result:
! progs = recordings.getProgramList()
! else:
! errormsg = Label('Get recordings failed: %s' % recordings,
self, Align.CENTER)
! return
self.internal_h_align = Align.CENTER
! items_height = 40
! self.num_shown_items = 7
self.results = ListBox(width=(self.width-2*self.h_margin),
height=self.num_shown_items*items_height,
--- 302,316 ----
vertical_expansion)
! (self.server_available, msg) = record_client.connectionTest()
! if not self.server_available:
! errormsg = Label('Record server unavailable: %s' % msg,
self, Align.CENTER)
! return
!
self.internal_h_align = Align.CENTER
! items_height = Button('foo').height + 2
! self.num_shown_items = 8
self.results = ListBox(width=(self.width-2*self.h_margin),
height=self.num_shown_items*items_height,
***************
*** 289,292 ****
--- 321,336 ----
self.results.set_h_align(Align.CENTER)
self.add_child(self.results)
+
+ self.refreshList()
+
+
+ def refreshList(self):
+ (self.result, recordings) = record_client.getScheduledRecordings()
+ if self.result:
+ progs = recordings.getProgramList()
+ else:
+ errormsg = Label('Get recordings failed: %s' % recordings,
+ self, Align.CENTER)
+ return
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog