Bump to 0.3.3 and adding basic rotation support
authorEd Page <eopage@byu.net>
Wed, 24 Mar 2010 00:50:51 +0000 (19:50 -0500)
committerEd Page <eopage@byu.net>
Wed, 24 Mar 2010 00:50:51 +0000 (19:50 -0500)
src/constants.py
src/hildonize.py
src/libbottombar.py
src/libselection.py
src/libview.py
src/multilist_gtk.py
support/builddeb.py
www/multilist.deb

index 10d7075..16df9cb 100644 (file)
@@ -2,8 +2,8 @@ import os
 
 __pretty_app_name__ = "Multilist"
 __app_name__ = "multilist"
-__version__ = "0.3.2"
-__build__ = 1
+__version__ = "0.3.3"
+__build__ = 0
 _data_path_ = os.path.join(os.path.expanduser("~"), ".multilist")
 __app_magic__ = 0xdeadbeef
 _user_logpath_ = "%s/multilist.log" % _data_path_
index 09ee705..77d585a 100755 (executable)
@@ -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
index 5160886..9ea4623 100644 (file)
@@ -61,6 +61,14 @@ class Bottombar(gtk.VBox):
                button.connect("clicked", self.del_item, None)
                buttonHBox.pack_start(button, expand = True, fill = True, padding = 3)
 
+       def set_orientation(self, orientation):
+               if orientation == gtk.ORIENTATION_HORIZONTAL:
+                       pass
+               elif orientation == gtk.ORIENTATION_VERTICAL:
+                       pass
+               else:
+                       raise NotImplementedError(orientation)
+
        @gtk_toolbox.log_exception(_moduleLogger)
        def new_item(self, widget = None, data1 = None, data2 = None):
                window = gtk_toolbox.find_parent_window(self)
index f80f80c..b846f68 100644 (file)
@@ -53,22 +53,32 @@ class Selection(gtk.HBox):
 
                _moduleLogger.info("libSelection, init")
 
-               label = gtk.Label(_("List:"))
-               self.pack_start(label, expand = False, fill = True, padding = 0)
+               self.__listLabel = gtk.Label(_("List:"))
+               self.pack_start(self.__listLabel, expand = False, fill = True, padding = 0)
 
                self.__lists = []
                self.__listButton = gtk.Button("")
                self.__listButton.connect("clicked", self._on_list_selector)
                self.pack_start(self.__listButton, expand = True, fill = True, padding = 0)
 
-               label = gtk.Label(_("  Category:"))
-               self.pack_start(label, expand = False, fill = True, padding = 0)
+               self.__catLabel = gtk.Label(_("  Category:"))
+               self.pack_start(self.__catLabel, expand = False, fill = True, padding = 0)
 
                self.__categories = []
                self.__categoryButton = gtk.Button("")
                self.__categoryButton.connect("clicked", self._on_category_selector)
                self.pack_start(self.__categoryButton, expand = True, fill = True, padding = 0)
 
+       def set_orientation(self, orientation):
+               if orientation == gtk.ORIENTATION_HORIZONTAL:
+                       self.__listLabel.show()
+                       self.__catLabel.show()
+               elif orientation == gtk.ORIENTATION_VERTICAL:
+                       self.__listLabel.hide()
+                       self.__catLabel.hide()
+               else:
+                       raise NotImplementedError(orientation)
+
        def load(self):
                del self.__lists[:]
 
index afd5bc4..6bc827a 100644 (file)
@@ -56,7 +56,7 @@ class TripleToggleCellRenderer(gtk.CellRendererToggle):
 
        @gtk_toolbox.log_exception(_moduleLogger)
        def do_set_property(self, property, value):
-               if getattr(self, property.name) == value:
+               if getattr(self, property.name) == value or value is None:
                        return
 
                setattr(self, property.name, value)
index 5b8b2e7..de4fe88 100755 (executable)
@@ -81,6 +81,7 @@ class Multilist(hildonize.get_app_class()):
 
                self.db = libspeichern.Speichern()
                self.window_in_fullscreen = False #The window isn't in full screen mode initially.
+               self.__isLandscape = True
 
                #Haupt vbox für alle Elemente
                self.window = gtk.Window()
@@ -256,6 +257,29 @@ class Multilist(hildonize.get_app_class()):
                else:
                        self._search.show()
 
+       def set_orientation(self, orientation):
+               if orientation == gtk.ORIENTATION_VERTICAL:
+                       hildonize.window_to_portrait(self.window)
+                       self.bottombar.set_orientation(gtk.ORIENTATION_VERTICAL)
+                       self.selection.set_orientation(gtk.ORIENTATION_VERTICAL)
+                       self.__isLandscape = False
+               elif orientation == gtk.ORIENTATION_HORIZONTAL:
+                       hildonize.window_to_landscape(self.window)
+                       self.bottombar.set_orientation(gtk.ORIENTATION_HORIZONTAL)
+                       self.selection.set_orientation(gtk.ORIENTATION_HORIZONTAL)
+                       self.__isLandscape = True
+               else:
+                       raise NotImplementedError(orientation)
+
+       def get_orientation(self):
+               return gtk.ORIENTATION_HORIZONTAL if self.__isLandscape else gtk.ORIENTATION_VERTICAL
+
+       def _toggle_rotate(self):
+               if self.__isLandscape:
+                       self.set_orientation(gtk.ORIENTATION_VERTICAL)
+               else:
+                       self.set_orientation(gtk.ORIENTATION_HORIZONTAL)
+
        @gtk_toolbox.log_exception(_moduleLogger)
        def _on_checkout_all(self, widget):
                self.liststorehandler.checkout_rows()
@@ -295,6 +319,9 @@ class Multilist(hildonize.get_app_class()):
                        else:
                                self.window.fullscreen ()
                        return True
+               elif event.keyval == gtk.keysyms.r and isCtrl:
+                       self._toggle_rotate()
+                       return True
                elif event.keyval == gtk.keysyms.f and isCtrl:
                        self._toggle_search()
                        return True
index 292b2d6..52ced29 100755 (executable)
@@ -21,6 +21,9 @@ __email__ = "n800@axique.net"
 __version__ = constants.__version__
 __build__ = constants.__build__
 __changelog__ = """
+0.3.3
+* Rotation support
+
 0.3.2
 * Massive code cleanup
 * Re-arrangement of GTK Menus
index ef4abe9..ff4776c 100644 (file)
Binary files a/www/multilist.deb and b/www/multilist.deb differ