Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

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 5:51:02pm UTC 

  1. diff --git a/lib/reinteract/main.py b/lib/reinteract/main.py
  2. index 599c210..53eef9a 100644
  3. --- a/lib/reinteract/main.py
  4. +++ b/lib/reinteract/main.py
  5. @@ -10,9 +10,18 @@ from shell_view import ShellView
  6.  
  7.  from format_escaped import format_escaped
  8.  
  9. +try:
  10. +    import hildon
  11. +    have_hildon = True
  12. +except ImportError, e:
  13. +    have_hildon = False
  14.  
  15.  notebook = Notebook()
  16. -w = gtk.Window()
  17. +
  18. +if have_hildon:
  19. +    w = hildon.Window()
  20. +else:
  21. +    w = gtk.Window()
  22.  
  23.  v = gtk.VBox()
  24.  w.add(v)
  25. @@ -174,7 +183,7 @@ action_group.add_actions([
  26.  
  27.  ui_manager.insert_action_group(action_group, 0)
  28.  
  29. -ui_manager.add_ui_from_string("""
  30. +ui_string="""
  31.  <ui>
  32.     <menubar name="MenuBar">
  33.        <menu action="file">
  34. @@ -199,12 +208,24 @@ ui_manager.add_ui_from_string("""
  35.        <toolitem action="calculate"/>
  36.     </toolbar>
  37.  </ui>
  38. -""")
  39. +"""
  40. +
  41. +if have_hildon:
  42. +    ui_string = ui_string.replace("menubar", "popup")
  43.  
  44. +ui_manager.add_ui_from_string(ui_string)
  45.  ui_manager.ensure_update()
  46.  
  47. -v.pack_start(ui_manager.get_widget("/MenuBar"), expand=False, fill=False)
  48. -v.pack_start(ui_manager.get_widget("/ToolBar"), expand=False, fill=False)
  49. +menu = ui_manager.get_widget("/MenuBar")
  50. +toolbar = ui_manager.get_widget("/ToolBar")
  51. +
  52. +if have_hildon:
  53. +    w.set_menu(menu)
  54. +    w.add_toolbar(toolbar)
  55. +    w.show_all()
  56. +else:
  57. +    v.pack_start(menu, expand=False, fill=False)
  58. +    v.pack_start(toolbar, expand=False, fill=False)
  59.  
  60.  sw = gtk.ScrolledWindow()
  61.  sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)

Paste Details

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



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.

comments powered by Disqus
worth-right
worth-right
worth-right