|
From: CORE C. L. <cor...@li...> - 2000-11-20 22:32:00
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
account.h callbacks.c panes.c
Log Message:
Added some comments, changed the display order of the mail list columns, and fixed an indentation problem with the "From" ctree column.
===================================================================
RCS file: /cvsroot/corem/core/src/account.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- account.h 2000/11/20 21:02:13 1.3
+++ account.h 2000/11/20 22:32:00 1.4
@@ -1,30 +1,60 @@
-typedef struct {
- char *full_name;
- char *name;
- char *address;
- char *server;
- char *path;
+/* The types of mailboxes available */
+typedef enum {
+ Local,
+ POP3,
+ IMAP
+} AccountType;
- FILE *fp;
+/* Structure to track account information. */
+typedef struct {
+ /* Folder specific info */
+ char *name; /* Name of the mailbox. */
+ AccountType type; /* Mailbox type. */
+ char *path; /* Path to the local mailbox. */
+ FILE *fp; /* Pointer to the local mbox file */
+
+ /* User specific info */
+ char *full_name; /* The full name of the user. */
+ char *address; /* E-mail address for this mailbox. */
+
+ /* Server specific info */
+ char *server; /* Address of the server for POP3 or IMAP. */
+ char *username; /* Username for POP3 or IMAP */
+ char *password; /* Password for POP3 or IMAP */
} Account;
+
+/* Allocate the memory for and initialize a new account structure. */
Account *new_account(void);
+/* Free an account created with new_account() */
int destroy_account(Account * ac);
+/* Set the address of account ac to the string address */
int account_set_address(Account * ac, char *address);
+/* Return a malloc()'d copy of the address in account ac. */
char *account_get_address(Account * ac);
+/* Set the server name of account ac to the string server */
int account_set_server(Account * ac, char *server);
+/* Return a malloc()'d copy of the server name in account ac. */
char *account_get_server(Account * ac);
+/* Set the path of account ac to the string path */
int account_set_path(Account * ac, char *path);
+/* Return a malloc()'d copy of the path in account ac. */
char *account_get_path(Account * ac);
+/* Set the mailbox name of account ac to the string name */
+int account_set_name(Account * ac, char *name);
+/* Return a malloc()'d copy of the mailbox name in account ac. */
char *account_get_name(Account * ac);
-int account_set_name(Account * ac, char *path);
-char *account_get_name(Account * ac);
-int account_set_name(Account * ac, char *path);
+/* Set the full name of account ac to the string path */
+int account_set_full_name(Account * ac, char *fullname);
+/* Return a malloc()'d copy of the full name in account ac. */
+char *account_get_full_name(Account * ac);
+/* Read in the settings found in the file path, return an account structure */
Account *account_read(gchar * path);
+/* Move through the various folders returning them one at a time */
Account *get_next_folder(void);
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- callbacks.c 2000/11/20 21:02:13 1.15
+++ callbacks.c 2000/11/20 22:32:00 1.16
@@ -389,8 +389,9 @@
break;
col = 0;
- if (config.ml_priority == 1) {
- found = find_header(head, "Priority:");
+
+ if (config.ml_from == 1) {
+ found = find_header(head, "From:");
if (found)
text[col] = header_get_value(found);
else
@@ -398,13 +399,8 @@
col++;
}
- if (config.ml_read == 1) {
- text[col] = g_strdup("");
- col++;
- }
-
- if (config.ml_attachment == 1) {
- found = find_header(head, "Attachment:");
+ if (config.ml_subject == 1) {
+ found = find_header(head, "Subject:");
if (found)
text[col] = header_get_value(found);
else
@@ -412,8 +408,8 @@
col++;
}
- if (config.ml_score == 1) {
- found = find_header(head, "Score:");
+ if (config.ml_date == 1) {
+ found = find_header(head, "Date:");
if (found)
text[col] = header_get_value(found);
else
@@ -421,8 +417,8 @@
col++;
}
- if (config.ml_from == 1) {
- found = find_header(head, "From:");
+ if (config.ml_server == 1) {
+ found = find_header(head, "Server:");
if (found)
text[col] = header_get_value(found);
else
@@ -430,8 +426,8 @@
col++;
}
- if (config.ml_subject == 1) {
- found = find_header(head, "Subject:");
+ if (config.ml_priority == 1) {
+ found = find_header(head, "Priority:");
if (found)
text[col] = header_get_value(found);
else
@@ -439,8 +435,8 @@
col++;
}
- if (config.ml_date == 1) {
- found = find_header(head, "Date:");
+ if (config.ml_attachment == 1) {
+ found = find_header(head, "Attachment:");
if (found)
text[col] = header_get_value(found);
else
@@ -448,8 +444,8 @@
col++;
}
- if (config.ml_server == 1) {
- found = find_header(head, "Server:");
+ if (config.ml_score == 1) {
+ found = find_header(head, "Score:");
if (found)
text[col] = header_get_value(found);
else
@@ -457,6 +453,11 @@
col++;
}
+ if (config.ml_read == 1) {
+ text[col] = g_strdup("");
+ col++;
+ }
+
temp = header_get_value(find_header(head, "References:"));
if (temp)
@@ -471,7 +472,7 @@
free(temp);
item =
- gtk_ctree_insert_node(GTK_CTREE(mail_ctree), NULL,
+ gtk_ctree_insert_node(GTK_CTREE(mail_ctree), top,
NULL, text, 0, NULL, NULL, NULL,
NULL, FALSE, TRUE);
@@ -493,11 +494,11 @@
int folder_unselected(GtkWidget * list, GList * node, gint col,
gpointer data)
{
+ return TRUE;
list = NULL;
node = NULL;
col = 0;
data = NULL;
- return TRUE;
}
int mail_selected(GtkWidget * list, GList * node, gint col, gpointer data)
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- panes.c 2000/11/20 21:02:13 1.4
+++ panes.c 2000/11/20 22:32:00 1.5
@@ -123,54 +123,90 @@
g_strconcat(getenv("HOME"), "/.core/themes/", config.theme,
"/", NULL);
- if (config.ml_priority == 1) {
- field_titles[col] = "Priority";
- ipriority = col;
- col++;
- }
- if (config.ml_read == 1) {
- field_titles[col] = "";
- iread = col;
- col++;
- }
- if (config.ml_attachment == 1) {
- field_titles[col] = "";
- iattachment = col;
- col++;
- }
- if (config.ml_score == 1) {
- field_titles[col] = "Score";
- iscore = col;
- col++;
- }
if (config.ml_from == 1) {
field_titles[col] = "From";
ifrom = col;
col++;
}
+
if (config.ml_subject == 1) {
field_titles[col] = "Subject";
isubject = col;
col++;
}
+
if (config.ml_date == 1) {
field_titles[col] = "Date";
idate = col;
col++;
}
+
if (config.ml_server == 1) {
field_titles[col] = "Server";
iserver = col;
col++;
}
+ if (config.ml_priority == 1) {
+ field_titles[col] = "Priority";
+ ipriority = col;
+ col++;
+ }
+
+ if (config.ml_attachment == 1) {
+ field_titles[col] = "";
+ iattachment = col;
+ col++;
+ }
+
+ if (config.ml_score == 1) {
+ field_titles[col] = "Score";
+ iscore = col;
+ col++;
+ }
+
+ if (config.ml_read == 1) {
+ field_titles[col] = "";
+ iread = col;
+ col++;
+ }
+
+
mail_ctree = gtk_ctree_new_with_titles(col, 0, field_titles);
gtk_signal_connect(GTK_OBJECT(mail_ctree), "tree_select_row",
GTK_SIGNAL_FUNC(mail_selected), NULL);
+ if (config.ml_from == 1) {
+ gtk_clist_set_column_width(GTK_CLIST(mail_ctree), ifrom,
+ 250);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
+ ifrom, FALSE);
+ }
+
+ if (config.ml_subject == 1) {
+ gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
+ isubject, TRUE);
+ }
+
+ if (config.ml_date == 1) {
+ gtk_clist_set_column_width(GTK_CLIST(mail_ctree), idate,
+ 100);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
+ idate, FALSE);
+ }
+
+ if (config.ml_server == 1) {
+ gtk_clist_set_column_width(GTK_CLIST(mail_ctree), iserver,
+ 40);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
+ iserver, FALSE);
+ }
+
if (config.ml_priority) {
gtk_clist_set_column_width(GTK_CLIST(mail_ctree),
ipriority, 40);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
+ ipriority, FALSE);
}
if (config.ml_read == 1) {
@@ -186,6 +222,8 @@
read);
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), iread,
8);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
+ iread, FALSE);
gdk_bitmap_unref(bitmap);
gdk_pixmap_unref(pixmap);
@@ -203,6 +241,8 @@
iattachment, attachment);
gtk_clist_set_column_width(GTK_CLIST(mail_ctree),
iattachment, 8);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
+ iattachment, FALSE);
gdk_bitmap_unref(bitmap);
gdk_pixmap_unref(pixmap);
}
@@ -211,26 +251,8 @@
if (config.ml_score == 1) {
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), iscore,
30);
- }
-
- if (config.ml_from == 1) {
- gtk_clist_set_column_width(GTK_CLIST(mail_ctree), ifrom,
- 250);
- }
-
- if (config.ml_subject == 1) {
- gtk_clist_set_column_width(GTK_CLIST(mail_ctree), isubject,
- 125);
- }
-
- if (config.ml_date == 1) {
- gtk_clist_set_column_width(GTK_CLIST(mail_ctree), idate,
- 100);
- }
-
- if (config.ml_server == 1) {
- gtk_clist_set_column_width(GTK_CLIST(mail_ctree), iserver,
- 40);
+ gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
+ iscore, FALSE);
}
text = (char **) g_malloc(5 * sizeof(char *));
|