|
From: CORE C. L. <cor...@li...> - 2000-11-26 07:51:21
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
account.c account.h panes.c
Log Message:
The account window now lists the accounts available. Still need to fix the info displayed.
===================================================================
RCS file: /cvsroot/corem/core/src/account.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- account.c 2000/11/23 09:32:12 1.11
+++ account.c 2000/11/26 07:51:21 1.12
@@ -371,3 +371,13 @@
rewind(ac->fp);
return TRUE;
}
+
+int account_reset_dir()
+{
+ if (!acct_dir)
+ return FALSE;
+
+ rewinddir(acct_dir);
+
+ return TRUE;
+}
===================================================================
RCS file: /cvsroot/corem/core/src/account.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- account.h 2000/11/25 19:11:52 1.10
+++ account.h 2000/11/26 07:51:21 1.11
@@ -79,3 +79,5 @@
/* Reset the file pointer for the local mailbox */
int account_reset_file(Account * ac);
+/* Reset the directory to read from the beginning */
+int account_reset_dir(void);
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- panes.c 2000/11/23 09:32:12 1.12
+++ panes.c 2000/11/26 07:51:21 1.13
@@ -6,7 +6,7 @@
ConfigData config;
GtkWidget *mail_ctree;
GtkWidget *folder_ctree;
-GtkWidget *ctree;
+GtkWidget *clist;
extern GtkWidget *main_win;
extern GtkWidget *hpane;
extern gchar *theme;
@@ -305,10 +305,10 @@
/* The main account window */
void create_account_window()
{
+ int i;
Account *mbox;
GtkWidget *accounts_win;
GtkWidget *main_vbox, *hbox;
- GtkCTreeNode *item;
GtkWidget *hbutton_box;
GtkWidget *button_new, *button_edit, *button_remove, *button_close;
gchar **text = NULL;
@@ -330,33 +330,46 @@
gtk_container_add(GTK_CONTAINER(accounts_win), main_vbox);
/* The clist for browsing accounts */
- ctree = gtk_clist_new_with_titles(4, titles);
- gtk_box_pack_start(GTK_BOX(main_vbox), ctree, TRUE, FALSE, 0);
- while ((mbox = get_next_account())) {
- 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]);
+ clist = gtk_clist_new_with_titles(4, titles);
+ gtk_box_pack_start(GTK_BOX(main_vbox), clist , TRUE, TRUE, 0);
- text = (char **) g_malloc(4 * sizeof(char *));
+ account_reset_dir();
+ i = 0;
+ while ((mbox = get_next_account())) {
+ 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(mbox);
text[1] = g_strdup("Test 1");
text[2] = g_strdup("Test 2");
text[3] = g_strdup("Test 3");
- item = gtk_ctree_insert_node(GTK_CTREE(ctree),
- NULL, NULL, text, 0, NULL,
- NULL, NULL, NULL, FALSE,
- FALSE);
- gtk_ctree_node_set_row_data_full(GTK_CTREE(ctree), item,
+ gtk_clist_insert(GTK_CLIST(clist), i, text);
+ gtk_clist_set_row_data_full(GTK_CLIST(clist), i,
mbox,
(GtkDestroyNotify)
- destroy_account);
- }
+ destroy_account);
+ i++;
+ }
+ 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]);
+ g_free(text);
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
|