# HG changeset patch # User Yoshiki Yazawa # Date 1216988598 -32400 # Node ID 0921655b4ae1e3175ecd0c8668b748c5f3f325d4 # Parent d6ecbdee0afa47a8a1e63f92ad9171ac4ffc0018 added UI for configuring retrieve interval. diff -r d6ecbdee0afa -r 0921655b4ae1 pidgin-twitter.c --- a/pidgin-twitter.c Fri Jul 25 18:39:19 2008 +0900 +++ b/pidgin-twitter.c Fri Jul 25 21:23:18 2008 +0900 @@ -2581,14 +2581,19 @@ gtk_container_remove(GTK_CONTAINER(window), notebook); + /* it may cause crash when dispose configure window --yaz */ + /* xxx find the better way */ // g_signal_connect(notebook, "destroy", // G_CALLBACK(gtk_widget_destroyed), ¬ebook); + /***********************/ /* connect to signals */ - - + /***********************/ + + /*****************/ /* account page */ + /*****************/ e = GTK_WIDGET(gtk_builder_get_object (builder, "account_twitter")); g_object_set_data(G_OBJECT(e), "pref", OPT_SCREEN_NAME_TWITTER); text = purple_prefs_get_string(OPT_SCREEN_NAME_TWITTER); @@ -2632,7 +2637,34 @@ g_signal_connect(e, "changed", G_CALLBACK(text_changed_cb), &e); + + /* interval spin */ + e = GTK_WIDGET(gtk_builder_get_object (builder, + "account_api_get_interval_spin")); + g_object_set_data(G_OBJECT(e), "pref", OPT_API_BASE_GET_INTERVAL); + + spin = GTK_SPIN_BUTTON(e); + + value = purple_prefs_get_int(OPT_API_BASE_GET_INTERVAL); + twitter_debug("spin value = %d\n", value); + + adjust = gtk_adjustment_new(value, 40, 3600, 10, 100, 100); + gtk_spin_button_set_adjustment(spin, GTK_ADJUSTMENT(adjust)); + gtk_widget_set_size_request(GTK_WIDGET(spin), 50, -1); + + if(value == 0) { + value = TWITTER_DEFAULT_INTERVAL; + purple_prefs_set_int(OPT_API_BASE_GET_INTERVAL, value); + } + gtk_spin_button_set_value(GTK_SPIN_BUTTON(e), (gdouble)value); + g_signal_connect(e, "value-changed", + G_CALLBACK(spin_changed_cb), &e); + + + + /*********************/ /* translation page */ + /*********************/ e = GTK_WIDGET(gtk_builder_get_object (builder, "translation_recipient")); g_object_set_data(G_OBJECT(e), "pref", OPT_TRANSLATE_RECIPIENT); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), @@ -2656,8 +2688,9 @@ - + /**************/ /* icon page */ + /**************/ e = GTK_WIDGET(gtk_builder_get_object (builder, "icon_show_icon")); g_object_set_data(G_OBJECT(e), "pref", OPT_SHOW_ICON); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), @@ -2665,7 +2698,7 @@ g_signal_connect(e, "toggled", G_CALLBACK(bool_toggled_cb), &e); - /* setup spin */ + /* icon size spin */ e = GTK_WIDGET(gtk_builder_get_object (builder, "icon_icon_size_spin")); g_object_set_data(G_OBJECT(e), "pref", OPT_ICON_SIZE); @@ -2674,7 +2707,7 @@ value = purple_prefs_get_int(OPT_ICON_SIZE); twitter_debug("spin value = %d\n", value); - adjust = gtk_adjustment_new(value, 16, 128, 4, 1, 1); + adjust = gtk_adjustment_new(value, 16, 128, 4, 4, 4); gtk_spin_button_set_adjustment(spin, GTK_ADJUSTMENT(adjust)); gtk_widget_set_size_request(GTK_WIDGET(spin), 50, -1); @@ -2696,7 +2729,7 @@ g_signal_connect(e, "toggled", G_CALLBACK(bool_toggled_cb), &e); - /* setup count spin */ + /* max count spin */ e = GTK_WIDGET(gtk_builder_get_object (builder, "icon_max_count_spin")); g_object_set_data(G_OBJECT(e), "pref", OPT_ICON_MAX_COUNT); @@ -2718,7 +2751,7 @@ G_CALLBACK(spin_changed_cb), &e); - /* setup days spin */ + /* max days spin */ e = GTK_WIDGET(gtk_builder_get_object (builder, "icon_max_days_spin")); g_object_set_data(G_OBJECT(e), "pref", OPT_ICON_MAX_DAYS); @@ -2741,8 +2774,9 @@ - + /***************/ /* sound page */ + /***************/ e = GTK_WIDGET(gtk_builder_get_object (builder, "sound_recip_check")); g_object_set_data(G_OBJECT(e), "pref", OPT_PLAYSOUND_RECIPIENT); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), @@ -2757,7 +2791,7 @@ g_signal_connect(e, "changed", G_CALLBACK(text_changed_cb), &e); - /* setup combobox */ + /* recipient combobox */ e = GTK_WIDGET(gtk_builder_get_object (builder, "sound_recip_combo")); gtk_combo_box_set_active(GTK_COMBO_BOX(e), purple_prefs_get_int(OPT_SOUNDID_RECIPIENT)); @@ -2781,7 +2815,7 @@ g_signal_connect(e, "changed", G_CALLBACK(text_changed_cb), &e); - /* setup combobox */ + /* sender combobox */ e = GTK_WIDGET(gtk_builder_get_object (builder, "sound_send_combo")); gtk_combo_box_set_active(GTK_COMBO_BOX(e), purple_prefs_get_int(OPT_SOUNDID_RECIPIENT)); @@ -2792,8 +2826,9 @@ - + /****************/ /* utility page */ + /****************/ e = GTK_WIDGET(gtk_builder_get_object (builder, "utility_counter")); g_object_set_data(G_OBJECT(e), "pref", OPT_COUNTER); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), @@ -2825,8 +2860,7 @@ G_CALLBACK(bool_toggled_cb), &e); - - + /* all done */ gtk_widget_show_all(notebook); return notebook; } diff -r d6ecbdee0afa -r 0921655b4ae1 prefs.ui --- a/prefs.ui Fri Jul 25 18:39:19 2008 +0900 +++ b/prefs.ui Fri Jul 25 21:23:18 2008 +0900 @@ -158,7 +158,6 @@ True 0 identi.ca - GTK_JUSTIFY_CENTER 10 @@ -233,22 +232,24 @@ True - 0 - 10 - 20 + 40 True 0 Password + 10 + + 1 + True - 10 + 1 4 @@ -260,13 +261,81 @@ False + GTK_PACK_END + + + + + 6 + + + + + True + + + True + 2 + 10 + 40 + + + True + Retrieve interval + + + + + False False + + + + + True + 2 + 10 + 4 + + + True + True + 1 + True + True + + + + + False + False + GTK_PACK_END + 2 + + + + + True + 10 + 8 + + + True + sec + + + + + False + False + GTK_PACK_END 1 - 6 + False + 7 @@ -388,8 +457,8 @@ True - 8 - 8 + 12 + 4 4 @@ -526,18 +595,13 @@ 4 - - True - - - - True + 0 40 @@ -549,19 +613,16 @@ False False + GTK_PACK_START 0 - - - - - True - 30 - 4 + 1 + 40 + 0 True @@ -575,22 +636,19 @@ False False + GTK_PACK_START 1 - - - - True - 4 + 0 4 True - times or + times or @@ -601,10 +659,6 @@ 2 - - - - True @@ -626,10 +680,6 @@ 1 - - - - True @@ -649,10 +699,6 @@ 0 - - - - False