Merge lp:~joshuascotton/entertainer/bug-281245 into lp:entertainer
Proposed by
Joshua Scotton
Status: | Merged | ||||
---|---|---|---|---|---|
Merge reported by: | Paul Hummer | ||||
Merged at revision: | 290 | ||||
Proposed branch: | lp:~joshuascotton/entertainer/bug-281245 | ||||
Merge into: | lp:entertainer | ||||
To merge this branch: | bzr merge lp:~joshuascotton/entertainer/bug-281245 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer | Approve | ||
Entertainer Release Team | Pending | ||
Review via email: mp+1297@code.launchpad.net |
To post a comment you must log in.
=== modified file 'entertainerlib /frontend/ gui/screens/ main_screen. py' frontend/ gui/screens/ main_screen. py 2008-10-11 13:31:42 +0000 frontend/ gui/screens/ main_screen. py 2008-10-12 20:27:03 +0000 get_selected( ).get_name( )
self. group.remove( self.menu)
self. create_ main_menu( )
--- entertainerlib/
+++ entertainerlib/
@@ -254,9 +254,17 @@
Update screen widgets. This is called always when screen is poped from
the screen history. Updates main menu widget.
"""
+ selected_name = self.menu.
+
+ index = self.menu. index(selected_ name) select( index) preview_ area(self. menu.get_ selected( )) preview_ area(self, item):
menu_item = self.preview_ menu.get_ current_ menuitem( )
data = menu_item. get_userdata( )
self.ui. changeScreen( self.ui. createScreen( "entry" , data),
+ if not index == -1:
+ self.menu.
+
+ self.update_
+
def update_
"""
Update preview area. This area displayes information of currently
@@ -355,6 +363,6 @@
- Transition.FORWARD)
+ Transition.FORWARD)
=== modified file 'entertainerlib /frontend/ gui/widgets/ scroll_ menu.py' frontend/ gui/widgets/ scroll_ menu.py 2008-08-02 21:33:38 +0000 frontend/ gui/widgets/ scroll_ menu.py 2008-10-12 20:26:46 +0000
clutter. Group.add( self, actor)
--- entertainerlib/
+++ entertainerlib/
@@ -35,7 +35,7 @@
def add(self, actor):
"""
Add new menuitem to the menu.
- @param item: clutter.Actor
+ @param item: Label
"""
@@ -63,9 +63,36 @@ items.index( item) items[index- 2:] + self.__ items[0: index-2]
self. remove_ all() Group.remove( self, item)
"""
Remove all actors from the menu.
"""
+ del self.__items
+ self.__items = []
+
+ def index(self, text):
+ """
+ Returns index of label with the text as passed, returns -1 if not found
+ @author Joshua Scotton
+ """
+ for item in self.__items:
+ if item.get_name() == text:
+ return self.__
+ return -1
+
+ def select(self, index):
+ """
+ Selects the item at the passed index, does not support animations
+ @author Joshua Scotton
+ """
+ #split list so that item at the index will now be at position 2
+ #which is the selected index in a scroll menu
+ list = self.__
+
+ #Basically remove all then add in the correct order
- del self.__items
- self.__items = []
+ for item in list:
+ #Remove all doesn't remove the parent object. So in order to avoid
+ #adding two parent clutter items to the item we need to remove the
+ #old one first
+ clutter.
+ self.add(item)
# def set_selector(self, selector):
# """