|
From: CORE C. L. <cor...@li...> - 2000-11-26 23:32:46
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
callbacks.c panes.c
Log Message:
now when you press save in new_account() it checks so you have filled in everything correct, if not a error message displays, if everything is filled in it inserts the new account in the account_window clist and in the folder_ctree, somehow it doesnt save the data? prehaps something wrong with account_write() prehaps i can check it later, need to fix that and fix check_for_new_mail to change the pixmaps in the nodes wich have new messages, to folder_closed_new.xpm and folder_open_new.xpm
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- callbacks.c 2000/11/26 21:28:17 1.31
+++ callbacks.c 2000/11/26 23:32:44 1.32
@@ -8,6 +8,7 @@
Account *current_mbox;
extern GtkWidget *mail_ctree;
+extern GtkWidget *account_clist;
extern GtkWidget *main_win;
extern ConfigData config;
extern gchar *title;
@@ -109,6 +110,7 @@
/* Password entry */
password = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(password), "");
+ gtk_entry_set_visibility(GTK_ENTRY(password), FALSE);
gtk_widget_set_usize(GTK_WIDGET(password), 100, 20);
gtk_table_attach(GTK_TABLE(table), password, 3, 4, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -171,8 +173,8 @@
Account *acct;
gchar *tmp_folder_name, *tmp_full_name, *tmp_email_address,
*tmp_username, *tmp_password, *tmp_server, *tmp_path;
+ gchar **text = NULL;
-
tmp_folder_name = gtk_entry_get_text(GTK_ENTRY(folder_name));
tmp_full_name = gtk_entry_get_text(GTK_ENTRY(full_name));
tmp_email_address = gtk_entry_get_text(GTK_ENTRY(email_address));
@@ -180,17 +182,14 @@
tmp_password = gtk_entry_get_text(GTK_ENTRY(password));
tmp_server = gtk_entry_get_text(GTK_ENTRY(server));
tmp_path = gtk_entry_get_text(GTK_ENTRY(path));
- create_error_window(g_strdup("ERROR"),
- g_strdup
- ("Make sure you have filled in everything"),
- g_strdup("OK"));
- if (g_strdup(tmp_folder_name) == NULL /* &&
- tmp_full_name == NULL &&
- tmp_email_address == NULL &&
- tmp_username == NULL &&
- tmp_password == NULL &&
- tmp_server == NULL &&
- tmp_path == NULL */ ) {
+
+ if ((tmp_folder_name == NULL || *tmp_folder_name == '\0') &&
+ (tmp_full_name == NULL || *tmp_full_name == '\0') &&
+ (tmp_email_address == NULL || *tmp_email_address == '\0') &&
+ (tmp_username == NULL || *tmp_username == '\0') &&
+ (tmp_password == NULL || *tmp_password == '\0') &&
+ (tmp_server == NULL || *tmp_server == '\0') &&
+ (tmp_path == NULL || *tmp_path == '\0')) {
create_error_window(g_strdup("ERROR"),
g_strdup
("Make sure you have filled in everything"),
@@ -209,6 +208,44 @@
account_set_path(acct, tmp_path);
account_write(acct);
+
+ if (text) {
+ if (text[0])
+ g_free(text[0]);
+ if (text[1])
+ g_free(text[1]);
+ if (text[2])
+ g_free(text[2]);
+ if (text[3])
+ g_free(text[3]);
+ } else text = (char **) g_malloc(4 * sizeof(char *));
+
+ text[0] = account_get_name(acct);
+ text[1] = account_get_fullname(acct);
+ text[2] = account_get_address(acct);
+ text[3] = account_get_path(acct);
+
+ gtk_clist_insert(GTK_CLIST(account_clist), 4, text);
+
+ if (text) {
+ if (text[0])
+ g_free(text[0]);
+ if (text[1])
+ g_free(text[1]);
+ if (text[2])
+ g_free(text[2]);
+ if (text[3])
+ g_free(text[3]);
+ } else text = (char **) g_malloc(4 * sizeof(char *));
+
+ text[0] = account_get_name(acct);
+ text[1] = g_strdup("0");
+ text[2] = g_strdup("0");
+
+
+ gtk_ctree_insert_node(GTK_CTREE(folder_ctree), NULL, NULL, text, 0, NULL, NULL, NULL, NULL, FALSE, TRUE);
+
+
gtk_widget_destroy(accounts_win_new);
return;
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- panes.c 2000/11/26 21:28:17 1.17
+++ panes.c 2000/11/26 23:32:45 1.18
@@ -6,7 +6,7 @@
ConfigData config;
GtkWidget *mail_ctree;
GtkWidget *folder_ctree;
-GtkWidget *clist;
+GtkWidget *account_clist;
extern GtkWidget *main_win;
extern GtkWidget *hpane;
extern gchar *theme;
@@ -333,8 +333,8 @@
gtk_container_add(GTK_CONTAINER(accounts_win), main_vbox);
/* The clist for browsing accounts */
- clist = gtk_clist_new_with_titles(4, titles);
- gtk_box_pack_start(GTK_BOX(main_vbox), clist, TRUE, TRUE, 0);
+ account_clist = gtk_clist_new_with_titles(4, titles);
+ gtk_box_pack_start(GTK_BOX(main_vbox), account_clist, TRUE, TRUE, 0);
account_reset_dir();
i = 0;
@@ -356,8 +356,8 @@
text[2] = account_get_address(mbox);
text[3] = account_get_path(mbox);
- gtk_clist_insert(GTK_CLIST(clist), i, text);
- gtk_clist_set_row_data_full(GTK_CLIST(clist), i,
+ gtk_clist_insert(GTK_CLIST(account_clist), i, text);
+ gtk_clist_set_row_data_full(GTK_CLIST(account_clist), i,
mbox,
(GtkDestroyNotify)
destroy_account);
@@ -373,10 +373,10 @@
g_free(text[3]);
g_free(text);
- gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 0, TRUE);
- gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 1, TRUE);
- gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 2, TRUE);
- gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 3, TRUE);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(account_clist), 0, TRUE);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(account_clist), 1, TRUE);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(account_clist), 2, TRUE);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(account_clist), 3, TRUE);
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
|