Changeset 2656
- Timestamp:
- 08/06/07 23:06:12 (6 years ago)
- Location:
- trunk/src/target/OM-2007.2/applications/openmoko-feedreader2
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
src/application-data.h (modified) (2 diffs)
-
src/feed-selection-view.c (modified) (1 diff)
-
src/feed-selection-view.h (modified) (1 diff)
-
src/main.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/ChangeLog
r2655 r2656 1 2007-08-06 Holger Hans Peter Freyther <zecke@selfish.org> 2 3 Implement going forward and backward in the selection view. We have to 4 remember the FeedSelectionView in the ApplicationData to be able to connect the 5 next/previous signal of FeedItemView. 6 Is g_signal_connect_swapped considered evil? And is it normal that the code is different 7 to get the next/previous item in a GtkListStore? 8 9 * src/application-data.h: 10 * src/feed-selection-view.c: 11 (feed_selection_view_next_item): 12 (feed_selection_view_prev_item): 13 * src/feed-selection-view.h: 14 * src/main.c: 15 (create_feed_view): 16 (create_text_view): 17 1 18 2007-08-06 Holger Hans Peter Freyther <zecke@selfish.org> 2 19 -
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/application-data.h
r2635 r2656 30 30 #include "moko_cache.h" 31 31 #include "feed-item-view.h" 32 #include "feed-selection-view.h" 32 33 33 34 struct ApplicationData { … … 36 37 GtkNotebook *notebook; 37 38 FeedItemView *view; 39 FeedSelectionView *selection_view; 38 40 }; 39 41 -
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-selection-view.c
r2655 r2656 245 245 } 246 246 247 247 void 248 feed_selection_view_next_item (const FeedSelectionView* view) 249 { 250 GtkTreeSelection* selection = gtk_tree_view_get_selection (view->view); 251 GtkTreeIter iter; 252 GtkTreeModel* model; 253 gboolean has_selection = gtk_tree_selection_get_selected (selection, &model, &iter); 254 255 if (has_selection && gtk_tree_model_iter_next (model, &iter)) 256 gtk_tree_selection_select_iter (selection, &iter); 257 } 258 259 void 260 feed_selection_view_prev_item (const FeedSelectionView* view) 261 { 262 GtkTreeSelection* selection = gtk_tree_view_get_selection (view->view); 263 GtkTreeIter iter; 264 GtkTreeModel* model; 265 gboolean has_selection = gtk_tree_selection_get_selected (selection, &model, &iter); 266 267 if (has_selection) { 268 GtkTreePath* path = gtk_tree_model_get_path (model, &iter); 269 if (gtk_tree_path_prev (path)) 270 gtk_tree_selection_select_path (selection, path); 271 gtk_tree_path_free (path); 272 } 273 } -
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-selection-view.h
r2640 r2656 68 68 gchar* feed_selection_view_get_search_string (const FeedSelectionView*); 69 69 70 void feed_selection_view_next_item (const FeedSelectionView*); 71 void feed_selection_view_prev_item (const FeedSelectionView*); 72 70 73 G_END_DECLS 71 74 -
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/main.c
r2655 r2656 70 70 71 71 g_signal_connect (G_OBJECT(box), "item-changed", G_CALLBACK(feed_selection_changed), data); 72 73 data->selection_view = RSS_FEED_SELECTION_VIEW (box); 72 74 } 73 75 … … 81 83 gtk_notebook_append_page (data->notebook, GTK_WIDGET(data->view), gtk_image_new_from_stock (GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_LARGE_TOOLBAR)); 82 84 gtk_container_child_set (GTK_CONTAINER(data->notebook), GTK_WIDGET(data->view), "tab-expand", TRUE, "tab-fill", TRUE, NULL); 85 86 g_signal_connect_swapped (G_OBJECT (data->view), "next", G_CALLBACK(feed_selection_view_next_item), data->selection_view); 87 g_signal_connect_swapped (G_OBJECT (data->view), "previous", G_CALLBACK(feed_selection_view_prev_item), data->selection_view); 83 88 } 84 89
Note: See TracChangeset
for help on using the changeset viewer.
