[evolution-rss] add icon in feed properties



commit 90206b40d82775630861694452a413e0e7199cd0
Author: Lucian Langa <lucilanga gnome org>
Date:   Wed Jun 3 21:31:34 2009 +0300

    add icon in feed properties
---
 TODO                     |    1 +
 src/rss-config-factory.c |   40 +++++++++++++++++----------------
 src/rss-ui.glade         |   55 ++++++++++++++++++++++++++++++++++++++-------
 3 files changed, 68 insertions(+), 28 deletions(-)

diff --git a/TODO b/TODO
index aa576ec..e042fb6 100644
--- a/TODO
+++ b/TODO
@@ -60,3 +60,4 @@
 	* wrong send and receive count of articles after import
 	* handle 404 for images in comments
 	* gtkhtml does not handle script properly
+	* gtkhtml does not handle &#xD; construct
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index 7592bdb..e70a7e3 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -55,6 +55,7 @@ extern guint count;
 extern gchar *buffer;
 extern GSList *rss_list;
 extern GConfClient *rss_gconf;
+extern GHashTable *icons;
 
 #define RSS_CONTROL_ID  "OAFIID:GNOME_Evolution_RSS:" EVOLUTION_VERSION_STRING
 #define FACTORY_ID      "OAFIID:GNOME_Evolution_RSS_Factory:" EVOLUTION_VERSION_STRING
@@ -338,6 +339,8 @@ build_dialog_add(gchar *url, gchar *feed_text)
   	gboolean fhtml = FALSE;
   	gboolean del_unread = FALSE;
   	guint del_feed = 0;
+	gchar *iconfile = NULL, *deffile = NULL;
+	GdkPixbuf *folder_icon = NULL;
 	GtkAccelGroup *accel_group = gtk_accel_group_new ();
 
         gladefile = g_build_filename (EVOLUTION_GLADEDIR,
@@ -361,36 +364,28 @@ build_dialog_add(gchar *url, gchar *feed_text)
 
         GtkWidget *entry1 = (GtkWidget *)glade_xml_get_widget (gui, "url_entry");
   	//editing
+  	gpointer key = lookup_key(feed_text);
   	if (url != NULL) {
 		gtk_expander_set_expanded(GTK_EXPANDER(adv_options), TRUE);	
   		gtk_entry_set_text(GTK_ENTRY(entry1), url);
 		fhtml = GPOINTER_TO_INT(
-  	              	g_hash_table_lookup(rf->hrh,
-       	                         lookup_key(feed_text)));
+  	              	g_hash_table_lookup(rf->hrh, key));
        	 	feed->enabled = GPOINTER_TO_INT(
-       	         	g_hash_table_lookup(rf->hre,
-                                lookup_key(feed_text)));
+       	         	g_hash_table_lookup(rf->hre, key));
         	del_feed = GPOINTER_TO_INT(
-                	g_hash_table_lookup(rf->hrdel_feed,
-                                lookup_key(feed_text)));
+                	g_hash_table_lookup(rf->hrdel_feed, key));
         	del_unread = GPOINTER_TO_INT(
-                	g_hash_table_lookup(rf->hrdel_unread,
-                                lookup_key(feed_text)));
+                	g_hash_table_lookup(rf->hrdel_unread, key));
         	feed->del_days = GPOINTER_TO_INT(
-                	g_hash_table_lookup(rf->hrdel_days,
-                                lookup_key(feed_text)));
+                	g_hash_table_lookup(rf->hrdel_days, key));
         	feed->del_messages = GPOINTER_TO_INT(
-                	g_hash_table_lookup(rf->hrdel_messages,
-                                lookup_key(feed_text)));
+                	g_hash_table_lookup(rf->hrdel_messages, key));
         	feed->update = GPOINTER_TO_INT(
-                	g_hash_table_lookup(rf->hrupdate,
-                                lookup_key(feed_text)));
+                	g_hash_table_lookup(rf->hrupdate, key));
         	feed->ttl = GPOINTER_TO_INT(
-                	g_hash_table_lookup(rf->hrttl,
-                                lookup_key(feed_text)));
+                	g_hash_table_lookup(rf->hrttl, key));
         	feed->ttl_multiply = GPOINTER_TO_INT(
-                	g_hash_table_lookup(rf->hrttl_multiply,
-                                lookup_key(feed_text)));
+                	g_hash_table_lookup(rf->hrttl_multiply, key));
   	}
   	feed->validate = 1;
 
@@ -430,8 +425,15 @@ build_dialog_add(gchar *url, gchar *feed_text)
 	GtkWidget *radiobutton5 = (GtkWidget *)glade_xml_get_widget (gui, "ttl");
 	GtkWidget *radiobutton6 = (GtkWidget *)glade_xml_get_widget (gui, "ttl_disabled");
 	GtkWidget *ttl_value = (GtkWidget *)glade_xml_get_widget (gui, "ttl_value");
