/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Claws Mail team
- * This file (C) 2004 Colin Leroy
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2007 Colin Leroy <colin@colino.net>
+ * and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
*/
#ifdef HAVE_CONFIG_H
#include "setup.h"
#include "folder.h"
#include "alertpanel.h"
-#ifdef USE_OPENSSL
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
#include "ssl.h"
#endif
#include "prefs_common.h"
+#include "combobox.h"
+
+#ifdef MAEMO
+#include <libgnomevfs/gnome-vfs-volume.h>
+#include <libgnomevfs/gnome-vfs-volume-monitor.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
+#endif
typedef enum
{
int SMTP_PAGE = -1;
int RECV_PAGE = -1;
int MAILBOX_PAGE = -1;
-int SSL_PAGE = -1;
int DONE_PAGE = -1;
typedef struct
GtkWidget *organization;
GtkWidget *mailbox_name;
+ GtkWidget *mailbox_label;
GtkWidget *smtp_server;
GtkWidget *smtp_auth;
GtkWidget *recv_password_label;
GtkWidget *recv_imap_label;
GtkWidget *recv_imap_subdir;
+ GtkWidget *subsonly_checkbtn;
GtkWidget *no_imap_warning;
-#ifdef USE_OPENSSL
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
GtkWidget *smtp_use_ssl;
GtkWidget *recv_use_ssl;
+ GtkWidget *smtp_use_tls;
+ GtkWidget *recv_use_tls;
#endif
-
+
+#ifdef MAEMO
+ GtkWidget *data_root_nokia_radiobtn;
+ GtkWidget *data_root_mmc1_radiobtn;
+ GtkWidget *data_root_mmc2_radiobtn;
+ GnomeVFSVolumeMonitor *volmon;
+ gulong volmon_mount_sigid;
+ gulong volmon_unmount_sigid;
+ GnomeVFSVolume *vol_mmc1;
+ GnomeVFSVolume *vol_mmc2;
+#endif
gboolean create_mailbox;
gboolean finished;
gboolean result;
gchar *recvuser;
gchar *recvpass;
gchar *imapdir;
+ gboolean subsonly;
gchar *mboxfile;
gchar *mailbox;
gboolean smtpssl;
&tmpl.recvpass, P_STRING, NULL, NULL, NULL},
{"imapdir", "",
&tmpl.imapdir, P_STRING, NULL, NULL, NULL},
+ {"subsonly", "TRUE",
+ &tmpl.subsonly, P_BOOL, NULL, NULL, NULL},
{"mboxfile", "/var/mail/$LOGIN",
&tmpl.mboxfile, P_STRING, NULL, NULL, NULL},
{"mailbox", "Mail",
&tmpl.mailbox, P_STRING, NULL, NULL, NULL},
- {"smtpssl", "FALSE",
- &tmpl.smtpssl, P_BOOL, NULL, NULL, NULL},
- {"recvssl", "FALSE",
- &tmpl.recvssl, P_BOOL, NULL, NULL, NULL},
+ {"smtpssl", "0",
+ &tmpl.smtpssl, P_INT, NULL, NULL, NULL},
+ {"recvssl", "0",
+ &tmpl.recvssl, P_INT, NULL, NULL, NULL},
{NULL, NULL, NULL, P_INT, NULL, NULL, NULL}
};
"#default is empty\n"
"#recvpass=\n"
"\n"
- "#imap dir if imap (relative to the home on the server\n"
+ "#imap dir if imap (relative to the home on the server)\n"
"#default is empty\n"
"#imapdir=\n"
"\n"
+ "#show subscribed folders only, if imap\n"
+ "#default is TRUE\n"
+ "#subsonly=\n"
+ "\n"
"#mbox file if local\n"
"#you can use $LOGIN here\n"
"#default is /var/mail/$LOGIN\n"
"#mailbox=\n"
"\n"
"#whether to use ssl on STMP connections\n"
- "#default is 0\n"
+ "#default is 0, 1 is ssl, 2 is starttls\n"
"#smtpssl=\n"
"\n"
"#whether to use ssl on pop or imap connections\n"
- "#default is 0\n"
+ "#default is 0, 1 is ssl, 2 is starttls\n"
"#recvssl=\n";
static gchar *wizard_get_default_domain_name(void)
PARSE_DEFAULT(tmpl.mboxfile);
PARSE_DEFAULT(tmpl.mailbox);
/*
- printf("defaults:"
+ g_print("defaults:"
"%s, %s, %s, %s, %s, %d, %s, %s, %s, %s, %s, %s, %d, %d\n",
tmpl.name,tmpl.domain,tmpl.email,tmpl.organization,tmpl.smtpserver,
tmpl.recvtype,tmpl.recvserver,tmpl.recvuser,tmpl.recvpass,
}
#define XFACE "+}Axz@~a,-Yx?0Ysa|q}CLRH=89Y]\"')DSX^<6p\"d)'81yx5%G#u^o*7JG&[aPU0h1Ux.vb2yIjH83{5`/bVo|~nn/i83vE^E)qk-4W)_E.4Y=D*qvf/,Ci_=P<iY<M6"
-#define FACE "iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEUTGBYnS3BCUE9KVC9acyRy\n\
- kC6LjITZdGiumnF/p7yrq6jJzc/5+vf7GI+IAAACZ0lEQVQ4y5XUvW/UMBQA8LRl6VZ3QLqNNhVS\n\
- YSnKFfExEg9lbJNK3QqVoiPHzgpFnAIs5Do9ORNDVOwuFVIgduZWOfuP4vlyybVVkeCdTpHe7z1/\n\
- RHYc85dw/gEUxi2gS5ZlDKqbUDcpzarroMEOpDU2VtcAmFKlxn+t2VWQUNa1BmAlGrsCqWKMwetv\n\
- MMbnFaixFn9rh47DFCuzDs6hxPyrxXuOA7WqWQcp2Fhx7gTOcga6bGHSS6FHCHFouLcMJptuaQbp\n\
- +kff90P6Yn0TMpXN4DxNVz+FQZ8Gob8DGWSsBUIG23seDXwaBBnU0EJKVhNvqx/6aHTHrmMGhNw9\n\
- XlqkgbdEX/gh1PUcVj84G4HnuHTXDQ+6Dk3IyqFL/UfEpXvj7RChaoEsUX9rYeGE7o83wp0WcCjS\n\
- 9/01AifhLrj0oINeuuJ53kIP+uF+7uL03eQpGWx5yzDu05fM3Z53AJDkvdODwvOfmbH3uOuwcLz+\n\
- UBWLR8/N+MHnDsoeG4zecDl5Mhqa74NR90p+VEYmo+ioSEan8WnytANhDB8kX06TJFZJcowvfrZz\n\
- XIMS2vxMIlHJfHMTRLOqC7TovlJFEVVGF7yafFVTkGgij+I851hZCHP5Tk8BWXObjuxhl2fm8pdu\n\
- O0wluZDKHgJ91nVMKhuKN6cZQf9uQAs85lrjGDYmwmqzDynwClRKTCF/OwfDub0dQyzHxVUt6DzK\n\
- eY5NseIxb8abwoVSMpZDhJyL9kJamGAxplC7izkHyaXM5/nZHFiNeRHfBFNwLjhOr+fAmw1G3OYl\n\
- bwoijGGzD40pdeu3ROv/+Pr8AWPP4vVXbP0VAAAAAElFTkSuQmCC"
+#define FACE "iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAM1BMVEUAAAAcJCI\n\
+ ONl1JUi0+Z4daY2NZciPabV9ykS5kj6Wsl2ybmZOBsMjZxK2wzN3Pzczs7OsCAGN0AAAAAXRSTlM\n\
+ AQObYZgAAAAFiS0dEAIgFHUgAAAIVSURBVEjH1ZbtlqMgDIaFECoGhPu/2s0b0Lais/NzN6d1OJ7\n\
+ 3yReQzrL8B5Zy3rvl9At52Pf2tv1vSMjtYj8jaa8XUyI/yn3YD6sigj/2Tf5Bn069MIsTPHvx/t5\n\
+ /3rU/6JCIY3YwGe26r/cwUfE3cFe5T28L0K5rJAUHEeYAQxs8DHojjk3M9wECU4xxjXisI8RA0gy\n\
+ oczJZJOjxiTFZVTchAnIRJrgdmEGDyFfAI3UuG5FmYTkR9RDrIC4H0SqV4pzpEcUp0HNLjwBv+jA\n\
+ dikUE5g9iBvzmu3sH2oDk4lnHd829+2Q9gj6kDqDPg7hsGwBzH02fE3ZCt6ZHmlNKIMjMeRwra5I\n\
+ ecgNoBnLGPmzaHPJIwLY8Sq2M/tLUJfj0QcqmfVXAdLSStIYF8dzWjBBb2VgvDa4mO9oc651OiUo\n\
+ BEKbZokdPATF9E9oKAjQJcJOniaPXrVZRAnVWaqIyqRoNC8ZJvgCcW8XN39RqxVP1rS8Yd4WnCdN\n\
+ aRTo2jJRDbg3vtCpEUGffgDPhqKDaSuVqYtOplFIvIcx3HUI5/MuIWl6vKyBjNlqEru8hbFXqBPA\n\
+ 5TpHGIUZOePeaIyzfQ/g9Xg0opU1AvdfXM9floYhv92pPAE96OZtkPV8eivgQi9RTfwPUU36I26n\n\
+ Hy+WuCJzAT7efMSeA1TNf2/VugDz+dN139xfA5ffxGZDD+MvcP/uvyB80wzZ76wbz8gAAAABJRU5\n\
+ ErkJggg=="
static void write_welcome_email(WizardWindow *wizard)
{
gchar *head=NULL;
gchar *body=NULL;
gchar *msg=NULL;
- gchar *subj=NULL;
const gchar *mailbox = gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name));
Folder *folder = folder_find_from_path(mailbox);
FolderItem *inbox = folder ? folder->inbox:NULL;
gchar *file = get_tmp_file();
+ gchar enc_from_name[BUFFSIZE], enc_to_name[BUFFSIZE], enc_subject[BUFFSIZE];
get_rfc822_date(buf_date, sizeof(buf_date));
- subj = g_strdup_printf(_("Welcome to Claws Mail "));
+ conv_encode_header_full(enc_subject, sizeof(enc_subject),
+ Q_("Welcome Mail Subject|Welcome to Claws Mail"),
+ strlen("Subject: "), FALSE, CS_INTERNAL);
+ conv_encode_header_full(enc_to_name, sizeof(enc_to_name),
+ gtk_entry_get_text(GTK_ENTRY(wizard->full_name)),
+ strlen("To: "), TRUE, CS_INTERNAL);
+ conv_encode_header_full(enc_from_name, sizeof(enc_from_name),
+ _("The Claws Mail Team"),
+ strlen("From: "), TRUE, CS_INTERNAL);
head = g_strdup_printf(
"From: %s <%s>\n"
"X-Face: %s\n"
"Face: %s\n"
"Content-Type: text/plain; charset=UTF-8\n",
- _("Claws Mail Team"),
+ enc_from_name,
USERS_ML_ADDR,
- gtk_entry_get_text(GTK_ENTRY(wizard->full_name)),
+ enc_to_name,
gtk_entry_get_text(GTK_ENTRY(wizard->email)),
- buf_date, subj, XFACE, FACE);
+ buf_date, enc_subject, XFACE, FACE);
body = g_strdup_printf(
_("\n"
"Welcome to Claws Mail\n"
- "-------------------------\n"
+ "---------------------\n"
"\n"
"Now that you have set up your account you can fetch your\n"
"mail by clicking the 'Get Mail' button at the left of the\n"
"LICENSE\n"
"-------\n"
"Claws Mail is free software, released under the terms\n"
- "of the GNU General Public License, version 2 or later, as\n"
+ "of the GNU General Public License, version 3 or later, as\n"
"published by the Free Software Foundation, 51 Franklin Street,\n"
"Fifth Floor, Boston, MA 02110-1301, USA. The license can be\n"
"found at <%s>.\n"
MsgFlags flags = { MSG_UNREAD|MSG_NEW, 0};
folder_item_add_msg(inbox, file, &flags, FALSE);
}
- g_free(subj);
g_free(head);
g_free(body);
g_free(msg);
static gboolean mailbox_ok = FALSE;
PrefsAccount *prefs_account = prefs_account_new();
GList *account_list = NULL;
- GtkWidget *menu, *menuitem;
-
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(wizard->recv_type));
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- prefs_account->protocol = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
-
+ gchar *smtp_server, *recv_server;
+ gint smtp_port, recv_port;
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
+ SSLType smtp_ssl_type, recv_ssl_type;
+#endif
+
+ prefs_account->protocol = combobox_get_active_data(
+ GTK_COMBO_BOX(wizard->recv_type));
if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4 &&
!strlen(gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)))) {
return FALSE;
}
+#ifdef MAEMO
+ if (wizard->create_mailbox) {
+ g_free(prefs_common.data_root);
+ if (gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn)))
+ prefs_common.data_root = NULL;
+ else if (gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_mmc1_radiobtn)))
+ prefs_common.data_root = g_strdup(MMC1_PATH);
+ else if (gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_mmc2_radiobtn)))
+ prefs_common.data_root = g_strdup(MMC2_PATH);
+ }
+#endif
+
if (!mailbox_ok) {
if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4) {
mailbox_ok = setup_write_mailbox_path(wizard->mainwin,
prefs_account->account_name = g_strdup_printf("%s",
gtk_entry_get_text(GTK_ENTRY(wizard->recv_server)));
+ recv_server = g_strdup(gtk_entry_get_text(GTK_ENTRY(wizard->recv_server)));
+ smtp_server = g_strdup(gtk_entry_get_text(GTK_ENTRY(wizard->smtp_server)));
+
+ if (prefs_account->protocol != A_LOCAL && strstr(recv_server, ":")) {
+ recv_port = atoi(strstr(recv_server, ":")+1);
+ *(strstr(recv_server, ":")) = '\0';
+ if (prefs_account->protocol == A_IMAP4) {
+ prefs_account->set_imapport = TRUE;
+ prefs_account->imapport = recv_port;
+ } else if (prefs_account->protocol == A_POP3) {
+ prefs_account->set_popport = TRUE;
+ prefs_account->popport = recv_port;
+ }
+ }
+ if (strstr(smtp_server, ":")) {
+ smtp_port = atoi(strstr(smtp_server, ":")+1);
+ *(strstr(smtp_server, ":")) = '\0';
+ prefs_account->set_smtpport = TRUE;
+ prefs_account->smtpport = smtp_port;
+ }
+
prefs_account->name = g_strdup(
gtk_entry_get_text(GTK_ENTRY(wizard->full_name)));
prefs_account->address = g_strdup(
gtk_entry_get_text(GTK_ENTRY(wizard->email)));
prefs_account->organization = g_strdup(
gtk_entry_get_text(GTK_ENTRY(wizard->organization)));
- prefs_account->smtp_server = g_strdup(
- gtk_entry_get_text(GTK_ENTRY(wizard->smtp_server)));
+ prefs_account->smtp_server = g_strdup(smtp_server);
+
+ if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4) {
+ gchar *tmp;
+ tmp = g_path_get_basename(gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)));
+ prefs_account->inbox = g_strdup_printf("#mh/%s/inbox",
+ (!strcmp("Mail", gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name))))
+ ?_("Mailbox"):tmp);
+ g_free(tmp);
+ prefs_account->local_inbox = g_strdup(prefs_account->inbox);
+ } else if (prefs_account->protocol != A_IMAP4) {
+ if (folder_get_default_inbox())
+ prefs_account->local_inbox =
+ folder_item_get_identifier(folder_get_default_inbox());
+ }
if (prefs_account->protocol != A_LOCAL)
- prefs_account->recv_server = g_strdup(
- gtk_entry_get_text(GTK_ENTRY(wizard->recv_server)));
+ prefs_account->recv_server = g_strdup(recv_server);
else
- prefs_account->local_mbox = g_strdup(
- gtk_entry_get_text(GTK_ENTRY(wizard->recv_server)));
+ prefs_account->local_mbox = g_strdup(recv_server);
+
+ g_free(recv_server);
+ g_free(smtp_server);
prefs_account->userid = g_strdup(
gtk_entry_get_text(GTK_ENTRY(wizard->recv_username)));
prefs_account->use_smtp_auth = TRUE;
}
-#ifdef USE_OPENSSL
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wizard->smtp_use_ssl)))
- prefs_account->ssl_smtp = SSL_TUNNEL;
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
+ smtp_ssl_type = SSL_NONE;
+ recv_ssl_type = SSL_NONE;
+
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wizard->smtp_use_ssl))) {
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wizard->smtp_use_tls)))
+ smtp_ssl_type = SSL_STARTTLS;
+ else
+ smtp_ssl_type = SSL_TUNNEL;
+ }
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wizard->recv_use_ssl))) {
- if (prefs_account->protocol == A_IMAP4)
- prefs_account->ssl_imap = SSL_TUNNEL;
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wizard->recv_use_tls)))
+ recv_ssl_type = SSL_STARTTLS;
else
- prefs_account->ssl_pop = SSL_TUNNEL;
+ recv_ssl_type = SSL_TUNNEL;
}
+
+ prefs_account->ssl_smtp = smtp_ssl_type;
+
+ if (prefs_account->protocol == A_IMAP4)
+ prefs_account->ssl_imap = recv_ssl_type;
+ else
+ prefs_account->ssl_pop = recv_ssl_type;
+
#endif
if (prefs_account->protocol == A_IMAP4) {
gchar *directory = gtk_editable_get_chars(
if (directory && strlen(directory)) {
prefs_account->imap_dir = g_strdup(directory);
}
+ prefs_account->imap_subsonly =
+ gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(wizard->subsonly_checkbtn));
g_free(directory);
}
initialize_fonts(wizard);
if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4)
write_welcome_email(wizard);
-
+
+#ifdef MAEMO
+ if (wizard->volmon_mount_sigid)
+ g_signal_handler_disconnect(
+ G_OBJECT(wizard->volmon),
+ wizard->volmon_mount_sigid);
+ if (wizard->volmon_unmount_sigid)
+ g_signal_handler_disconnect(
+ G_OBJECT(wizard->volmon),
+ wizard->volmon_unmount_sigid);
+#endif
+
#ifndef G_OS_WIN32
plugin_load_standard_plugins();
#endif
return vbox;
}
-#define GTK_TABLE_ADD_ROW_AT(table,text,entry,i) { \
- GtkWidget *label = gtk_label_new(text); \
- gtk_table_attach(GTK_TABLE(table), label, \
- 0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0); \
- gtk_label_set_use_markup(GTK_LABEL(label), TRUE); \
- if (GTK_IS_MISC(label)) \
- gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); \
- gtk_table_attach(GTK_TABLE(table), entry, \
- 1,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0); \
+#define PACK_BOX(hbox,text,entry) { \
+ GtkWidget *label = gtk_label_new(text); \
+ gtk_label_set_use_markup(GTK_LABEL(label), TRUE); \
+ if (GTK_IS_MISC(label)) \
+ gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); \
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); \
+ gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0); \
}
static gchar *get_default_server(WizardWindow * wizard, const gchar *type)
WizardWindow *wizard = (WizardWindow *)data;
RecvProtocol protocol;
gchar *text;
- protocol = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(wizard->recv_type), MENU_VAL_ID));
+ protocol = combobox_get_active_data(GTK_COMBO_BOX(wizard->recv_type));
text = get_default_server(wizard, "smtp");
gtk_entry_set_text(GTK_ENTRY(wizard->smtp_server), text);
static GtkWidget* user_page (WizardWindow * wizard)
{
- GtkWidget *table = gtk_table_new(3,2, FALSE);
- gint i = 0;
+ GtkWidget *table = gtk_table_new(1,1, FALSE);
+ GtkWidget *vbox;
+ GtkWidget *hbox;
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+ vbox = gtk_vbox_new(FALSE, VSPACING_NARROW);
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), VSPACING_NARROW_2);
+
+ gtk_table_attach(GTK_TABLE(table), vbox, 0,1,1,2,
+ GTK_EXPAND|GTK_FILL, 0, 0, 0);
+
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->full_name = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(wizard->full_name), tmpl.name?tmpl.name:"");
- GTK_TABLE_ADD_ROW_AT(table, _("<span weight=\"bold\">Your name:</span>"),
- wizard->full_name, i); i++;
+ PACK_BOX(hbox, _("<span weight=\"bold\">Your name:</span>"),
+ wizard->full_name);
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->email = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(wizard->email), tmpl.email?tmpl.email:"");
- GTK_TABLE_ADD_ROW_AT(table, _("<span weight=\"bold\">Your email address:</span>"),
- wizard->email, i); i++;
+ PACK_BOX(hbox, _("<span weight=\"bold\">Your email address:</span>"),
+ wizard->email);
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->organization = gtk_entry_new();
- GTK_TABLE_ADD_ROW_AT(table, _("Your organization:"),
- wizard->organization, i); i++;
gtk_entry_set_text(GTK_ENTRY(wizard->organization), tmpl.organization?tmpl.organization:"");
+ PACK_BOX(hbox, _("Your organization:"), wizard->organization);
g_signal_connect(G_OBJECT(wizard->email), "changed",
G_CALLBACK(wizard_email_changed),
return table;
}
+#ifdef MAEMO
+static void wizard_vol_mount_cb(GnomeVFSVolumeMonitor *vfs, GnomeVFSVolume *vol, WizardWindow *wizard)
+{
+ gchar *uri = gnome_vfs_volume_get_activation_uri (vol);
+ gchar *mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+ g_free (uri);
+ if (mount_path) {
+ if(!strcmp(mount_path, MMC1_PATH)) {
+ gtk_widget_set_sensitive(wizard->data_root_mmc1_radiobtn, TRUE);
+ }
+ if(!strcmp(mount_path, MMC2_PATH)) {
+ gtk_widget_set_sensitive(wizard->data_root_mmc2_radiobtn, TRUE);
+ }
+ }
+ g_free(mount_path);
+}
+static void wizard_vol_unmount_cb(GnomeVFSVolumeMonitor *vfs, GnomeVFSVolume *vol, WizardWindow *wizard)
+{
+ gchar *uri = gnome_vfs_volume_get_activation_uri (vol);
+ gchar *mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+ g_free (uri);
+ if (mount_path) {
+ if(!strcmp(mount_path, MMC1_PATH)) {
+ gtk_widget_set_sensitive(wizard->data_root_mmc1_radiobtn, FALSE);
+ if (gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_mmc1_radiobtn))) {
+ gtk_toggle_button_set_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn), TRUE);
+ }
+ }
+ if(!strcmp(mount_path, MMC2_PATH)) {
+ gtk_widget_set_sensitive(wizard->data_root_mmc2_radiobtn, FALSE);
+ if (gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_mmc2_radiobtn))) {
+ gtk_toggle_button_set_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn), TRUE);
+ }
+ }
+ }
+ g_free(mount_path);
+}
+
+void data_root_changed (GtkToggleButton *toggle_btn,
+ WizardWindow *wizard)
+{
+ gchar *name = g_path_get_basename(gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)));
+ gchar *path = NULL;
+ if (gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn)))
+ gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), name);
+ else if (gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_mmc1_radiobtn))) {
+ path = g_strconcat(MMC1_PATH, G_DIR_SEPARATOR_S,
+ "Claws", G_DIR_SEPARATOR_S,
+ g_get_user_name(), G_DIR_SEPARATOR_S,
+ name, NULL);
+ gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), path);
+ g_free(path);
+ } else if (gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(wizard->data_root_mmc2_radiobtn))) {
+ path = g_strconcat(MMC2_PATH, G_DIR_SEPARATOR_S,
+ "Claws", G_DIR_SEPARATOR_S,
+ g_get_user_name(), G_DIR_SEPARATOR_S,
+ name, NULL);
+ gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), path);
+ g_free(path);
+ }
+ g_free(name);
+}
+#endif
+
static GtkWidget* mailbox_page (WizardWindow * wizard)
{
- GtkWidget *table = gtk_table_new(1,2, FALSE);
- gint i = 0;
-
+ GtkWidget *table = gtk_table_new(1,1, FALSE);
+ GtkWidget *vbox;
+#ifdef MAEMO
+ GtkWidget *vbox2;
+ gchar *uri, *mount_path;
+#endif
+ GtkWidget *hbox;
+ GtkTooltips *tips = gtk_tooltips_new();
+
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+ vbox = gtk_vbox_new(FALSE, VSPACING_NARROW);
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), VSPACING_NARROW_2);
+
+ gtk_table_attach(GTK_TABLE(table), vbox, 0,1,1,2,
+ GTK_EXPAND|GTK_FILL, 0, 0, 0);
+
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+ wizard->mailbox_label = gtk_label_new(_("<span weight=\"bold\">Mailbox name:</span>"));
+ gtk_label_set_use_markup(GTK_LABEL(wizard->mailbox_label), TRUE);
+ if (GTK_IS_MISC(wizard->mailbox_label))
+ gtk_misc_set_alignment(GTK_MISC(wizard->mailbox_label), 1, 0.5);
wizard->mailbox_name = gtk_entry_new();
+
gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), tmpl.mailbox?tmpl.mailbox:"");
- GTK_TABLE_ADD_ROW_AT(table, _("<span weight=\"bold\">Mailbox name:</span>"),
- wizard->mailbox_name, i); i++;
+
+ gtk_tooltips_set_tip(GTK_TOOLTIPS(tips), wizard->mailbox_name,
+ _("You can also specify an absolute path, for example: "
+ "\"/home/john/Documents/Mail\""),
+ NULL);
+
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->mailbox_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->mailbox_name, TRUE, TRUE, 0);
+
+#ifdef MAEMO
+ wizard->data_root_nokia_radiobtn = gtk_radio_button_new_with_label(NULL,
+ _("on internal memory"));
+ wizard->data_root_mmc1_radiobtn = gtk_radio_button_new_with_label_from_widget(
+ GTK_RADIO_BUTTON(wizard->data_root_nokia_radiobtn),
+ _("on /media/mmc1"));
+ wizard->data_root_mmc2_radiobtn = gtk_radio_button_new_with_label_from_widget(
+ GTK_RADIO_BUTTON(wizard->data_root_nokia_radiobtn),
+ _("on /media/mmc2"));
+
+ g_signal_connect(G_OBJECT(wizard->data_root_nokia_radiobtn), "toggled",
+ G_CALLBACK(data_root_changed), wizard);
+ g_signal_connect(G_OBJECT(wizard->data_root_mmc1_radiobtn), "toggled",
+ G_CALLBACK(data_root_changed), wizard);
+ g_signal_connect(G_OBJECT(wizard->data_root_mmc2_radiobtn), "toggled",
+ G_CALLBACK(data_root_changed), wizard);
+
+ wizard->volmon = gnome_vfs_get_volume_monitor();
+ wizard->vol_mmc1 = gnome_vfs_volume_monitor_get_volume_for_path(wizard->volmon, MMC1_PATH);
+ wizard->vol_mmc2 = gnome_vfs_volume_monitor_get_volume_for_path(wizard->volmon, MMC2_PATH);
+
+ uri = gnome_vfs_volume_get_activation_uri (wizard->vol_mmc1);
+ mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+ g_free(uri);
+ if (wizard->vol_mmc1 == NULL || !gnome_vfs_volume_is_mounted(wizard->vol_mmc1)
+ || strcmp(mount_path, MMC1_PATH)) {
+ gtk_widget_set_sensitive(wizard->data_root_mmc1_radiobtn, FALSE);
+ }
+ g_free(mount_path);
+
+ uri = gnome_vfs_volume_get_activation_uri (wizard->vol_mmc2);
+ mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+ g_free(uri);
+ if (wizard->vol_mmc2 == NULL || !gnome_vfs_volume_is_mounted(wizard->vol_mmc2)
+ || strcmp(mount_path, MMC2_PATH)) {
+ gtk_widget_set_sensitive(wizard->data_root_mmc2_radiobtn, FALSE);
+ }
+ g_free(mount_path);
+ gnome_vfs_volume_unref(wizard->vol_mmc1);
+ gnome_vfs_volume_unref(wizard->vol_mmc2);
+ wizard->vol_mmc1 = NULL;
+ wizard->vol_mmc2 = NULL;
+
+ wizard->volmon_mount_sigid = g_signal_connect(G_OBJECT(wizard->volmon),
+ "volume-mounted", G_CALLBACK(wizard_vol_mount_cb), wizard);
+ wizard->volmon_unmount_sigid = g_signal_connect(G_OBJECT(wizard->volmon),
+ "volume-unmounted", G_CALLBACK(wizard_vol_unmount_cb), wizard);
+
+ vbox2 = gtk_vbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox2), wizard->data_root_nokia_radiobtn, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX(vbox2), wizard->data_root_mmc1_radiobtn, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX(vbox2), wizard->data_root_mmc2_radiobtn, FALSE, FALSE, 0);
+
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ PACK_BOX(hbox, _("<span weight=\"bold\">Store data</span>"),
+ vbox2);
+#endif
+
return table;
}
static GtkWidget* smtp_page (WizardWindow * wizard)
{
- GtkWidget *table = gtk_table_new(1,4, FALSE);
+ GtkWidget *table = gtk_table_new(1, 1, FALSE);
+ GtkWidget *vbox;
+ GtkWidget *hbox;
+ GtkTooltips *tips = gtk_tooltips_new();
gchar *text;
- gint i = 0;
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+ vbox = gtk_vbox_new(FALSE, VSPACING_NARROW);
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), VSPACING_NARROW_2);
+
+ gtk_table_attach(GTK_TABLE(table), vbox, 0,1,1,2,
+ GTK_EXPAND|GTK_FILL, 0, 0, 0);
+
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->smtp_server = gtk_entry_new();
text = get_default_server(wizard, "smtp");
gtk_entry_set_text(GTK_ENTRY(wizard->smtp_server), text);
g_free(text);
- GTK_TABLE_ADD_ROW_AT(table, _("<span weight=\"bold\">SMTP server address:</span>"),
- wizard->smtp_server, i); i++;
+
+ gtk_tooltips_set_tip(GTK_TOOLTIPS(tips), wizard->smtp_server,
+ _("You can specify the port number by appending it at the end: "
+ "\"mail.example.com:25\""),
+ NULL);
+
+ PACK_BOX(hbox, _("<span weight=\"bold\">SMTP server address:</span>"),
+ wizard->smtp_server);
+
+
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->smtp_auth = gtk_check_button_new_with_label(
_("Use authentication"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->smtp_auth),
g_signal_connect(G_OBJECT(wizard->smtp_auth), "toggled",
G_CALLBACK(smtp_auth_changed),
wizard);
- gtk_table_attach(GTK_TABLE(table), wizard->smtp_auth,
- 0,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0); i++;
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_auth, FALSE, FALSE, 0);
text = get_default_smtp_account(wizard);
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->smtp_username = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(wizard->smtp_username), text);
g_free(text);
wizard->smtp_username_label = gtk_label_new(_("SMTP username:\n"
- "<span size=\"small\">(empty to use the same as reception)</span>"));
+ "<span size=\"small\">(empty to use the same as receive)</span>"));
gtk_label_set_use_markup(GTK_LABEL(wizard->smtp_username_label), TRUE);
- gtk_table_attach(GTK_TABLE(table), wizard->smtp_username_label,
- 0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
if (GTK_IS_MISC(wizard->smtp_username_label))
gtk_misc_set_alignment(GTK_MISC(wizard->smtp_username_label), 1, 0.5);
- gtk_table_attach(GTK_TABLE(table), wizard->smtp_username,
- 1,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
- i++;
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_username_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_username, TRUE, TRUE, 0);
+
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->smtp_password = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(wizard->smtp_password), tmpl.smtppass?tmpl.smtppass:"");
gtk_entry_set_visibility(GTK_ENTRY(wizard->smtp_password), FALSE);
wizard->smtp_password_label = gtk_label_new(_("SMTP password:\n"
- "<span size=\"small\">(empty to use the same as reception)</span>"));
+ "<span size=\"small\">(empty to use the same as receive)</span>"));
gtk_label_set_use_markup(GTK_LABEL(wizard->smtp_password_label), TRUE);
- gtk_table_attach(GTK_TABLE(table), wizard->smtp_password_label,
- 0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
if (GTK_IS_MISC(wizard->smtp_password_label))
gtk_misc_set_alignment(GTK_MISC(wizard->smtp_password_label), 1, 0.5);
- gtk_table_attach(GTK_TABLE(table), wizard->smtp_password,
- 1,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
- i++;
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_password_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_password, TRUE, TRUE, 0);
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ wizard->smtp_use_ssl = gtk_check_button_new_with_label(
+ _("Use SSL to connect to SMTP server"));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->smtp_use_ssl),
+ tmpl.smtpssl != 0);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_use_ssl, FALSE, FALSE, 0);
+
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ wizard->smtp_use_tls = gtk_check_button_new_with_label(
+ _("Use SSL via STARTTLS"));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->smtp_use_tls),
+ tmpl.smtpssl == 2);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_use_tls, FALSE, FALSE, 0);
+ SET_TOGGLE_SENSITIVITY (wizard->smtp_use_ssl, wizard->smtp_use_tls);
+#endif
smtp_auth_changed(NULL, wizard);
return table;
}
gtk_entry_set_text(GTK_ENTRY(wizard->recv_server), text);
gtk_widget_hide(wizard->recv_imap_label);
gtk_widget_hide(wizard->recv_imap_subdir);
+ gtk_widget_hide(wizard->subsonly_checkbtn);
gtk_widget_show(wizard->recv_username);
gtk_widget_show(wizard->recv_password);
gtk_widget_show(wizard->recv_username_label);
gtk_widget_show(wizard->recv_password_label);
gtk_widget_hide(wizard->no_imap_warning);
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
+ gtk_widget_show(wizard->recv_use_ssl);
+ gtk_widget_show(wizard->recv_use_tls);
+#endif
gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Server address:</span>"));
gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
g_free(text);
+ if (wizard->create_mailbox) {
+ gtk_widget_show(wizard->mailbox_label);
+ gtk_widget_show(wizard->mailbox_name);
+ }
} else if (protocol == A_IMAP4) {
#ifdef HAVE_LIBETPAN
text = get_default_server(wizard, "imap");
gtk_entry_set_text(GTK_ENTRY(wizard->recv_server), text);
gtk_widget_show(wizard->recv_imap_label);
gtk_widget_show(wizard->recv_imap_subdir);
+ gtk_widget_show(wizard->subsonly_checkbtn);
gtk_widget_show(wizard->recv_username);
gtk_widget_show(wizard->recv_password);
gtk_widget_show(wizard->recv_username_label);
gtk_widget_show(wizard->recv_password_label);
gtk_widget_hide(wizard->no_imap_warning);
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
+ gtk_widget_show(wizard->recv_use_ssl);
+ gtk_widget_show(wizard->recv_use_tls);
+#endif
gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Server address:</span>"));
gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
g_free(text);
+ if (wizard->create_mailbox) {
+ gtk_widget_hide(wizard->mailbox_label);
+ gtk_widget_hide(wizard->mailbox_name);
+ }
#else
gtk_widget_hide(wizard->recv_imap_label);
gtk_widget_hide(wizard->recv_imap_subdir);
+ gtk_widget_hide(wizard->subsonly_checkbtn);
gtk_widget_hide(wizard->recv_username);
gtk_widget_hide(wizard->recv_password);
gtk_widget_hide(wizard->recv_username_label);
gtk_widget_hide(wizard->recv_password_label);
gtk_widget_show(wizard->no_imap_warning);
+ if (wizard->create_mailbox) {
+ gtk_widget_hide(wizard->mailbox_label);
+ gtk_widget_hide(wizard->mailbox_name);
+ }
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
+ gtk_widget_hide(wizard->recv_use_ssl);
+ gtk_widget_hide(wizard->recv_use_tls);
+#endif
gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, FALSE);
#endif
} else if (protocol == A_LOCAL) {
gtk_widget_hide(wizard->no_imap_warning);
gtk_widget_hide(wizard->recv_imap_label);
gtk_widget_hide(wizard->recv_imap_subdir);
+ gtk_widget_hide(wizard->subsonly_checkbtn);
gtk_widget_hide(wizard->recv_username);
gtk_widget_hide(wizard->recv_password);
gtk_widget_hide(wizard->recv_username_label);
gtk_widget_hide(wizard->recv_password_label);
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
+ gtk_widget_hide(wizard->recv_use_ssl);
+ gtk_widget_hide(wizard->recv_use_tls);
+#endif
+ if (wizard->create_mailbox) {
+ gtk_widget_show(wizard->mailbox_label);
+ gtk_widget_show(wizard->mailbox_name);
+ }
gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
}
}
-static void wizard_protocol_changed(GtkMenuItem *menuitem, gpointer data)
+static void wizard_protocol_changed(GtkComboBox *combo, gpointer data)
{
WizardWindow *wizard = (WizardWindow *)data;
- RecvProtocol protocol;
- protocol = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+ RecvProtocol protocol = combobox_get_active_data(combo);
wizard_protocol_change(wizard, protocol);
}
static GtkWidget* recv_page (WizardWindow * wizard)
{
- GtkWidget *table = gtk_table_new(5,2, FALSE);
- GtkWidget *menu = gtk_menu_new();
- GtkWidget *menuitem;
+ GtkWidget *table = gtk_table_new(1,1, FALSE);
+ GtkTooltips *tips = gtk_tooltips_new();
+ GtkWidget *vbox;
+ GtkWidget *hbox;
+ GtkListStore *store;
+ GtkTreeIter iter;
gchar *text;
- gint i = 0;
gint index = 0;
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
- wizard->recv_type = gtk_option_menu_new();
-
- MENUITEM_ADD (menu, menuitem, _("POP3"), A_POP3);
- g_signal_connect(G_OBJECT(menuitem), "activate",
- G_CALLBACK(wizard_protocol_changed),
- wizard);
+ vbox = gtk_vbox_new(FALSE, VSPACING_NARROW);
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), VSPACING_NARROW_2);
- MENUITEM_ADD (menu, menuitem, _("IMAP"), A_IMAP4);
- g_signal_connect(G_OBJECT(menuitem), "activate",
- G_CALLBACK(wizard_protocol_changed),
- wizard);
+ gtk_table_attach(GTK_TABLE(table), vbox, 0,1,1,2,
+ GTK_EXPAND|GTK_FILL, 0, 0, 0);
- MENUITEM_ADD (menu, menuitem, _("Local mbox file"), A_LOCAL);
- g_signal_connect(G_OBJECT(menuitem), "activate",
- G_CALLBACK(wizard_protocol_changed),
- wizard);
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ wizard->recv_type = gtkut_sc_combobox_create(NULL, FALSE);
+ store = GTK_LIST_STORE(gtk_combo_box_get_model(
+ GTK_COMBO_BOX(wizard->recv_type)));
+
+ COMBOBOX_ADD(store, _("POP3"), A_POP3);
+ COMBOBOX_ADD(store, _("IMAP"), A_IMAP4);
+ COMBOBOX_ADD(store, _("Local mbox file"), A_LOCAL);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (wizard->recv_type), menu);
switch(tmpl.recvtype) {
case A_POP3:
index = 0;
default:
index = 0;
}
- gtk_option_menu_set_history(GTK_OPTION_MENU (wizard->recv_type), index);
- GTK_TABLE_ADD_ROW_AT(table, _("<span weight=\"bold\">Server type:</span>"),
- wizard->recv_type, i); i++;
+ gtk_combo_box_set_active(GTK_COMBO_BOX (wizard->recv_type), index);
+ g_signal_connect(G_OBJECT(wizard->recv_type), "changed",
+ G_CALLBACK(wizard_protocol_changed),
+ wizard);
+ PACK_BOX(hbox, _("<span weight=\"bold\">Server type:</span>"),
+ wizard->recv_type);
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->recv_server = gtk_entry_new();
text = get_default_server(wizard, "pop");
gtk_entry_set_text(GTK_ENTRY(wizard->recv_server), text);
g_free(text);
+ gtk_tooltips_set_tip(GTK_TOOLTIPS(tips), wizard->recv_server,
+ _("You can specify the port number by appending it at the end: "
+ "\"mail.example.com:110\""),
+ NULL);
+
wizard->recv_label = gtk_label_new(_("<span weight=\"bold\">Server address:</span>"));
gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
- gtk_table_attach(GTK_TABLE(table), wizard->recv_label,
- 0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
if (GTK_IS_MISC(wizard->recv_label))
gtk_misc_set_alignment(GTK_MISC(wizard->recv_label), 1, 0.5);
- gtk_table_attach(GTK_TABLE(table), wizard->recv_server,
- 1,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
- i++;
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_server, TRUE, TRUE, 0);
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->recv_username = gtk_entry_new();
wizard->recv_username_label = gtk_label_new(_("<span weight=\"bold\">Username:</span>"));
gtk_label_set_use_markup(GTK_LABEL(wizard->recv_username_label), TRUE);
- gtk_table_attach(GTK_TABLE(table), wizard->recv_username_label,
- 0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
if (GTK_IS_MISC(wizard->recv_username_label))
gtk_misc_set_alignment(GTK_MISC(wizard->recv_username_label), 1, 0.5);
- gtk_table_attach(GTK_TABLE(table), wizard->recv_username,
- 1,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
- i++;
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_username_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_username, TRUE, TRUE, 0);
text = get_default_account(wizard);
gtk_entry_set_text(GTK_ENTRY(wizard->recv_username), text);
g_free(text);
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->recv_password = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(wizard->recv_password), tmpl.recvpass?tmpl.recvpass:"");
wizard->recv_password_label = gtk_label_new(_("Password:"));
- gtk_table_attach(GTK_TABLE(table), wizard->recv_password_label,
- 0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
if (GTK_IS_MISC(wizard->recv_password_label))
gtk_misc_set_alignment(GTK_MISC(wizard->recv_password_label), 1, 0.5);
- gtk_table_attach(GTK_TABLE(table), wizard->recv_password,
- 1,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
gtk_entry_set_visibility(GTK_ENTRY(wizard->recv_password), FALSE);
- i++;
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_password_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_password, TRUE, TRUE, 0);
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ wizard->recv_use_ssl = gtk_check_button_new_with_label(
+ _("Use SSL to connect to receiving server"));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->recv_use_ssl),
+ tmpl.recvssl != 0);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_use_ssl, FALSE, FALSE, 0);
+
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ wizard->recv_use_tls = gtk_check_button_new_with_label(
+ _("Use SSL via STARTTLS"));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->recv_use_tls),
+ tmpl.recvssl == 2);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_use_tls, FALSE, FALSE, 0);
+ SET_TOGGLE_SENSITIVITY (wizard->recv_use_ssl, wizard->recv_use_tls);
+#endif
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->recv_imap_subdir = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(wizard->recv_imap_subdir), tmpl.imapdir?tmpl.imapdir:"");
wizard->recv_imap_label = gtk_label_new(_("IMAP server directory:"));
-
- gtk_table_attach(GTK_TABLE(table), wizard->recv_imap_label,
- 0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
if (GTK_IS_MISC(wizard->recv_imap_label))
gtk_misc_set_alignment(GTK_MISC(wizard->recv_imap_label), 1, 0.5);
- gtk_table_attach(GTK_TABLE(table), wizard->recv_imap_subdir,
- 1,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
-
- i++;
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_imap_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_imap_subdir, TRUE, TRUE, 0);
+
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ wizard->subsonly_checkbtn = gtk_check_button_new_with_label(
+ _("Show only subscribed folders"));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->subsonly_checkbtn),
+ tmpl.subsonly);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->subsonly_checkbtn, FALSE, FALSE, 0);
+ hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+ gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
wizard->no_imap_warning = gtk_label_new(_(
"<span weight=\"bold\">Warning: this version of Claws Mail\n"
"has been built without IMAP support.</span>"));
gtk_label_set_use_markup(GTK_LABEL(wizard->no_imap_warning), TRUE);
- gtk_table_attach(GTK_TABLE(table), wizard->no_imap_warning,
- 0,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
-
- return table;
-}
-
-#ifdef USE_OPENSSL
-static GtkWidget* ssl_page (WizardWindow * wizard)
-{
- GtkWidget *table = gtk_table_new(2,2, FALSE);
- gint i = 0;
-
- gtk_table_set_row_spacings(GTK_TABLE(table), 4);
- gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+ gtk_box_pack_start(GTK_BOX(hbox), wizard->no_imap_warning, FALSE, FALSE, 0);
- wizard->smtp_use_ssl = gtk_check_button_new_with_label(
- _("Use SSL to connect to SMTP server"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->smtp_use_ssl),
- tmpl.smtpssl);
- gtk_table_attach(GTK_TABLE(table), wizard->smtp_use_ssl,
- 0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0); i++;
-
- wizard->recv_use_ssl = gtk_check_button_new_with_label(
- _("Use SSL to connect to receiving server"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->recv_use_ssl),
- tmpl.recvssl);
- gtk_table_attach(GTK_TABLE(table), wizard->recv_use_ssl,
- 0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
-
return table;
}
-#endif
static void
wizard_response_cb (GtkDialog * dialog, int response, gpointer data)
{
WizardWindow * wizard = (WizardWindow *)data;
int current_page, num_pages;
- GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(wizard->recv_type));
- GtkWidget *menuitem = gtk_menu_get_active(GTK_MENU(menu));
- gint protocol = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
gboolean skip_mailbox_page = FALSE;
-
+#ifndef MAEMO
+ gint protocol = combobox_get_active_data(GTK_COMBO_BOX(wizard->recv_type));
+
if (protocol == A_IMAP4) {
skip_mailbox_page = TRUE;
}
-
+#endif
+
num_pages = g_slist_length(wizard->pages);
current_page = gtk_notebook_get_current_page (
current_page > 0);
gtk_dialog_set_response_sensitive (dialog, GO_FORWARD,
current_page < (num_pages - 1));
- gtk_dialog_set_response_sensitive (dialog, FINISHED,
- current_page == (num_pages - 1));
+ if (current_page == (num_pages -1)) {
+ gtk_dialog_set_response_sensitive (dialog, FINISHED, TRUE);
+ gtk_dialog_set_default_response(GTK_DIALOG(wizard->window), FINISHED);
+ } else {
+ gtk_dialog_set_response_sensitive (dialog, FINISHED, FALSE);
+ gtk_dialog_set_default_response(GTK_DIALOG(wizard->window), GO_FORWARD);
+ }
+
}
}
GtkWidget *page;
GtkWidget *widget;
GtkWidget *label;
+ GtkWidget *scrolled_window;
gchar *text;
GSList *cur;
gboolean result;
"Claws Mail in less than five minutes."));
widget = gtk_label_new(text);
gtk_label_set_line_wrap(GTK_LABEL(widget), TRUE);
+#ifndef MAEMO
gtk_box_pack_start (GTK_BOX(page), widget, FALSE, FALSE, 0);
+#else
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_box_pack_start(GTK_BOX(page), scrolled_window, TRUE, TRUE, 0);
+
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
+ widget);
+#endif
g_free(text);
/* user page: 1 */
i++;
USER_PAGE = i;
widget = create_page (wizard, _("About You"));
- gtk_box_pack_start (GTK_BOX(widget), user_page(wizard), FALSE, FALSE, 0);
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
+
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
+ user_page(wizard));
PACK_WARNING(_("Bold fields must be completed"));
wizard->pages = g_slist_append(wizard->pages, widget);
i++;
RECV_PAGE = i;
widget = create_page (wizard, _("Receiving mail"));
- gtk_box_pack_start (GTK_BOX(widget), recv_page(wizard), FALSE, FALSE, 0);
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
+
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
+ recv_page(wizard));
PACK_WARNING(_("Bold fields must be completed"));
wizard->pages = g_slist_append(wizard->pages, widget);
i++;
SMTP_PAGE = i;
widget = create_page (wizard, _("Sending mail"));
- gtk_box_pack_start (GTK_BOX(widget), smtp_page(wizard), FALSE, FALSE, 0);
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
+
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
+ smtp_page(wizard));
PACK_WARNING(_("Bold fields must be completed"));
wizard->pages = g_slist_append(wizard->pages, widget);
i++;
MAILBOX_PAGE = i;
widget = create_page (wizard, _("Saving mail on disk"));
- gtk_box_pack_start (GTK_BOX(widget), mailbox_page(wizard), FALSE, FALSE, 0);
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
+
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
+ mailbox_page(wizard));
PACK_WARNING(_("Bold fields must be completed"));
wizard->pages = g_slist_append(wizard->pages, widget);
}
-/* ssl page: 5 */
-#ifdef USE_OPENSSL
- i++;
- SSL_PAGE = i;
- widget = create_page (wizard, _("Security"));
- gtk_box_pack_start (GTK_BOX(widget), ssl_page(wizard), FALSE, FALSE, 0);
- PACK_WARNING(_("Bold fields must be completed"));
-
- wizard->pages = g_slist_append(wizard->pages, widget);
-#endif
/* done page: 6 */
i++;
gtk_box_pack_start (GTK_BOX(page), widget, FALSE, FALSE, 0);
- text = g_strdup(_("Claws Mail is now ready.\n\n"
+ text = g_strdup(_("Claws Mail is now ready.\n"
"Click Save to start."));
widget = gtk_label_new(text);
gtk_box_pack_start (GTK_BOX(page), widget, FALSE, FALSE, 0);
gtk_widget_hide(wizard->recv_imap_label);
gtk_widget_hide(wizard->recv_imap_subdir);
+ gtk_widget_hide(wizard->subsonly_checkbtn);
wizard_protocol_change(wizard, tmpl.recvtype);