diff options
author | Milan Crha <mcrha@redhat.com> | 2009-04-24 17:45:21 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-04-24 17:45:21 +0800 |
commit | 8a072ffc7c0ddcde472877a51ace0bb14f86fb0a (patch) | |
tree | 5c49c7807f24cd118e32e11ad52482b0ce65d0e6 /plugins/google-account-setup | |
parent | f6792a6f1e60b04ee1c137c9232802df437580f6 (diff) | |
download | gsoc2013-evolution-8a072ffc7c0ddcde472877a51ace0bb14f86fb0a.tar.gz gsoc2013-evolution-8a072ffc7c0ddcde472877a51ace0bb14f86fb0a.tar.zst gsoc2013-evolution-8a072ffc7c0ddcde472877a51ace0bb14f86fb0a.zip |
GN-bug #572348 - Removed deprecated Gtk+ symbols
Some still left, because those gone in kill-bonobo branch.
Diffstat (limited to 'plugins/google-account-setup')
-rw-r--r-- | plugins/google-account-setup/ChangeLog | 6 | ||||
-rw-r--r-- | plugins/google-account-setup/google-source.c | 61 |
2 files changed, 32 insertions, 35 deletions
diff --git a/plugins/google-account-setup/ChangeLog b/plugins/google-account-setup/ChangeLog index 4d8e8b1ecb..03cf6b4e3e 100644 --- a/plugins/google-account-setup/ChangeLog +++ b/plugins/google-account-setup/ChangeLog @@ -1,3 +1,9 @@ +2009-04-24 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #572348 + + * google-source.c: Remove deprecated Gtk+ symbols. + 2009-04-09 Milan Crha <mcrha@redhat.com> ** Fix for bug #574248 diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c index 181984c538..a5b846076f 100644 --- a/plugins/google-account-setup/google-source.c +++ b/plugins/google-account-setup/google-source.c @@ -233,10 +233,10 @@ user_changed (GtkEntry *editable, ESource *source) } static char * -get_refresh_minutes (GtkWidget *spin, GtkWidget *option) +get_refresh_minutes (GtkWidget *spin, GtkWidget *combobox) { int setting = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin)); - switch (gtk_option_menu_get_history (GTK_OPTION_MENU (option))) { + switch (gtk_combo_box_get_active (GTK_COMBO_BOX (combobox))) { case 0: /* minutes */ break; @@ -264,30 +264,30 @@ static void spin_changed (GtkSpinButton *spin, ECalConfigTargetSource *t) { gchar *refresh_str; - GtkWidget *option; + GtkWidget *combobox; - option = g_object_get_data (G_OBJECT(spin), "option"); + combobox = g_object_get_data (G_OBJECT(spin), "combobox"); - refresh_str = get_refresh_minutes ((GtkWidget *)spin, option); + refresh_str = get_refresh_minutes ((GtkWidget *)spin, combobox); e_source_set_property (t->source, "refresh", refresh_str); g_free (refresh_str); } static void -option_changed (GtkSpinButton *option, ECalConfigTargetSource *t) +combobox_changed (GtkComboBox *combobox, ECalConfigTargetSource *t) { gchar *refresh_str; GtkWidget *spin; - spin = g_object_get_data (G_OBJECT(option), "spin"); + spin = g_object_get_data (G_OBJECT(combobox), "spin"); - refresh_str = get_refresh_minutes (spin, (GtkWidget *)option); + refresh_str = get_refresh_minutes (spin, (GtkWidget *)combobox); e_source_set_property (t->source, "refresh", refresh_str); g_free (refresh_str); } static void -set_refresh_time (ESource *source, GtkWidget *spin, GtkWidget *option) +set_refresh_time (ESource *source, GtkWidget *spin, GtkWidget *combobox) { int time; int item_num = 0; @@ -307,7 +307,7 @@ set_refresh_time (ESource *source, GtkWidget *spin, GtkWidget *option) item_num = 1; time /= 60; } - gtk_option_menu_set_history (GTK_OPTION_MENU (option), item_num); + gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), item_num); gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), time); } @@ -567,9 +567,7 @@ plugin_google (EPlugin *epl, GtkCellRenderer *renderer; GtkListStore *store; - GtkWidget *option, *spin, *menu, *hbox; - GtkWidget *times [4]; - int i; + GtkWidget *combobox, *spin, *hbox; source = t->source; group = e_source_peek_group (source); @@ -647,28 +645,21 @@ plugin_google (EPlugin *epl, gtk_widget_show (spin); gtk_box_pack_start (GTK_BOX(hbox), spin, FALSE, TRUE, 0); - option = gtk_option_menu_new (); - gtk_widget_show (option); - times[0] = gtk_menu_item_new_with_label (_("minutes")); - times[1] = gtk_menu_item_new_with_label (_("hours")); - times[2] = gtk_menu_item_new_with_label (_("days")); - times[3] = gtk_menu_item_new_with_label (_("weeks")); - - menu = gtk_menu_new (); - gtk_widget_show (menu); - for (i = 0; i < 4; i++) { - gtk_widget_show (times[i]); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), times[i]); - } - gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); - set_refresh_time (source, spin, option); - gtk_box_pack_start (GTK_BOX (hbox), option, FALSE, TRUE, 0); - - e_source_set_property (source, "refresh", "30"); - - g_object_set_data (G_OBJECT (option), "spin", spin); - g_signal_connect (G_OBJECT (option), "changed", G_CALLBACK (option_changed), t); - g_object_set_data (G_OBJECT (spin), "option", option); + if (!e_source_get_property (source, "refresh")) + e_source_set_property (source, "refresh", "30"); + + combobox = gtk_combo_box_new_text (); + gtk_widget_show (combobox); + gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("minutes")); + gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("hours")); + gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("days")); + gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("weeks")); + set_refresh_time (source, spin, combobox); + gtk_box_pack_start (GTK_BOX (hbox), combobox, FALSE, TRUE, 0); + + g_object_set_data (G_OBJECT (combobox), "spin", spin); + g_signal_connect (G_OBJECT (combobox), "changed", G_CALLBACK (combobox_changed), t); + g_object_set_data (G_OBJECT (spin), "combobox", combobox); g_signal_connect (G_OBJECT (spin), "value-changed", G_CALLBACK (spin_changed), t); gtk_table_attach (GTK_TABLE (parent), hbox, 1, 2, row + 2, row + 3, GTK_EXPAND | GTK_FILL, 0, 0, 0); |