early 0.5.0
authorYves <ymarcoz@n900-sdk.(none)>
Sat, 27 Feb 2010 18:55:03 +0000 (10:55 -0800)
committerYves <ymarcoz@n900-sdk.(none)>
Sat, 27 Feb 2010 18:55:03 +0000 (10:55 -0800)
debian/changelog
debian/control
src/FeedingIt.py
src/config.py
src/portrait.py
src/rss.py

index 244941c..4f0634a 100644 (file)
@@ -1,9 +1,10 @@
-feedingit (0.4.5-1) unstable; urgency=low
+feedingit (0.4.5-3) unstable; urgency=low
 
   * Fixed utf-8 support
   * Fixed dbus add feed dialog
   * Re-added single feed update
   * Open in external browser now uses load_url dbus call
+  * Disabled rotation if keyboard is open
   
  -- Yves <yves@marcoz.org>  Sun, 31 Jan 2010 10:43:19 -0800
 
index e85119c..25e062e 100644 (file)
@@ -9,9 +9,10 @@ XSBC-Bugtracker: https://garage.maemo.org/tracker/?func=browse&group_id=1202&ati
 
 Package: feedingit
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, python-gtkhtml2, python, python-hildon, libgtkhtml2-0, python-dbus, python-osso
-Description: Simple RSS Reader
- Simple RSS Reader
+Depends: ${shlibs:Depends}, ${misc:Depends}, python-gtkhtml2, python, python-hildon,
+ libgtkhtml2-0, python-dbus, python-osso, python-gconf
+Description:
+ RSS Reader
  Its main features are:
  - Portrait mode support
  - Auto-update
index 11cd448..1b3f415 100644 (file)
@@ -19,7 +19,7 @@
 # ============================================================================
 # Name        : FeedingIt.py
 # Author      : Yves Marcoz
-# Version     : 0.4.3
+# Version     : 0.5.0
 # Description : Simple RSS Reader
 # ============================================================================
 
@@ -179,7 +179,7 @@ class DownloadBar(gtk.ProgressBar):
             #self.progress = gtk.ProgressBar()
             #self.waitingWindow = hildon.Note("cancel", parent, "Downloading",
             #                     progressbar=self.progress)
-            self.set_text("Downloading")
+            self.set_text("Updating...")
             self.fraction = 0
             self.set_fraction(self.fraction)
             self.show_all()
@@ -375,7 +375,7 @@ class DisplayArticle(hildon.StackableWindow):
         self.images = []
         
         # Init the article display
-        if has_webkit:
+        if self.config.getWebkitSupport():
             self.view = webkit.WebView()
             #self.view.set_editable(False)
         else:
@@ -388,7 +388,7 @@ class DisplayArticle(hildon.StackableWindow):
         #self.pannable_article.set_property("mov-mode", hildon.MOVEMENT_MODE_BOTH)
         #self.gestureId = self.pannable_article.connect('horizontal-movement', self.gesture)
 
-        if has_webkit:
+        if self.config.getWebkitSupport():
             self.view.load_string(self.text, "text/html", "utf-8", self.link)
             self.view.set_zoom_level(float(config.getArtFontSize())/10.)
         else:
@@ -665,15 +665,15 @@ class FeedingIt:
         self.mainVbox.pack_start(self.pannableListing)
         self.window.add(self.mainVbox)
         self.window.show_all()
-        self.config = Config(self.window, CONFIGDIR+"config.ini")
+        self.config = Config(self.window, CONFIGDIR+"config.ini", has_webkit)
         gobject.idle_add(self.createWindow)
         
     def createWindow(self):
         self.listing = Listing(CONFIGDIR)
         
         self.downloadDialog = False
-        #self.orientation = FremantleRotation("FeedingIt", main_window=self.window)
-        #self.orientation.set_mode(self.config.getOrientation())
+        self.orientation = FremantleRotation("FeedingIt", main_window=self.window)
+        self.orientation.set_mode(self.config.getOrientation())
         
         menu = hildon.AppMenu()
         # Create a button and add it to the menu
