From 7eb30e19dfee43dc0e517be6629b5097b2c27fc4 Mon Sep 17 00:00:00 2001 From: Yves Date: Sat, 27 Feb 2010 10:55:03 -0800 Subject: [PATCH] early 0.5.0 --- debian/changelog | 3 ++- debian/control | 7 ++++--- src/FeedingIt.py | 14 +++++++------- src/config.py | 40 ++++++++++++++++++++++++++++++---------- src/portrait.py | 8 +++++--- src/rss.py | 10 ++++++---- 6 files changed, 54 insertions(+), 28 deletions(-) diff --git a/debian/changelog b/debian/changelog index 244941c..4f0634a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sun, 31 Jan 2010 10:43:19 -0800 diff --git a/debian/control b/debian/control index e85119c..25e062e 100644 --- a/debian/control +++ b/debian/control @@ -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 diff --git a/src/FeedingIt.py b/src/FeedingIt.py index 11cd448..1b3f415 100644 --- a/src/FeedingIt.py +++ b/src/FeedingIt.py @@ -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 diff --git a/src/config.py b/src/config.py index 5b92052..805a66f 100644 --- a/src/config.py +++ b/src/config.py @@ -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 diff --git a/src/portrait.py b/src/portrait.py index 8e30393..6782449 100644 --- a/src/portrait.py +++ b/src/portrait.py @@ -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 diff --git a/src/rss.py b/src/rss.py index 5083ce7..a75d248 100644 --- a/src/rss.py +++ b/src/rss.py @@ -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 = '''
''' - text = '' - text += '' + text = '' + text += "" + title + "" + text += '\n' + text += '' text += '
' + title + "" text += "
Date: " + date + "
" text += "

" text += content - text += "" + text += "" return text class ArchivedArticles(Feed): -- 1.7.9.5