r2641 - in trunk/src/target/OM-2007.2/applications/openmoko-feedreader2: . src
zecke at sita.openmoko.org
zecke at sita.openmoko.org
Sun Aug 5 23:44:39 CEST 2007
Author: zecke
Date: 2007-08-05 23:44:33 +0200 (Sun, 05 Aug 2007)
New Revision: 2641
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-data.c
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-selection-view.c
Log:
2007-08-05 Holger Hans Peter Freyther <zecke at selfish.org>
Implement category filtering (and made sure it compiles). Feature wise
it is 'enpar' with the old application again.
* src/feed-data.c:
(rss_filter_entries): Use FeedFilter::category for filtering categories
* src/feed-selection-view.c:
(category_combo_update): Fill the combobox with data
(category_selection_changed): Get the current text and pass it to the FeedFilter
(feed_selection_view_init): Create a ComboBox with the text model.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/ChangeLog 2007-08-05 21:21:18 UTC (rev 2640)
+++ trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/ChangeLog 2007-08-05 21:44:33 UTC (rev 2641)
@@ -1,5 +1,17 @@
2007-08-05 Holger Hans Peter Freyther <zecke at selfish.org>
+ Implement category filtering (and made sure it compiles). Feature wise
+ it is 'enpar' with the old application again.
+
+ * src/feed-data.c:
+ (rss_filter_entries): Use FeedFilter::category for filtering categories
+ * src/feed-selection-view.c:
+ (category_combo_update): Fill the combobox with data
+ (category_selection_changed): Get the current text and pass it to the FeedFilter
+ (feed_selection_view_init): Create a ComboBox with the text model.
+
+2007-08-05 Holger Hans Peter Freyther <zecke at selfish.org>
+
Implement filtering of feeds again. Switch the position
of Prev/Next and use the right stock items in feed_item_view_init.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-data.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-data.c 2007-08-05 21:21:18 UTC (rev 2640)
+++ trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-data.c 2007-08-05 21:44:33 UTC (rev 2641)
@@ -51,7 +51,7 @@
if (!category)
return FALSE;
- if (strcmp(category, data->filter_string) != 0)
+ if (strcmp(category, data->category) != 0)
return FALSE;
g_free (category);
Modified: trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-selection-view.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-selection-view.c 2007-08-05 21:21:18 UTC (rev 2640)
+++ trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-selection-view.c 2007-08-05 21:44:33 UTC (rev 2641)
@@ -26,6 +26,7 @@
#include "config.h"
#include "feed-selection-view.h"
+#include "feed-configuration.h"
#include <moko-finger-scroll.h>
#include <glib/gi18n.h>
@@ -108,29 +109,23 @@
while (valid) {
gchar *category;
gtk_tree_model_get (store, &iter, FEED_NAME, &category, -1);
-
- /*
- * create the new item(s)
- */
- add_mrss_item (data, rss_data, url, category);
-
- /*
- * now cache the feed, a bit inefficient as we do not write to a file directly
- */
- if (buffer) {
- moko_cache_write_object (data->cache, url, buffer, size, NULL);
- free (buffer);
- }
-
- mrss_free( rss_data );
-
-next:
- g_free (url);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (view->category_combo), category);
g_free (category);
valid = gtk_tree_model_iter_next (store, &iter);
}
+
+ /*
+ * Make All active
+ */
+ gtk_combo_box_set_active (GTK_COMBO_BOX (view->category_combo), 0);
}
+static void
+category_selection_changed (GtkComboBox* box, FeedSelectionView* view)
+{
+ feed_filter_filter_category (view->filter, gtk_combo_box_get_active_text (box));
+}
+
G_DEFINE_TYPE(FeedSelectionView, feed_selection_view, GTK_TYPE_VBOX)
static void
@@ -171,7 +166,7 @@
g_signal_connect (G_OBJECT (view->search_entry), "changed", G_CALLBACK (search_entry_changed), view);
g_object_set (G_OBJECT (view->search_entry), "no-show-all", TRUE, NULL);
- view->category_combo = GTK_WIDGET (gtk_combo_box_new ());
+ view->category_combo = GTK_WIDGET (gtk_combo_box_new_text ());
gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (view->category_combo), TRUE, TRUE, 0);
category_combo_update (view);
g_signal_connect (G_OBJECT (view->category_combo), "changed", G_CALLBACK(category_selection_changed), view);
More information about the commitlog
mailing list