index 5b92052..805a66f 100644 (file)
@@ -34,9 +34,10 @@ titles = {"updateInterval":"Auto-update Interval", "expiry":"Expiry For Articles
 subtitles = {"updateInterval":"Update every %s hours", "expiry":"Delete articles after %s hours", "fontSize":"%s pixels", "orientation":"%s", "artFontSize":"%s pixels"}
 
 class Config():
-    def __init__(self, parent, configFilename):
+    def __init__(self, parent, configFilename, has_webkit):
         self.configFilename = configFilename
         self.parent = parent
+        self.has_webkit = has_webkit
         # Load config
         self.loadConfig()
         
@@ -48,7 +49,11 @@ class Config():
         
         vbox = gtk.VBox(False, 10)
         self.buttons = {}
-        for setting in ["fontSize", "artFontSize", "expiry", "orientation", "updateInterval",]:
+        if self.has_webkit:
+            settings = ["fontSize", "artFontSize", "expiry", "orientation", "updateInterval",]
+        else:
+            settings = ["fontSize", "expiry", "orientation", "updateInterval",]
+        for setting in settings:
             picker = hildon.PickerButton(gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_VERTICAL)
             selector = self.create_selector(ranges[setting], setting)
             picker.set_selector(selector)
@@ -62,9 +67,16 @@ class Config():
         button = hildon.CheckButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
         button.set_label("Auto-update Enabled")
         button.set_active(self.config["autoupdate"])
-        button.connect("toggled", self.button_toggled)
-        
+        button.connect("toggled", self.button_toggled, "autoupdate")
         vbox.pack_start(button)
+
+        if self.has_webkit:
+            button = hildon.CheckButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
+            button.set_label("Webkit Articles Enabled")
+            button.set_active(self.config["webkit"])
+            button.connect("toggled", self.button_toggled, "webkit")
+            vbox.pack_start(button)
+        
         panArea.add_with_viewport(vbox)
         
         self.window.vbox.add(panArea)        
@@ -77,12 +89,12 @@ class Config():
         self.saveConfig()
         self.window.destroy()
 
-    def button_toggled(self, widget):
+    def button_toggled(self, widget, configName):
         #print "widget", widget.get_active()
         if (widget.get_active()):
-            self.config["autoupdate"] = True
+            self.config[configName] = True
         else:
-            self.config["autoupdate"] = False
+            self.config[configName] = False
         #print "autoup",  self.autoupdate
         self.saveConfig()
         
@@ -107,13 +119,15 @@ class Config():
             self.config["autoupdate"] = configParser.getboolean(section, "autoupdate")
             self.config["updateInterval"] = configParser.getfloat(section, "updateInterval")
             self.config["orientation"] = configParser.get(section, "orientation")
+            self.config["webkit"] = configParser.getboolean(section, "webkit")
         except:
-            self.config["fontSize"] = 16
-            self.config["artFontSize"] = 18
+            self.config["fontSize"] = 17
+            self.config["artFontSize"] = 14
             self.config["expiry"] = 24
             self.config["autoupdate"] = False
             self.config["updateInterval"] = 4
             self.config["orientation"] = "Automatic"
+            self.config["webkit"] = self.has_webkit
         
     def saveConfig(self):
         configParser = ConfigParser.RawConfigParser()
@@ -124,6 +138,7 @@ class Config():
         configParser.set(section, 'autoupdate', str(self.config["autoupdate"]))
         configParser.set(section, 'updateInterval', str(self.config["updateInterval"]))
         configParser.set(section, 'orientation', str(self.config["orientation"]))
+        configParser.set(section, 'webkit', str(self.config["webkit"]))
 
         # Writing our configuration file
         file = open(self.configFilename, 'wb')
@@ -159,4 +174,9 @@ class Config():
     def getUnreadFont(self):
         return "sans bold %s" % self.config["fontSize"]
     def getOrientation(self):
-        return ranges["orientation"].index(self.config["orientation"])
\ No newline at end of file
+        return ranges["orientation"].index(self.config["orientation"])
+    def getWebkitSupport(self):
+        if self.has_webkit:
+            return self.config["webkit"]
+        else:
+            return False
\ No newline at end of file
index 8e30393..6782449 100644 (file)
@@ -23,6 +23,8 @@ import dbus.glib
 import hildon
 import osso
 
+import gconf
+
 
 class FremantleRotation(object):
     """thp's screen rotation for Maemo 5
@@ -169,10 +171,10 @@ class FremantleRotation(object):
 
         self._orientation = orientation
 
-    def _on_orientation_signal(self, orientation, stand, face, x, y, z):
+    def _on_orientation_signal(self, orientation, stand, face, x, y, z):            
         if orientation in (self._PORTRAIT, self._LANDSCAPE):
-            if self._mode == self.AUTOMATIC:
-                # Automatically set the rotation based on hardware orientation
+            if (self._mode == self.AUTOMATIC) and (not gconf.client_get_default().get_bool('/system/osso/af/slide-open')):
+                # Automatically set the rotation based on hardware orientation, if the keyboard is not open
                 self._orientation_changed(orientation)
             else:
                 # Ignore orientation changes for non-automatic modes, but save
index 5083ce7..a75d248 100644 (file)
@@ -19,7 +19,7 @@
 # ============================================================================
 # Name        : FeedingIt.py
 # Author      : Yves Marcoz
-# Version     : 0.4.3
+# Version     : 0.5.0
 # Description : Simple RSS Reader
 # ============================================================================
 
@@ -174,13 +174,15 @@ class Feed:
         else:
             date = ""
         #text = '''<div style="color: black; background-color: white;">'''
-        text = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>'
-        text += '<head><style> body {-webkit-user-select: none;} </style></head>'
+        text = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
+        text += "<html><head><title>" + title + "</title>"
+        text += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\n'
+        text += '<style> body {-webkit-user-select: none;} </style></head>'
         text += '<body><div><a href=\"' + link + '\">' + title + "</a>"
         text += "<BR /><small><i>Date: " + date + "</i></small></div>"
         text += "<BR /><BR />"
         text += content
-        text += "</body>"
+        text += "</body></html>"
         return text
 
 class ArchivedArticles(Feed):