[kazehakase-svn] [3554] * src/kz-tab-label.c: Use KzProfile signal to obtain create_thumbnail

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Sat Jan 24 18:45:14 JST 2009


Revision: 3554
          http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3554
Author:   ikezoe
Date:     2009-01-24 18:45:14 +0900 (Sat, 24 Jan 2009)

Log Message:
-----------
	* src/kz-tab-label.c: Use KzProfile signal to obtain create_thumbnail
	flag.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/kz-tab-label.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-01-24 08:22:38 UTC (rev 3553)
+++ kazehakase/trunk/ChangeLog	2009-01-24 09:45:14 UTC (rev 3554)
@@ -6,6 +6,8 @@
 	* src/kz-tab-label.[ch]: Remove favicon_pixbuf from KzTab structure.
 	* src/kz-tab-label.[ch]: Remove kz_tab_label_show_favicon. KzTab now
 	handles favicon internally.
+	* src/kz-tab-label.c: Use KzProfile signal to obtain create_thumbnail
+	flag.
 
 2009-01-23  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/src/kz-tab-label.c
===================================================================
--- kazehakase/trunk/src/kz-tab-label.c	2009-01-24 08:22:38 UTC (rev 3553)
+++ kazehakase/trunk/src/kz-tab-label.c	2009-01-24 09:45:14 UTC (rev 3554)
@@ -52,6 +52,7 @@
 	gboolean auto_refresh;
 	gboolean javascript;
 	gboolean show_favicon;
+	gboolean create_thumbnail;
 	guint auto_refresh_id;
 	gint icon_width;
 	gint icon_height;
@@ -105,6 +106,12 @@
 						 const gchar *old_value,
 						 KzTabLabel *kztab);
 
+static void     cb_global_profile_changed       (KzProfile *profile,
+						 const gchar *section,
+						 const gchar *key,
+						 const gchar *old_value,
+						 KzTabLabel *kztab);
+
 /* callbacks for embed */
 static void cb_title_changed (KzEmbed *embed, KzTabLabel *kztab);
 static void cb_location_changed (KzEmbed *embed, KzTabLabel *kztab);
@@ -207,8 +214,11 @@
 	priv->auto_refresh      = FALSE;
 	priv->auto_refresh_id   = 0;
 	
-	/* favicon */
+	priv->show_favicon      = TRUE;
+	priv->create_thumbnail  = FALSE;
+
 	KZ_CONF_GET("Tab", "show_favicon", priv->show_favicon, BOOL);
+	KZ_CONF_GET("Global", "create_thumbnail", priv->create_thumbnail, BOOL);
 
 	kztab->circle           = NULL;
 	kztab->mask             = NULL;
@@ -276,6 +286,8 @@
 
 	g_signal_connect(KZ_GET_GLOBAL_PROFILE, "changed::Tab",
 			 G_CALLBACK(cb_profile_changed), kztab);
+	g_signal_connect(KZ_GET_GLOBAL_PROFILE, "changed::Global",
+			 G_CALLBACK(cb_global_profile_changed), kztab);
 	kz_tab_label_sync_to_profile(kztab);
 	kz_tab_label_set_text(kztab, NULL);
 }
@@ -330,6 +342,9 @@
 	g_signal_handlers_disconnect_by_func(KZ_GET_GLOBAL_PROFILE,
 					     G_CALLBACK(cb_profile_changed),
 					     kztab);
+	g_signal_handlers_disconnect_by_func(KZ_GET_GLOBAL_PROFILE,
+					     G_CALLBACK(cb_global_profile_changed),
+					     kztab);
 	if (kztab->kzembed)
 	{
 	
@@ -501,14 +516,14 @@
 			KzTabLabelState state)
 {
 	gchar *title;
-	gboolean create_thumbnail = FALSE;
+	KzTabLabelPrivate *priv;
 	
 	g_return_if_fail(KZ_IS_TAB_LABEL(kztab));
 
 	if (!GTK_WIDGET_REALIZED(kztab)) return;
 
-	KZ_CONF_GET("Global", "create_thumbnail", create_thumbnail, BOOL);
-	if (create_thumbnail &&
+	priv = KZ_TAB_LABEL_GET_PRIVATE (kztab);
+	if (priv->create_thumbnail &&
 	    kztab->state != KZ_TAB_LABEL_STATE_NORMAL &&
 	    state == KZ_TAB_LABEL_STATE_NORMAL)
 	{
@@ -832,6 +847,22 @@
 	kz_tab_label_sync_to_profile(kztab);
 }
 
+static void
+cb_global_profile_changed (KzProfile *profile,
+			   const gchar *section,
+			   const gchar *key,
+			   const gchar *old_value,
+			   KzTabLabel *kztab)
+{
+	g_return_if_fail(KZ_IS_TAB_LABEL(kztab));
+
+	if (key && strcmp(key, "create_thumbnail"))
+	{
+		KzTabLabelPrivate *priv = KZ_TAB_LABEL_GET_PRIVATE(kztab);
+		KZ_CONF_GET("Global", "create_thumbnail", priv->create_thumbnail, BOOL);
+	}
+}
+
 /* callbacks for embed */
 
 static void



More information about the Kazehakase-cvs mailing list
Back to archive index