Author: dmeyer
Date: Sat Jan 20 20:31:32 2007
New Revision: 9030
Modified:
trunk/ui/src/directory.py
trunk/ui/src/mainmenu.py
trunk/ui/src/playlist.py
trunk/ui/src/plugins/file_ops.py
trunk/ui/src/plugins/shutdown.py
trunk/ui/src/plugins/unpack.py
Log:
adjust to new application/window code
Modified: trunk/ui/src/directory.py
==============================================================================
--- trunk/ui/src/directory.py (original)
+++ trunk/ui/src/directory.py Sat Jan 20 20:31:32 2007
@@ -55,7 +55,7 @@
from playlist import Playlist
from event import *
-from gui.windows import InputBox, MessageBox, ProgressBox
+from application import MessageWindow
# get logging object
log = logging.getLogger()
@@ -360,7 +360,7 @@
"""
# FIXME: add password checking here
if not os.path.exists(self.dir):
- MessageBox(_('Directory does not exist')).show()
+ MessageWindow(_('Directory does not exist')).show()
return
display_type = self.display_type
if self.display_type == 'tv':
@@ -388,8 +388,6 @@
dir_items = []
pl_items = []
- t1 = time.time()
-
if update:
# Delete possible skin settings
# FIXME: This is a very bad handling, maybe signals?
@@ -402,20 +400,18 @@
elif not os.path.exists(self.dir):
# FIXME: better handling!!!!!
- MessageBox(_('Directory does not exist')).show()
+ MessageWindow(_('Directory does not exist')).show()
return
display_type = self.display_type
if self.display_type == 'tv':
display_type = 'video'
- t2 = time.time()
if not update:
self.query = kaa.beacon.query(parent=self.info)
self.query.signals['changed'].connect_weak(self.browse,
update=True)
self.query.monitor()
listing = self.query.get(filter='extmap')
- t3 = time.time()
#
# build items
@@ -438,8 +434,6 @@
# remember listing
self.listing = listing
- t4 = time.time()
-
# handle hide_played
if self['config:hide_played']:
play_items = [ p for p in play_items if not
p.info.get('last_played') ]
@@ -534,16 +528,9 @@
# normal menu build
item_menu = menu.Menu(self.name, items, type = display_type)
item_menu.autoselect = self['config:autoplay_single_item']
-
- t5 = time.time()
self.pushmenu(item_menu)
- t6 = time.time()
-
self.item_menu = weakref(item_menu)
- if False:
- print t2 - t1, t3 - t2, t4 - t3, t5 - t4, t6 - t5
-
# ======================================================================
# configure submenu
# ======================================================================
Modified: trunk/ui/src/mainmenu.py
==============================================================================
--- trunk/ui/src/mainmenu.py (original)
+++ trunk/ui/src/mainmenu.py Sat Jan 20 20:31:32 2007
@@ -64,14 +64,14 @@
self.function = action, arg
self.args = []
self.kwargs = {}
-
+
if not type and not parent.parent:
# this is the first page, force type to 'main'
self.type = 'main'
-
+
if not skin_type:
return
-
+
# load extra informations for the skin fxd file
theme = gui.theme.get()
skin_info = theme.mainmenu.items
@@ -106,7 +106,7 @@
a.parameter(*self.args, **self.kwargs)
return [ a ]
-
+
class MainMenu(Item):
"""
This class handles the main menu. It will start the main menu widget
@@ -122,11 +122,9 @@
items += p.items(self)
menu = Menu(_('Freevo Main Menu'), items, type='main')
menu.autoselect = True
- self.menuw = MenuWidget()
- self.menuw.pushmenu(menu)
- self.menuw.show()
+ self.menuw = MenuWidget(menu)
+
-
def get_skins(self):
"""
return a list of all possible skins with name, image and filename
@@ -157,11 +155,3 @@
because it is not bound to a menupage.
"""
return self.menuw
-
-
- def eventhandler(self, event):
- """
- Automatically perform actions depending on the event, e.g. play DVD
- """
- # give the event to the next eventhandler in the list
- return Item.eventhandler(self, event)
Modified: trunk/ui/src/playlist.py
==============================================================================
--- trunk/ui/src/playlist.py (original)
+++ trunk/ui/src/playlist.py Sat Jan 20 20:31:32 2007
@@ -86,7 +86,7 @@
self.display_type = type
self.next_pos = None
self.__playlist_valid = False
-
+
self.background_playlist = None
self.random = random
@@ -115,7 +115,7 @@
if os.path.exists(os.path.join(curdir,line)):
playlist.append(os.path.join(curdir,line))
return playlist
-
+
def _read_pls(self, plsname, content):
"""
@@ -173,7 +173,7 @@
if isinstance(playlist, kaa.beacon.Query):
playlist = [ playlist ]
-
+
# Note: playlist is a list of Items, strings (filenames) or a
# beacon queries now.
@@ -222,7 +222,7 @@
self.__create_playlist_items()
return MediaItem.__getitem__(self, attr)
-
+
def actions(self):
"""
return the actions for this item: play and browse
@@ -308,7 +308,7 @@
def _play_next(self):
self.select(self.choices[self.next_pos])
-
+
if hasattr(self.selected, 'play'):
# play the item
self.selected.play()
@@ -371,7 +371,7 @@
"""
return self
-
+
def eventhandler(self, event):
"""
Handle playlist specific events
@@ -444,7 +444,6 @@
if event == STOP:
# Stop playing and send event to parent item
- print 'playlist stop'
self.stop()
# give the event to the next eventhandler in the list
Modified: trunk/ui/src/plugins/file_ops.py
==============================================================================
--- trunk/ui/src/plugins/file_ops.py (original)
+++ trunk/ui/src/plugins/file_ops.py Sat Jan 20 20:31:32 2007
@@ -40,7 +40,7 @@
import util
from menu import Action
-from gui.windows import ConfirmBox
+from application import ConfirmWindow
# get logging object
log = logging.getLogger()
@@ -86,22 +86,22 @@
def delete(self, item):
txt = _('Do you wish to delete\n \'%s\'?') % item.name
- box = ConfirmBox(txt, default_choice=1)
- box.connect(0, self.__delete, item)
+ box = ConfirmWindow(txt, default_choice=1)
+ box.buttons[0].connect(self.__delete, item)
box.show()
def delete_info(self, item):
txt = _('Delete info about\n \'%s\'?') % item.name
- box = ConfirmBox(txt, default_choice=1)
- box.connect(0, self.__delete_info, item)
+ box = ConfirmWindow(txt, default_choice=1)
+ box.buttons[0].connect(self.__delete_info, item)
box.show()
def delete_image(self, item):
txt = _('Delete image about\n \'%s\'?') % item.name
- box = ConfirmBox(txt, default_choice=1)
- box.connect(0, self.__delete_image, item)
+ box = ConfirmWindow(txt, default_choice=1)
+ box.buttons[0].connect(self.__delete_image, item)
box.show()
Modified: trunk/ui/src/plugins/shutdown.py
==============================================================================
--- trunk/ui/src/plugins/shutdown.py (original)
+++ trunk/ui/src/plugins/shutdown.py Sat Jan 20 20:31:32 2007
@@ -43,7 +43,7 @@
import gui.widgets
from menu import Action
-from gui.windows import ConfirmBox
+from application import ConfirmWindow
from mainmenu import MainMenuItem
from plugin import MainMenuPlugin
@@ -79,41 +79,41 @@
def confirm_freevo(self):
"""
- Pops up a ConfirmBox.
+ Pops up a ConfirmWindow.
"""
what = _('Do you really want to shut down Freevo?')
- box = ConfirmBox(what, default_choice=1)
- box.connect(0, self.shutdown_freevo)
+ box = ConfirmWindow(what, default_choice=1)
+ box.buttons[0].connect(self.shutdown_freevo)
box.show()
def confirm_system(self):
"""
- Pops up a ConfirmBox.
+ Pops up a ConfirmWindow.
"""
what = _('Do you really want to shut down the system?')
- box = ConfirmBox(what, default_choice=1)
- box.connect(0, self.shutdown_system)
+ box = ConfirmWindow(what, default_choice=1)
+ box.buttons[0].connect(self.shutdown_system)
box.show()
def confirm_freevo_restart(self):
"""
- Pops up a ConfirmBox.
+ Pops up a ConfirmWindow.
"""
what = _('Do you really want to restart Freevo?')
- box = ConfirmBox(what, default_choice=1)
- box.connect(0, self.shutdown_freevo_restart)
+ box = ConfirmWindow(what, default_choice=1)
+ box.buttons[0].connect(self.shutdown_freevo_restart)
box.show()
def confirm_sys_restart(self):
"""
- Pops up a ConfirmBox.
+ Pops up a ConfirmWindow.
"""
what = _('Do you really want to restart the system?')
- box = ConfirmBox(what, default_choice=1)
- box.connect(0, self.shutdown_sys_restart)
+ box = ConfirmWindow(what, default_choice=1)
+ box.buttons[0].connect(self.shutdown_sys_restart)
box.show()
Modified: trunk/ui/src/plugins/unpack.py
==============================================================================
--- trunk/ui/src/plugins/unpack.py (original)
+++ trunk/ui/src/plugins/unpack.py Sat Jan 20 20:31:32 2007
@@ -45,7 +45,7 @@
import util
from menu import Item, Action
-from gui.windows import WaitBox
+from application import TextWindow
# possible archives and how to unpack them
_cmdlines = {
@@ -79,7 +79,7 @@
for param in _cmdlines[os.path.splitext(self.fname)[1][1:]]:
app.append(param.replace('__filename__', self.fname).\
replace('__dirname__', os.path.dirname(self.fname)))
- self.pop = WaitBox(text=_('unpacking...'))
+ self.pop = TextWindow(text=_('unpacking...'))
self.pop.show()
child = kaa.notifier.Process(app)
child.signals["completed"].connect(self.finished)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog