X-Git-Url: http://git.maemo.org/git/?p=gonvert;a=blobdiff_plain;f=src%2Fhildonize.py;h=339eb2a6f11bea01ae804497ab6c921ab0e6dc9c;hp=09ee705d9115b013c0f4ee69d4421506e6d33a24;hb=1e2010632954ab734663bbc674b621b33c1d4374;hpb=2a6f89aed9a24d02d7dd0e112dc815dbe64ab433 diff --git a/src/hildonize.py b/src/hildonize.py index 09ee705..339eb2a 100755 --- a/src/hildonize.py +++ b/src/hildonize.py @@ -47,24 +47,26 @@ except AttributeError: get_app_class = _null_get_app_class -def _hildon_set_application_title(window, title): - pass +def _hildon_set_application_name(name): + gtk.set_application_name(name) -def _null_set_application_title(window, title): - window.set_title(title) +def _null_set_application_name(name): + pass -if IS_HILDON_SUPPORTED: - set_application_title = _hildon_set_application_title -else: - set_application_title = _null_set_application_title +try: + gtk.set_application_name + set_application_name = _hildon_set_application_name +except AttributeError: + set_application_name = _null_set_application_name def _fremantle_hildonize_window(app, window): oldWindow = window newWindow = hildon.StackableWindow() - oldWindow.get_child().reparent(newWindow) + if oldWindow.get_child() is not None: + oldWindow.get_child().reparent(newWindow) app.add_window(newWindow) return newWindow @@ -72,7 +74,8 @@ def _fremantle_hildonize_window(app, window): def _hildon_hildonize_window(app, window): oldWindow = window newWindow = hildon.Window() - oldWindow.get_child().reparent(newWindow) + if oldWindow.get_child() is not None: + oldWindow.get_child().reparent(newWindow) app.add_window(newWindow) return newWindow @@ -277,30 +280,16 @@ else: hildonize_text_entry = _null_hildonize_text_entry -def _hildon_mark_window_rotatable(window): - # gtk documentation is unclear whether this does a "=" or a "|=" - window.set_flags(hildon.HILDON_PORTRAIT_MODE_SUPPORT) - - -def _null_mark_window_rotatable(window): - pass - - -try: - hildon.HILDON_PORTRAIT_MODE_SUPPORT - mark_window_rotatable = _hildon_mark_window_rotatable -except AttributeError: - mark_window_rotatable = _null_mark_window_rotatable - - def _hildon_window_to_portrait(window): # gtk documentation is unclear whether this does a "=" or a "|=" - window.set_flags(hildon.HILDON_PORTRAIT_MODE_SUPPORT) + flags = hildon.PORTRAIT_MODE_SUPPORT | hildon.PORTRAIT_MODE_REQUEST + hildon.hildon_gtk_window_set_portrait_flags(window, flags) def _hildon_window_to_landscape(window): # gtk documentation is unclear whether this does a "=" or a "&= ~" - window.unset_flags(hildon.HILDON_PORTRAIT_MODE_REQUEST) + flags = hildon.PORTRAIT_MODE_SUPPORT + hildon.hildon_gtk_window_set_portrait_flags(window, flags) def _null_window_to_portrait(window): @@ -312,8 +301,9 @@ def _null_window_to_landscape(window): try: - hildon.HILDON_PORTRAIT_MODE_SUPPORT - hildon.HILDON_PORTRAIT_MODE_REQUEST + hildon.PORTRAIT_MODE_SUPPORT + hildon.PORTRAIT_MODE_REQUEST + hildon.hildon_gtk_window_set_portrait_flags window_to_portrait = _hildon_window_to_portrait window_to_landscape = _hildon_window_to_landscape @@ -369,6 +359,28 @@ else: hildonize_combo_entry = _null_hildonize_combo_entry +def _null_create_seekbar(): + adjustment = gtk.Adjustment(0, 0, 101, 1, 5, 1) + seek = gtk.HScale(adjustment) + seek.set_draw_value(False) + return seek + + +def _fremantle_create_seekbar(): + seek = hildon.Seekbar() + seek.set_range(0.0, 100) + seek.set_draw_value(False) + seek.set_update_policy(gtk.UPDATE_DISCONTINUOUS) + return seek + + +try: + hildon.Seekbar + create_seekbar = _fremantle_create_seekbar +except AttributeError: + create_seekbar = _null_create_seekbar + + def _fremantle_hildonize_scrollwindow(scrolledWindow): pannableWindow = hildon.PannableArea()