From e4f7764f4ef7e2615608b95e4537656eafb9bab0 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Sat, 3 Apr 2010 00:16:19 -0500 Subject: [PATCH] Fixing minor bugs --- src/hildonize.py | 27 +++++++-------------------- src/quicknote_gtk.py | 6 +++--- 2 files changed, 10 insertions(+), 23 deletions(-) mode change 100644 => 100755 src/quicknote_gtk.py diff --git a/src/hildonize.py b/src/hildonize.py index 09ee705..77d585a 100755 --- a/src/hildonize.py +++ b/src/hildonize.py @@ -277,30 +277,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 +298,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 diff --git a/src/quicknote_gtk.py b/src/quicknote_gtk.py old mode 100644 new mode 100755 index 92482fa..7656808 --- a/src/quicknote_gtk.py +++ b/src/quicknote_gtk.py @@ -240,12 +240,11 @@ class QuicknoteProgram(hildonize.get_app_class()): self._wordWrapEnabled = config.getboolean(constants.__pretty_app_name__, "wordwrap") self._window_in_fullscreen = config.getboolean(constants.__pretty_app_name__, "fullscreen") except ConfigParser.NoSectionError, e: - warnings.warn( + _moduleLogger.infp( "Settings file %s is missing section %s" % ( self._user_settings, e.section, - ), - stacklevel=2 + ) ) self._notizen.set_wordwrap(self._wordWrapEnabled) @@ -326,6 +325,7 @@ class QuicknoteProgram(hildonize.get_app_class()): self._clipboard.set_text(str(log)) return True + @gtk_toolbox.log_exception(_moduleLogger) def _on_toggle_search(self, *args): self._toggle_search() -- 1.7.9.5