aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimon.zheng <simon.zheng@sun.com>2006-08-22 17:58:10 +0800
committerSimon Zheng <simonz@src.gnome.org>2006-08-22 17:58:10 +0800
commit41a4ef665287d566fbb4de0d96ec148a0750bf24 (patch)
tree19cee7b135e99a989bb83574e0bede964c9fb63e
parentfb9b67510fe48b92e919b8ffefa4097fa27f740a (diff)
downloadgsoc2013-evolution-41a4ef665287d566fbb4de0d96ec148a0750bf24.tar.gz
gsoc2013-evolution-41a4ef665287d566fbb4de0d96ec148a0750bf24.tar.zst
gsoc2013-evolution-41a4ef665287d566fbb4de0d96ec148a0750bf24.zip
** Fixes for bug #352108
2006-08-22 simon.zheng <simon.zheng@sun.com> ** Fixes for bug #352108 * em-account-editor.c: (emae_service_url_path_changed), (emae_path_changed), (emae_setup_service): Replace widget GnomeFileEntry by GtkFileButton. svn path=/trunk/; revision=32624
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-account-editor.c50
2 files changed, 50 insertions, 9 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 69cec633be..5efa4bba18 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2006-08-22 simon.zheng <simon.zheng@sun.com>
+
+ ** Fixes for bug #352108
+
+ * em-account-editor.c: (emae_service_url_path_changed),
+ (emae_path_changed),
+ (emae_setup_service):
+ Replace widget GnomeFileEntry by GtkFileButton.
+
2006-08-21 Matthew Barnes <mbarnes@redhat.com>
* mail-send-recv.c:
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 0a5b93a995..80ca0bf043 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -1136,6 +1136,39 @@ emae_uri_changed(EMAccountEditorService *service, CamelURL *url)
static void
emae_service_url_changed(EMAccountEditorService *service, void (*setval)(CamelURL *, const char *), GtkEntry *entry)
{
+ GtkComboBox *dropdown;
+ int id;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ CamelServiceAuthType *authtype;
+
+ CamelURL *url = emae_account_url(service->emae, emae_service_info[service->type].account_uri_key);
+ const char *text = gtk_entry_get_text(entry);
+
+ setval(url, (text && text[0])?text:NULL);
+
+ if (text && text[0] && setval == camel_url_set_user) {
+ dropdown = service->authtype;
+ if(dropdown) {
+ id = gtk_combo_box_get_active (dropdown);
+ if (id != -1) {
+ model = gtk_combo_box_get_model (dropdown);
+ if (gtk_tree_model_iter_nth_child (model, &iter, NULL, id)) {
+ gtk_tree_model_get (model, &iter, 1, &authtype, -1);
+ if (authtype)
+ camel_url_set_authmech (url, authtype->authproto);
+ }
+ }
+ }
+ }
+
+ emae_uri_changed(service, url);
+ camel_url_free(url);
+}
+
+static void
+emae_service_url_path_changed(EMAccountEditorService *service, void (*setval)(CamelURL *, const char *), GtkWidget *widget)
+{
GtkComboBox *dropdown;
int id;
GtkTreeModel *model;
@@ -1143,7 +1176,7 @@ emae_service_url_changed(EMAccountEditorService *service, void (*setval)(CamelUR
CamelServiceAuthType *authtype;
CamelURL *url = emae_account_url(service->emae, emae_service_info[service->type].account_uri_key);
- const char *text = gtk_entry_get_text(entry);
+ const char *text = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
setval(url, (text && text[0])?text:NULL);
@@ -1179,9 +1212,9 @@ emae_username_changed(GtkEntry *entry, EMAccountEditorService *service)
}
static void
-emae_path_changed(GtkEntry *entry, EMAccountEditorService *service)
+emae_path_changed(GtkWidget *widget, EMAccountEditorService *service)
{
- emae_service_url_changed(service, camel_url_set_path, entry);
+ emae_service_url_path_changed(service, camel_url_set_path, widget);
}
static int
@@ -1609,8 +1642,7 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service, Glade
service->hostlabel = (GtkLabel *)glade_xml_get_widget (xml, info->hostlabel);
service->username = GTK_ENTRY (glade_xml_get_widget (xml, info->username));
service->userlabel = (GtkLabel *)glade_xml_get_widget (xml, info->userlabel);
- if (info->path) {
- service->path = GTK_ENTRY (glade_xml_get_widget (xml, info->path));
+ if (info->pathentry) {
service->pathlabel = (GtkLabel *)glade_xml_get_widget(xml, info->pathlabel);
service->pathentry = glade_xml_get_widget(xml, info->pathentry);
}
@@ -1633,8 +1665,8 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service, Glade
}
if (url->user)
gtk_entry_set_text(service->username, url->user);
- if (service->path && url->path)
- gtk_entry_set_text(service->path, url->path);
+ if (service->pathentry && url->path)
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (service->path), url->path);
tmp = camel_url_get_param(url, "use_ssl");
if (tmp == NULL)
@@ -1649,8 +1681,8 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service, Glade
g_signal_connect (service->hostname, "changed", G_CALLBACK (emae_hostname_changed), service);
g_signal_connect (service->username, "changed", G_CALLBACK (emae_username_changed), service);
- if (service->path)
- g_signal_connect (service->path, "changed", G_CALLBACK (emae_path_changed), service);
+ if (service->pathentry)
+ g_signal_connect (GTK_FILE_CHOOSER (service->pathentry), "selection-changed", G_CALLBACK (emae_path_changed), service);
g_signal_connect(service->use_ssl, "changed", G_CALLBACK(emae_ssl_changed), service);