diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-05-09 04:53:24 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-05-09 04:53:24 +0000 |
commit | 3be7497b4d410c1097bb19bcb7acfc10559585e1 (patch) | |
tree | bdb91f6480746a38761f70c8dedbda4dcdedf4a3 /src | |
parent | fea7f25b90de50e37e188a66b428223f7de7257d (diff) |
automatically set SSL ports in Advanced tab when the radio buttons in SSL tab are toggled.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1685 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/prefs_account_dialog.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/prefs_account_dialog.c b/src/prefs_account_dialog.c index 3a36ea00..4c285bcd 100644 --- a/src/prefs_account_dialog.c +++ b/src/prefs_account_dialog.c @@ -1505,6 +1505,58 @@ static void prefs_account_privacy_create(void) CREATE_RADIO_BUTTON(box, btn3, btn1, btn3_label, btn3_data); \ } +static void pop_ssltunnel_toggled(GtkToggleButton *button, gpointer data) +{ + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON(advanced.popport_chkbtn))) + return; + + if (gtk_toggle_button_get_active(button)) { + gtk_entry_set_text(GTK_ENTRY(advanced.popport_entry), "995"); + } else { + gtk_entry_set_text(GTK_ENTRY(advanced.popport_entry), "110"); + } +} + +static void imap_ssltunnel_toggled(GtkToggleButton *button, gpointer data) +{ + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON(advanced.imapport_chkbtn))) + return; + + if (gtk_toggle_button_get_active(button)) { + gtk_entry_set_text(GTK_ENTRY(advanced.imapport_entry), "993"); + } else { + gtk_entry_set_text(GTK_ENTRY(advanced.imapport_entry), "143"); + } +} + +static void nntp_ssltunnel_toggled(GtkToggleButton *button, gpointer data) +{ + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON(advanced.nntpport_chkbtn))) + return; + + if (gtk_toggle_button_get_active(button)) { + gtk_entry_set_text(GTK_ENTRY(advanced.nntpport_entry), "563"); + } else { + gtk_entry_set_text(GTK_ENTRY(advanced.nntpport_entry), "119"); + } +} + +static void smtp_ssltunnel_toggled(GtkToggleButton *button, gpointer data) +{ + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON(advanced.smtpport_chkbtn))) + return; + + if (gtk_toggle_button_get_active(button)) { + gtk_entry_set_text(GTK_ENTRY(advanced.smtpport_entry), "465"); + } else { + gtk_entry_set_text(GTK_ENTRY(advanced.smtpport_entry), "25"); + } +} + static void prefs_account_ssl_create(void) { GtkWidget *vbox1; @@ -1558,6 +1610,9 @@ static void prefs_account_ssl_create(void) _("Use STARTTLS command to start SSL session"), SSL_STARTTLS); + g_signal_connect(G_OBJECT(pop_ssltunnel_radiobtn), "toggled", + G_CALLBACK(pop_ssltunnel_toggled), NULL); + PACK_FRAME (vbox1, imap_frame, _("IMAP4")); vbox3 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox3); @@ -1575,6 +1630,9 @@ static void prefs_account_ssl_create(void) _("Use STARTTLS command to start SSL session"), SSL_STARTTLS); + g_signal_connect(G_OBJECT(imap_ssltunnel_radiobtn), "toggled", + G_CALLBACK(imap_ssltunnel_toggled), NULL); + PACK_FRAME (vbox1, nntp_frame, _("NNTP")); vbox4 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox4); @@ -1592,6 +1650,9 @@ static void prefs_account_ssl_create(void) CREATE_RADIO_BUTTON(vbox4, nntp_ssltunnel_radiobtn, nntp_nossl_radiobtn, _("Use SSL for NNTP connection"), SSL_TUNNEL); + g_signal_connect(G_OBJECT(nntp_ssltunnel_radiobtn), "toggled", + G_CALLBACK(nntp_ssltunnel_toggled), NULL); + PACK_FRAME (vbox1, send_frame, _("Send (SMTP)")); vbox5 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox5); @@ -1609,6 +1670,9 @@ static void prefs_account_ssl_create(void) _("Use STARTTLS command to start SSL session"), SSL_STARTTLS); + g_signal_connect(G_OBJECT(smtp_ssltunnel_radiobtn), "toggled", + G_CALLBACK(smtp_ssltunnel_toggled), NULL); + vbox6 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox6); gtk_box_pack_start (GTK_BOX (vbox1), vbox6, FALSE, FALSE, 0); |