+        GtkWidget *folder_box = (GtkWidget *)glade_xml_get_widget (gui, "folder_box");
+        GtkWidget *image = (GtkWidget *)glade_xml_get_widget (gui, "image1");
 	gtk_spin_button_set_range((GtkSpinButton *)ttl_value, 0, (guint)MAX_TTL);
 
+	/*set feed icon*/
+	gtk_image_set_from_icon_name(image, 
+			g_hash_table_lookup(icons, key) ? key : "evolution-rss-main",
+			GTK_ICON_SIZE_LARGE_TOOLBAR);
+
   	switch (del_feed) {
         case 1:         //all but the last
                 gtk_toggle_button_set_active(
@@ -538,7 +540,7 @@ actions_dialog_add(add_feed *feed, gchar *url)
                 	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radiobutton3)))
                         	break;
         	}
-        	feed->del_feed=i;
+        	feed->del_feed = i;
         	feed->del_unread = gtk_toggle_button_get_active(
                 	GTK_TOGGLE_BUTTON(checkbutton4));
 		gtk_spin_button_update((GtkSpinButton *)spinbutton1);
diff --git a/src/rss-ui.glade b/src/rss-ui.glade
index 1a0423c..fa119d0 100644
--- a/src/rss-ui.glade
+++ b/src/rss-ui.glade
@@ -1045,11 +1045,33 @@
               </packing>
             </child>
             <child>
-              <widget class="GtkLabel" id="entry2">
+              <widget class="GtkHBox" id="folder_box">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">label</property>
-                <property name="wrap">True</property>
-                <property name="single_line_mode">True</property>
+                <property name="spacing">8</property>
+                <child>
+                  <widget class="GtkImage" id="image1">
+                    <property name="visible">True</property>
+                    <property name="stock">gtk-missing-image</property>
+                    <property name="icon-size">6</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="entry2">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">label</property>
+                    <property name="wrap">True</property>
+                    <property name="single_line_mode">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
               </widget>
               <packing>
                 <property name="position">1</property>
@@ -1225,9 +1247,10 @@ days</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkVBox" id="vbox9">
+                          <widget class="GtkVBox" id="vbox1">
                             <property name="visible">True</property>
-                            <property name="border_width">10</property>
+                            <property name="orientation">vertical</property>
+                            <property name="homogeneous">True</property>
                             <child>
                               <widget class="GtkRadioButton" id="storage_rb1">
                                 <property name="label" translatable="yes">Do not delete feeds</property>
@@ -1252,7 +1275,6 @@ days</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
                                     <property name="use_underline">True</property>
-                                    <property name="active">True</property>
                                     <property name="draw_indicator">True</property>
                                     <property name="group">storage_rb1</property>
                                   </widget>
@@ -1264,6 +1286,7 @@ days</property>
                                   <widget class="GtkSpinButton" id="storage_sb1">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
+                                    <property name="invisible_char">&#x25CF;</property>
                                     <property name="adjustment">10 1 10000 1 10 10</property>
                                     <property name="climb_rate">1</property>
                                   </widget>
@@ -1295,7 +1318,6 @@ days</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
                                     <property name="use_underline">True</property>
-                                    <property name="active">True</property>
                                     <property name="draw_indicator">True</property>
                                     <property name="group">storage_rb1</property>
                                   </widget>
@@ -1307,6 +1329,7 @@ days</property>
                                   <widget class="GtkSpinButton" id="storage_sb2">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
+                                    <property name="invisible_char">&#x25CF;</property>
                                     <property name="adjustment">10 1 9999 1 10 10</property>
                                     <property name="climb_rate">1</property>
                                   </widget>
@@ -1329,6 +1352,20 @@ days</property>
                               </packing>
                             </child>
                             <child>
+                              <widget class="GtkRadioButton" id="storage_rb4">
+                                <property name="label" translatable="yes">Delete articles that are no longer in the feed</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">storage_rb1</property>
+                              </widget>
+                              <packing>
+                                <property name="position">3</property>
+                              </packing>
+                            </child>
+                            <child>
                               <widget class="GtkCheckButton" id="storage_unread">
                                 <property name="label" translatable="yes">Always delete unread articles</property>
                                 <property name="visible">True</property>
@@ -1338,7 +1375,7 @@ days</property>
                                 <property name="draw_indicator">True</property>
                               </widget>
                               <packing>
-                                <property name="position">3</property>
+                                <property name="position">4</property>
                               </packing>
                             </child>
                           </widget>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]