|
From: CORE C. L. <cor...@li...> - 2000-11-27 10:12:14
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
callbacks.c prefs.c
Log Message:
cant remember what ive changed, cant be to much ;=)
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- callbacks.c 2000/11/26 23:32:44 1.32
+++ callbacks.c 2000/11/27 10:12:11 1.33
@@ -175,6 +175,7 @@
*tmp_username, *tmp_password, *tmp_server, *tmp_path;
gchar **text = NULL;
+ /* Get the values from the entry boxes */
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));
@@ -183,6 +184,7 @@
tmp_server = gtk_entry_get_text(GTK_ENTRY(server));
tmp_path = gtk_entry_get_text(GTK_ENTRY(path));
+ /* Check and make sure everything is filled in */
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') &&
@@ -196,19 +198,30 @@
g_strdup("OK"));
return;
}
+
+ /* Make a new account, this only frees the Account data */
acct = new_account();
+ /* Set the foldername */
account_set_name(acct, tmp_folder_name);
+ /* Set the full name */
account_set_fullname(acct, tmp_full_name);
+ /* Set the email address */
account_set_address(acct, tmp_email_address);
/*acct->type = gtk_entry_get_text(GTK_ENTRY(type)); */
+ /* Set username */
account_set_username(acct, tmp_username);
+ /* Set password */
account_set_password(acct, tmp_password);
+ /* Set server */
account_set_server(acct, tmp_server);
+ /* Set path */
account_set_path(acct, tmp_path);
+ /* Write the account */
account_write(acct);
+ /* Make sure there isnt anything in text, or malloc text[] */
if (text) {
if (text[0])
g_free(text[0]);
@@ -220,13 +233,16 @@
g_free(text[3]);
} else text = (char **) g_malloc(4 * sizeof(char *));
+ /* Set the text in text array */
text[0] = account_get_name(acct);
text[1] = account_get_fullname(acct);
text[2] = account_get_address(acct);
text[3] = account_get_path(acct);
+ /* Insert text[] into account_clist */
gtk_clist_insert(GTK_CLIST(account_clist), 4, text);
+ /* Make sure there isnt anything in text, or malloc text[] */
if (text) {
if (text[0])
g_free(text[0]);
@@ -244,8 +260,18 @@
gtk_ctree_insert_node(GTK_CTREE(folder_ctree), NULL, NULL, text, 0, NULL, NULL, NULL, NULL, FALSE, TRUE);
-
+ /* If everything worked fine we should free 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]);
+ }
gtk_widget_destroy(accounts_win_new);
return;
===================================================================
RCS file: /cvsroot/corem/core/src/prefs.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- prefs.c 2000/11/26 21:28:17 1.9
+++ prefs.c 2000/11/27 10:12:11 1.10
@@ -257,6 +257,7 @@
g_strdup(gtk_entry_get_text(GTK_ENTRY(def_font)));
config.new_font =
g_strdup(gtk_entry_get_text(GTK_ENTRY(new_font)));
+ apply_clicked();
gtk_widget_destroy(pref_win);
}
@@ -269,7 +270,7 @@
font =
gdk_font_load(g_strdup
(gtk_entry_get_text(GTK_ENTRY(def_font))));
- style = gtk_style_copy(gtk_widget_get_style(main_win));
+ style = gtk_style_copy(gtk_widget_get_style(folder_ctree));
gdk_font_unref(style->font);
style->font = font;
gdk_font_ref(style->font);
|