# HG changeset patch # User Yoshiki Yazawa # Date 1217399110 -32400 # Node ID 56e3873e58a88d49719ac71070b4b2e5d06dd218 # Parent 10516b7b05a96400b68e4c1c463b1b8e2acb716a made log output configurable. diff -r 10516b7b05a9 -r 56e3873e58a8 pidgin-twitter.c --- a/pidgin-twitter.c Tue Jul 29 19:20:20 2008 +0900 +++ b/pidgin-twitter.c Wed Jul 30 15:25:10 2008 +0900 @@ -2891,6 +2891,13 @@ g_signal_connect(e, "toggled", G_CALLBACK(bool_toggled_cb), &e); + e = GTK_WIDGET(gtk_builder_get_object (builder, "utility_log_output")); + g_object_set_data(G_OBJECT(e), "pref", OPT_LOG_OUTPUT); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), + purple_prefs_get_bool(OPT_LOG_OUTPUT)); + g_signal_connect(e, "toggled", + G_CALLBACK(bool_toggled_cb), &e); + /* all done */ gtk_widget_show_all(notebook); @@ -2972,6 +2979,7 @@ purple_prefs_add_bool(OPT_UPDATE_ICON, TRUE); purple_prefs_add_int(OPT_ICON_MAX_COUNT, DEFAULT_ICON_MAX_COUNT); purple_prefs_add_int(OPT_ICON_MAX_DAYS, DEFAULT_ICON_MAX_DAYS); + purple_prefs_add_bool(OPT_LOG_OUTPUT, FALSE); } PURPLE_INIT_PLUGIN(pidgin_twitter, init_plugin, info) diff -r 10516b7b05a9 -r 56e3873e58a8 pidgin-twitter.h --- a/pidgin-twitter.h Tue Jul 29 19:20:20 2008 +0900 +++ b/pidgin-twitter.h Wed Jul 30 15:25:10 2008 +0900 @@ -116,6 +116,7 @@ #define OPT_ICON_MAX_COUNT OPT_PIDGINTWITTER "/icon_max_count" #define OPT_ICON_MAX_DAYS OPT_PIDGINTWITTER "/icon_max_days" #define OPT_API_BASE_GET_INTERVAL OPT_PIDGINTWITTER "/api_base_get_interval" +#define OPT_LOG_OUTPUT OPT_PIDGINTWITTER "/log_output" /* formats and templates */ #define RECIPIENT_FORMAT_TWITTER "@%s" @@ -167,8 +168,8 @@ #define DAYS_TO_SECONDS(d) ((d) * 86400) /* debug macros */ -#define twitter_debug(fmt, ...) purple_debug(PURPLE_DEBUG_INFO, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); -#define twitter_error(fmt, ...) purple_debug(PURPLE_DEBUG_ERROR, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); +#define twitter_debug(fmt, ...) do { if(purple_prefs_get_bool(OPT_LOG_OUTPUT)) purple_debug(PURPLE_DEBUG_INFO, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); } while(0); +#define twitter_error(fmt, ...) do { if(purple_prefs_get_bool(OPT_LOG_OUTPUT)) purple_debug(PURPLE_DEBUG_ERROR, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); } while(0); /* prototypes */ static void escape(gchar **str); diff -r 10516b7b05a9 -r 56e3873e58a8 prefs.ui --- a/prefs.ui Tue Jul 29 19:20:20 2008 +0900 +++ b/prefs.ui Wed Jul 30 15:25:10 2008 +0900 @@ -262,6 +262,7 @@ False GTK_PACK_END + 1 @@ -599,6 +600,27 @@ True + + True + 1 + 40 + + + True + True + 1 + True + True + + + + + False + False + 1 + + + True 0 @@ -613,37 +635,11 @@ False False - GTK_PACK_START - 0 - - - - - True - 1 - 40 - 0 - - - True - True - 1 - True - True - - - - - False - False - GTK_PACK_START - 1 True - 0 4 @@ -696,7 +692,6 @@ False False GTK_PACK_END - 0 @@ -1098,7 +1093,6 @@ True - 10 20 @@ -1114,6 +1108,25 @@ 5 + + + True + 10 + 20 + + + True + True + Output log messages + 0 + True + + + + + 6 + + 4