Advertising
Paste Description for Reinteract Hildon Patch
Patch to adapt Reinteract UI to Hildon look and feel, used by Maemo platform.
http://www.fishsoup.net/software/reinteract/
- Reinteract Hildon Patch
- Sunday, November 11th, 2007 at 10:51:02am MST
- diff --git a/lib/reinteract/main.py b/lib/reinteract/main.py
- index 599c210..53eef9a 100644
- --- a/lib/reinteract/main.py
- +++ b/lib/reinteract/main.py
- @@ -10,9 +10,18 @@ from shell_view import ShellView
- from format_escaped import format_escaped
- +try:
- + import hildon
- + have_hildon = True
- +except ImportError, e:
- + have_hildon = False
- notebook = Notebook()
- -w = gtk.Window()
- +
- +if have_hildon:
- + w = hildon.Window()
- +else:
- + w = gtk.Window()
- v = gtk.VBox()
- w.add(v)
- @@ -174,7 +183,7 @@ action_group.add_actions([
- ui_manager.insert_action_group(action_group, 0)
- -ui_manager.add_ui_from_string("""
- +ui_string="""
- <ui>
- <menubar name="MenuBar">
- <menu action="file">
- @@ -199,12 +208,24 @@ ui_manager.add_ui_from_string("""
- <toolitem action="calculate"/>
- </toolbar>
- </ui>
- -""")
- +"""
- +
- +if have_hildon:
- + ui_string = ui_string.replace("menubar", "popup")
- +ui_manager.add_ui_from_string(ui_string)
- ui_manager.ensure_update()
- -v.pack_start(ui_manager.get_widget("/MenuBar"), expand=False, fill=False)
- -v.pack_start(ui_manager.get_widget("/ToolBar"), expand=False, fill=False)
- +menu = ui_manager.get_widget("/MenuBar")
- +toolbar = ui_manager.get_widget("/ToolBar")
- +
- +if have_hildon:
- + w.set_menu(menu)
- + w.add_toolbar(toolbar)
- + w.show_all()
- +else:
- + v.pack_start(menu, expand=False, fill=False)
- + v.pack_start(toolbar, expand=False, fill=False)
- sw = gtk.ScrolledWindow()
- sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
Paste Details
Tags: maemo hildon reinteract
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.