changeset 79:d11c3f71ac40

Make update interval editable via the feed's settings dialog.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sat, 14 Aug 2010 03:11:15 +0200
parents a728bbc7171e
children faca24809ffd
files FeedSettings.py Mapping.py Ui_FeedSettings.ui
diffstat 3 files changed, 66 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/FeedSettings.py	Sat Aug 14 02:54:01 2010 +0200
+++ b/FeedSettings.py	Sat Aug 14 03:11:15 2010 +0200
@@ -13,12 +13,18 @@
         
     def initUi(self):
         self.ui.feedTitle.setText(self.feed.title)
+        self.ui.updateInterval.setText(str(self.feed.update_interval))
         self.ui.autoLoadArticle.setChecked(self.feed.auto_load_entry_link)
         self.ui.alwaysOpenInBrowser.setChecked(self.feed.always_open_in_browser)
 
     def editingTitleFinished(self):
         title = str(self.ui.feedTitle.text())
         self.feed.title = title
+        
+    def editingUpdateIntervalFinished(self):
+        updateInterval = int(str(self.ui.updateInterval.text()))
+        self.feed.update_interval = updateInterval
+        self.feed.incrementNextUpdateDate()
 
     def autoLoadArticleChanged(self, change):
         if change:
--- a/Mapping.py	Sat Aug 14 02:54:01 2010 +0200
+++ b/Mapping.py	Sat Aug 14 03:11:15 2010 +0200
@@ -33,6 +33,7 @@
         Column("pk", Integer, primary_key=True),
         Column("title", String(255), nullable=False),
         Column("rss_url", String(255), nullable=False),
+        # update interval is specified in minutes
         Column("update_interval", Integer, nullable=False),
         Column("next_update", DateTime, nullable=False),
         # when displaying an entry of this feed, do not display the summary but rather load 
--- a/Ui_FeedSettings.ui	Sat Aug 14 02:54:01 2010 +0200
+++ b/Ui_FeedSettings.ui	Sat Aug 14 03:11:15 2010 +0200
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>400</width>
-    <height>140</height>
+    <height>178</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -21,7 +21,7 @@
    <property name="geometry">
     <rect>
      <x>20</x>
-     <y>100</y>
+     <y>135</y>
      <width>341</width>
      <height>32</height>
     </rect>
@@ -37,7 +37,7 @@
    <property name="geometry">
     <rect>
      <x>10</x>
-     <y>40</y>
+     <y>80</y>
      <width>331</width>
      <height>22</height>
     </rect>
@@ -59,8 +59,8 @@
   <widget class="QLabel" name="label">
    <property name="geometry">
     <rect>
-     <x>11</x>
-     <y>11</y>
+     <x>10</x>
+     <y>14</y>
      <width>26</width>
      <height>17</height>
     </rect>
@@ -73,7 +73,7 @@
    <property name="geometry">
     <rect>
      <x>10</x>
-     <y>70</y>
+     <y>105</y>
      <width>371</width>
      <height>22</height>
     </rect>
@@ -82,6 +82,42 @@
     <string>when loading article's url, always use external browser</string>
    </property>
   </widget>
+  <widget class="QLabel" name="label_2">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>50</y>
+     <width>91</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Update every</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="updateInterval">
+   <property name="geometry">
+    <rect>
+     <x>105</x>
+     <y>45</y>
+     <width>46</width>
+     <height>23</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_3">
+   <property name="geometry">
+    <rect>
+     <x>160</x>
+     <y>50</y>
+     <width>61</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>minutes</string>
+   </property>
+  </widget>
  </widget>
  <resources>
   <include location="Feedworm.qrc"/>
@@ -167,10 +203,27 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>updateInterval</sender>
+   <signal>editingFinished()</signal>
+   <receiver>FeedSettings</receiver>
+   <slot>editingUpdateIntervalFinished()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>127</x>
+     <y>56</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>199</x>
+     <y>88</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>autoLoadArticleChanged()</slot>
   <slot>editingTitleFinished()</slot>
   <slot>alwaysOpenInExternalBrowser()</slot>
+  <slot>editingUpdateIntervalFinished()</slot>
  </slots>
 </ui>