diff options
author | Gary Ekker <gekker@novell.com> | 2004-04-11 05:31:37 +0800 |
---|---|---|
committer | Gary Ekker <gekker@src.gnome.org> | 2004-04-11 05:31:37 +0800 |
commit | f657306b6d8416fa2709b671cacace3c894bb621 (patch) | |
tree | 4e749ab7e6dc6e8f7ab61bc9bba497bae4bb8340 /calendar/gui/dialogs | |
parent | 203132df9b3d99d88cef1b8a6cb397d32d6ff55b (diff) | |
download | gsoc2013-evolution-f657306b6d8416fa2709b671cacace3c894bb621.tar.gz gsoc2013-evolution-f657306b6d8416fa2709b671cacace3c894bb621.tar.zst gsoc2013-evolution-f657306b6d8416fa2709b671cacace3c894bb621.zip |
Fixed to use e-passwords.
2004-04-09 Gary Ekker <gekker@novell.com>
* gui/dialogs/url-editor-dialog.c: Fixed to use e-passwords.
* gui/dialogs/cal-prefs-dialog.c: Fixed crash and bugs created by
changes made for instant apply.
* gui/itip-utils.c: Fixed to use e-passwords.
* gui/e-pub-utils.c: Fixed to use e-passwords.
(just_published): Fixed error in logic.
(e_pub_publish): Fixed crash if ESource is NULL.
svn path=/trunk/; revision=25410
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.c | 43 | ||||
-rw-r--r-- | calendar/gui/dialogs/url-editor-dialog.c | 55 |
2 files changed, 64 insertions, 34 deletions
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index 3f32522118..0a6d703cd4 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -641,6 +641,7 @@ cal_prefs_dialog_url_add_clicked (GtkWidget *button, DialogData *dialog_data) -1); url_list_changed (dialog_data); + show_fb_config (dialog_data); if (!GTK_WIDGET_SENSITIVE ((GtkWidget *) dialog_data->url_remove)) { selection = gtk_tree_view_get_selection ((GtkTreeView *) dialog_data->url_list); @@ -686,6 +687,7 @@ cal_prefs_dialog_url_edit_clicked (GtkWidget *button, DialogData *dialog_data) -1); url_list_changed (dialog_data); + show_fb_config (dialog_data); if (!GTK_WIDGET_SENSITIVE ((GtkWidget *) dialog_data->url_remove)) { selection = gtk_tree_view_get_selection ((GtkTreeView *) dialog_data->url_list); @@ -757,8 +759,8 @@ cal_prefs_dialog_url_remove_clicked (GtkWidget *button, DialogData *dialog_data) gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_enable), FALSE); } g_free (url); - url_list_changed (dialog_data); + show_fb_config (dialog_data); } } @@ -776,6 +778,9 @@ cal_prefs_dialog_url_enable_clicked (GtkWidget *button, DialogData *dialog_data) URL_LIST_FREE_BUSY_URL_COLUMN, &url, -1); url->enabled = !url->enabled; + + gtk_tree_selection_select_iter (selection, &iter); + gtk_list_store_set ((GtkListStore *) model, &iter, URL_LIST_ENABLED_COLUMN, url->enabled, -1); @@ -784,6 +789,7 @@ cal_prefs_dialog_url_enable_clicked (GtkWidget *button, DialogData *dialog_data) url->enabled ? _("Disable") : _("Enable")); url_list_changed (dialog_data); + show_fb_config (dialog_data); } } @@ -817,6 +823,7 @@ cal_prefs_dialog_url_list_enable_toggled (GtkCellRendererToggle *renderer, url->enabled ? _("Disable") : _("Enable")); url_list_changed (dialog_data); + show_fb_config (dialog_data); } gtk_tree_path_free (path); @@ -863,7 +870,7 @@ cal_prefs_dialog_url_list_change (GtkTreeSelection *selection, static void show_fb_config (DialogData *dialog_data) { - GSList *url_config_list; + GSList *url_config_list = NULL; GtkListStore *model; GtkTreeIter iter; @@ -872,6 +879,27 @@ show_fb_config (DialogData *dialog_data) /* restore urls from gconf */ url_config_list = calendar_config_get_free_busy(); + + if (!url_config_list) { + /* list is empty-disable edit, remove, and enable buttons */ + gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_edit), + FALSE); + + gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_remove), + FALSE); + + gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_enable), + FALSE); + } else { + gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_edit), + TRUE); + + gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_remove), + TRUE); + + gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_enable), + TRUE); + } while (url_config_list) { gchar *xml = (gchar *)url_config_list->data; @@ -896,17 +924,6 @@ show_fb_config (DialogData *dialog_data) g_slist_foreach (url_config_list, (GFunc) g_free, NULL); g_slist_free (url_config_list); - if (!gtk_tree_model_get_iter_first ((GtkTreeModel *) model, &iter)) { - /* list is empty-disable edit, remove, and enable buttons */ - gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_edit), - FALSE); - - gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_remove), - FALSE); - - gtk_widget_set_sensitive (GTK_WIDGET (dialog_data->url_enable), - FALSE); - } } /* Shows the current task list settings in the dialog */ diff --git a/calendar/gui/dialogs/url-editor-dialog.c b/calendar/gui/dialogs/url-editor-dialog.c index ec1e493402..5b87c58289 100644 --- a/calendar/gui/dialogs/url-editor-dialog.c +++ b/calendar/gui/dialogs/url-editor-dialog.c @@ -34,6 +34,7 @@ #include "cal-prefs-dialog.h" #include "url-editor-dialog.h" +#include "e-util/e-passwords.h" #include <gtk/gtk.h> #include <gtk/gtksignal.h> #include <gtk/gtkoptionmenu.h> @@ -82,7 +83,8 @@ url_editor_dialog_new (DialogData *dialog_data, EPublishUri *uri) url_dlg_data->url_data = uri; init_widgets (url_dlg_data); - if (uri->location && uri->username && uri->password) { + + if (uri->location && uri->username) { if (strlen(uri->location) != 0) { gtk_entry_set_text (url_dlg_data->url_entry, uri->location); @@ -91,6 +93,11 @@ url_editor_dialog_new (DialogData *dialog_data, EPublishUri *uri) gtk_entry_set_text (url_dlg_data->username_entry, uri->username); } + } + + uri->password = e_passwords_get_password ("Calendar", url_dlg_data->url_data->location); + + if (uri->password) { if (strlen(uri->password) != 0) { gtk_entry_set_text (url_dlg_data->password_entry, uri->password); @@ -99,25 +106,26 @@ url_editor_dialog_new (DialogData *dialog_data, EPublishUri *uri) } else { e_dialog_toggle_set (url_dlg_data->remember_pw, FALSE); } - - switch (uri->publish_freq) { - case URI_PUBLISH_DAILY: - e_dialog_radio_set (url_dlg_data->daily, - URI_PUBLISH_DAILY, - pub_frequency_type_map); - break; - case URI_PUBLISH_WEEKLY: - e_dialog_radio_set (url_dlg_data->daily, - URI_PUBLISH_WEEKLY, - pub_frequency_type_map); - break; - case URI_PUBLISH_USER: - default: - e_dialog_radio_set (url_dlg_data->daily, - URI_PUBLISH_USER, - pub_frequency_type_map); - } } + + switch (uri->publish_freq) { + case URI_PUBLISH_DAILY: + e_dialog_radio_set (url_dlg_data->daily, + URI_PUBLISH_DAILY, + pub_frequency_type_map); + break; + case URI_PUBLISH_WEEKLY: + e_dialog_radio_set (url_dlg_data->daily, + URI_PUBLISH_WEEKLY, + pub_frequency_type_map); + break; + case URI_PUBLISH_USER: + default: + e_dialog_radio_set (url_dlg_data->daily, + URI_PUBLISH_USER, + pub_frequency_type_map); + } + dialog_data->url_editor=TRUE; dialog_data->url_editor_dlg = (GtkWidget *) url_dlg_data; gtk_widget_set_sensitive ((GtkWidget *) url_dlg_data->ok, FALSE); @@ -128,8 +136,13 @@ url_editor_dialog_new (DialogData *dialog_data, EPublishUri *uri) if ((GtkEntry *) url_dlg_data->url_entry) { url_editor_dialog_fb_url_activated (url_dlg_data->url_entry, url_dlg_data); url_dlg_data->url_data->username = g_strdup (gtk_entry_get_text ((GtkEntry *) url_dlg_data->username_entry)); - if (e_dialog_toggle_get (url_dlg_data->remember_pw)) - url_dlg_data->url_data->password = g_strdup (gtk_entry_get_text ((GtkEntry *) url_dlg_data->password_entry)); + url_dlg_data->url_data->password = g_strdup (gtk_entry_get_text ((GtkEntry *) url_dlg_data->password_entry)); + if (e_dialog_toggle_get (url_dlg_data->remember_pw)) { + e_passwords_add_password (url_dlg_data->url_data->location, url_dlg_data->url_data->password); + e_passwords_remember_password ("Calendar", url_dlg_data->url_data->location); + } else { + e_passwords_forget_password ("Calendar", url_dlg_data->url_data->location); + } } } |