You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(50) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Christopher R. <sm...@no...> - 2000-11-25 22:29:09
|
Nathan! What was the folder_selected issue you took care about in your last update ? |
|
From: CORE C. L. <cor...@li...> - 2000-11-25 19:11:55
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
account.h callbacks.c
Log Message:
Fixed some of the issues with folder_selected.
===================================================================
RCS file: /cvsroot/corem/core/src/account.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- account.h 2000/11/23 09:32:12 1.9
+++ account.h 2000/11/25 19:11:52 1.10
@@ -78,4 +78,4 @@
Account *get_next_account(void);
/* Reset the file pointer for the local mailbox */
-int account_reset(Account * ac);
+int account_reset_file(Account * ac);
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- callbacks.c 2000/11/24 01:56:10 1.27
+++ callbacks.c 2000/11/25 19:11:52 1.28
@@ -15,7 +15,7 @@
extern GtkWidget *folder_ctree;
GtkWidget *folder_name, *full_name, *email_address, *type, *username,
- *password, *server, *path;
+ *password, *server, *path;
GtkWidget *accounts_win_new;
extern GtkWidget *toolbar;
@@ -345,6 +345,7 @@
GTK_CTREE_NODE
(node));
+ account_reset_file(mbox);
gtk_clist_freeze(GTK_CLIST(mail_ctree));
while (1) {
GtkCTreeNode *top, *item;
|
|
From: CORE C. L. <cor...@li...> - 2000-11-24 01:56:10
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
callbacks.c
Log Message:
really havent changed anything just commited so it wont freak when i update next time
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- callbacks.c 2000/11/23 09:32:12 1.26
+++ callbacks.c 2000/11/24 01:56:10 1.27
@@ -562,4 +562,5 @@
return;
signum = 0;
+
}
|
|
From: CORE C. L. <cor...@li...> - 2000-11-23 09:37:09
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
message.c
Log Message:
Had some inverted logic for finding new messages. Fixed.
===================================================================
RCS file: /cvsroot/corem/core/src/message.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- message.c 2000/11/23 09:32:12 1.2
+++ message.c 2000/11/23 09:37:08 1.3
@@ -302,10 +302,14 @@
temp =
header_get_value(find_header
(message_get_headers(m), "Status:"));
- if (temp) {
+ if (!temp) {
free(temp);
ret++;
- }
+ }
+ else if (strchr(temp, 'N')) {
+ free(temp);
+ ret++;
+ }
destroy_message(m);
}
|
|
From: CORE C. L. <cor...@li...> - 2000-11-23 09:32:14
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
account.c account.h callbacks.c callbacks.h menus.c message.c
message.h panes.c util.c
Log Message:
Some basic framework for checking for new messages, and listing the total number of messages and total number of new messages.
===================================================================
RCS file: /cvsroot/corem/core/src/account.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- account.c 2000/11/23 02:23:03 1.10
+++ account.c 2000/11/23 09:32:12 1.11
@@ -22,9 +22,10 @@
ret->address = NULL;
ret->server = NULL;
ret->path = NULL;
- ret->fp = NULL;
- ret->messages = 0;
- ret->new_messages = 0;
+ ret->fp = NULL;
+ ret->messages = 0;
+ ret->new_messages = 0;
+ ret->last_access = 0;
return ret;
}
@@ -54,6 +55,24 @@
return TRUE;
}
+int account_set_last_access(Account * ac, time_t time)
+{
+ if (!ac)
+ return FALSE;
+
+ ac->last_access = time;
+
+ return TRUE;
+}
+
+time_t account_get_last_access(Account * ac)
+{
+ if (!ac)
+ return 0;
+
+ return (ac->last_access);
+}
+
int account_set_name(Account * ac, char *name)
{
if (!name || !ac)
@@ -103,9 +122,9 @@
if (!ac)
return FALSE;
- ac->messages = num;
+ ac->messages = num;
- return TRUE;
+ return TRUE;
}
int account_get_num_new_messages(Account * ac)
@@ -121,9 +140,9 @@
if (!ac)
return FALSE;
- ac->new_messages = num;
+ ac->new_messages = num;
- return TRUE;
+ return TRUE;
}
char *account_get_name(Account * ac)
===================================================================
RCS file: /cvsroot/corem/core/src/account.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- account.h 2000/11/23 02:23:03 1.8
+++ account.h 2000/11/23 09:32:12 1.9
@@ -10,9 +10,10 @@
/* Folder specific info */
char *name; /* Name of the mailbox. */
AccountType type; /* Mailbox type. */
- char *path; /* Path to the local mailbox. */
- int messages; /* Number of messages in mailbox */
- int new_messages; /* Number of new messages in mailbox */
+ char *path; /* Path to the local mailbox. */
+ int messages; /* Number of messages in mailbox */
+ int new_messages; /* Number of new messages in mailbox */
+ time_t last_access; /* Time the mailbox was last checked */
FILE *fp; /* Pointer to the local mailbox file */
/* User specific info */
@@ -29,6 +30,11 @@
Account *new_account(void);
/* Free an account created with new_account() */
int destroy_account(Account * ac);
+
+/* Set the time in seconds that the mailbox was last checked for updates */
+int account_set_last_access(Account * ac, time_t time);
+/* Return the last time the mailbox was last checked for updates */
+time_t account_get_last_access(Account * ac);
/* Set the address of account ac to the string address */
int account_set_address(Account * ac, char *address);
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- callbacks.c 2000/11/23 03:28:13 1.25
+++ callbacks.c 2000/11/23 09:32:12 1.26
@@ -2,15 +2,18 @@
#include "core.h"
#include "callbacks.h"
#include "panes.h"
+#include <signal.h>
-extern Account *current_mbox;
+#define TIMEOUT 30
+
+Account *current_mbox;
extern GtkWidget *mail_ctree;
extern GtkWidget *main_win;
extern ConfigData config;
extern gchar *title;
extern gchar *theme;
-GtkWidget *ctree;
+extern GtkWidget *folder_ctree;
GtkWidget *folder_name, *full_name, *email_address, *type, *username,
*password, *server, *path;
GtkWidget *accounts_win_new;
@@ -342,6 +345,7 @@
GTK_CTREE_NODE
(node));
+ gtk_clist_freeze(GTK_CLIST(mail_ctree));
while (1) {
GtkCTreeNode *top, *item;
char *temp;
@@ -443,18 +447,25 @@
if (config.ml_read == 1) {
found = find_header(head, "Status:");
- if (found) {
+ if (found)
text[col] = header_get_value(found);
- if (strchr(text[col], 'O')) {
- g_free(text[col]);
- colormap = gtk_widget_get_colormap(mail_ctree);
- pixmap = gdk_pixmap_colormap_create_from_xpm(NULL, colormap, &bitmap, NULL, g_strconcat(theme, "read.xpm", NULL));
- gtk_ctree_node_set_pixmap(GTK_CTREE(mail_ctree), item, col, pixmap, bitmap);
- gdk_bitmap_unref(bitmap);
- gdk_pixmap_unref(pixmap);
- }
+
+ if (!found || strchr(text[col], 'N')) {
+ g_free(text[col]);
+ colormap =
+ gtk_widget_get_colormap(mail_ctree);
+ pixmap =
+ gdk_pixmap_colormap_create_from_xpm
+ (NULL, colormap, &bitmap, NULL,
+ g_strconcat(theme, "read.xpm", NULL));
+ gtk_ctree_node_set_pixmap(GTK_CTREE
+ (mail_ctree),
+ item, col,
+ pixmap, bitmap);
+ gdk_bitmap_unref(bitmap);
+ gdk_pixmap_unref(pixmap);
}
- }
+ }
temp = header_get_value(find_header(head, "Message-Id:"));
if (temp)
@@ -464,7 +475,9 @@
(GtkDestroyNotify)
free);
destroy_message(message);
- }
+ }
+
+ gtk_clist_thaw(GTK_CLIST(mail_ctree));
current_mbox = mbox;
account_reset_file(mbox);
@@ -515,4 +528,38 @@
node = NULL;
col = 0;
data = NULL;
+}
+
+/* Function for checking folders for new mail */
+void check_for_new_mail(int signum)
+{
+ int i;
+ char *temp;
+ Account *mbox;
+ GtkCTreeNode *node;
+
+ for (i = 1, node = gtk_ctree_node_nth(GTK_CTREE(folder_ctree), i); node;
+ i++, node = gtk_ctree_node_nth(GTK_CTREE(folder_ctree), i)) {
+ mbox = gtk_ctree_node_get_row_data(GTK_CTREE(folder_ctree), node);
+ if (account_get_last_access(mbox) <
+ last_modify(account_get_path(mbox))) {
+ account_set_num_messages(mbox, num_messages(mbox));
+ account_set_num_new_messages(mbox,
+ num_new_messages
+ (mbox));
+ }
+ asprintf(&temp, "%d", account_get_num_messages(mbox));
+ gtk_ctree_node_set_text(GTK_CTREE(folder_ctree), node, 1, temp);
+ free(temp);
+
+ asprintf(&temp, "%d", account_get_num_new_messages(mbox));
+ gtk_ctree_node_set_text(GTK_CTREE(folder_ctree), node, 2, temp);
+ free(temp);
+ }
+
+ signal(SIGALRM, check_for_new_mail);
+ alarm(TIMEOUT);
+
+ return;
+ signum = 0;
}
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- callbacks.h 2000/11/23 02:23:03 1.11
+++ callbacks.h 2000/11/23 09:32:12 1.12
@@ -64,3 +64,6 @@
/* Function for switching the where *theme is the directory name of the theme */
void switch_theme(gchar * theme);
+
+/* Function for checking for new messages. */
+void check_for_new_mail(int signum);
===================================================================
RCS file: /cvsroot/corem/core/src/menus.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- menus.c 2000/11/23 02:23:03 1.9
+++ menus.c 2000/11/23 09:32:12 1.10
@@ -449,8 +449,8 @@
GTK_SIGNAL_FUNC
(switch_theme),
(gpointer)
- g_strdup(dent->
- d_name));
+ g_strdup
+ (dent->d_name));
gtk_menu_append(GTK_MENU(menu), menu_item);
g_free(temp);
}
===================================================================
RCS file: /cvsroot/corem/core/src/message.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -3 -r1.1.1.1 -r1.2
--- message.c 2000/11/14 19:23:24 1.1.1.1
+++ message.c 2000/11/23 09:32:12 1.2
@@ -264,4 +264,50 @@
destroy_message(m);
}
+ return NULL;
+}
+
+int num_messages(Account * mbox)
+{
+ int ret = 0;
+ Message *m;
+
+ if (!mbox)
+ return 0;
+
+ if (mbox->fp)
+ rewind(mbox->fp);
+
+ while ((m = message_get_next(mbox)) != NULL) {
+ destroy_message(m);
+ ret++;
+ }
+
+ return ret;
+}
+
+int num_new_messages(Account * mbox)
+{
+ int ret = 0;
+ char *temp;
+ Message *m;
+
+ if (!mbox)
+ return 0;
+
+ if (mbox->fp)
+ rewind(mbox->fp);
+
+ while ((m = message_get_next(mbox)) != NULL) {
+ temp =
+ header_get_value(find_header
+ (message_get_headers(m), "Status:"));
+ if (temp) {
+ free(temp);
+ ret++;
+ }
+ destroy_message(m);
+ }
+
+ return ret;
}
===================================================================
RCS file: /cvsroot/corem/core/src/message.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- message.h 2000/11/23 02:23:03 1.2
+++ message.h 2000/11/23 09:32:12 1.3
@@ -32,3 +32,8 @@
Message *message_get_n(Account * mbox, int num);
Message *message_find_id(Account * mbox, char *id);
+
+/* Return the number of new messages in the mailbox mbox */
+int num_new_messages(Account * mbox);
+/* Return the number of messages in the mailbox mbox */
+int num_messages(Account * mbox);
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- panes.c 2000/11/23 02:23:03 1.11
+++ panes.c 2000/11/23 09:32:12 1.12
@@ -4,12 +4,11 @@
#include "callbacks.h"
ConfigData config;
-Account *current_mbox = NULL;
GtkWidget *mail_ctree;
GtkWidget *folder_ctree;
+GtkWidget *ctree;
extern GtkWidget *main_win;
extern GtkWidget *hpane;
-extern GtkWidget *ctree;
extern gchar *theme;
extern gchar *title;
@@ -113,6 +112,7 @@
gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
GTK_CTREE_LINES_TABBED);
+ check_for_new_mail(0);
return (scroll);
}
@@ -208,7 +208,7 @@
if (config.ml_date == 1) {
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), idate,
- 120);
+ 150);
}
if (config.ml_server == 1) {
@@ -233,13 +233,14 @@
gtk_clist_set_column_widget(GTK_CLIST(mail_ctree), iread,
read);
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), iread,
- 38);
+ 8);
gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
iread, FALSE);
gdk_bitmap_unref(bitmap);
gdk_pixmap_unref(pixmap);
}
+
if (config.ml_attachment == 1) {
colormap = gtk_widget_get_colormap(mail_ctree);
pixmap =
@@ -393,7 +394,7 @@
gtk_container_add(GTK_CONTAINER(hbutton_box), button_close);
/* Show all widgets in the accounts window */
- gtk_widget_show_all(accounts_win);
+ gtk_widget_show_all(accounts_win);
}
===================================================================
RCS file: /cvsroot/corem/core/src/util.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- util.c 2000/11/14 22:07:28 1.2
+++ util.c 2000/11/23 09:32:12 1.3
@@ -1,4 +1,8 @@
#include "util.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <time.h>
#define BUFSIZE 400
@@ -115,4 +119,17 @@
line++;
return token;
+}
+
+time_t last_modify(char *path)
+{
+ struct stat dstat;
+
+ if (!path)
+ return 0;
+
+ if (stat(path, &dstat) < 0)
+ return 0;
+
+ return dstat.st_mtime;
}
|
|
From: CORE C. L. <cor...@li...> - 2000-11-23 03:28:14
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
callbacks.c
Log Message:
checked your changes... trye type improve some but it failed..... try look what im doing wrong =) gotta go to bed
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- callbacks.c 2000/11/23 02:23:03 1.24
+++ callbacks.c 2000/11/23 03:28:13 1.25
@@ -8,6 +8,7 @@
extern GtkWidget *main_win;
extern ConfigData config;
extern gchar *title;
+extern gchar *theme;
GtkWidget *ctree;
GtkWidget *folder_name, *full_name, *email_address, *type, *username,
@@ -330,6 +331,9 @@
int folder_selected(GtkWidget * list, GList * node, gint col,
gpointer data)
{
+ GdkBitmap *bitmap;
+ GdkColormap *colormap;
+ GdkPixmap *pixmap;
Message *message = NULL;
Account *mbox = NULL;
gchar *text[7] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
@@ -416,25 +420,7 @@
}
if (config.ml_read == 1) {
- found = find_header(head, "Status:");
- if (found) {
- text[col] = header_get_value(found);
- if (strchr(text[col], 'R')) {
- free(text[col]);
- text[col] = g_strdup("Read");
- }
- else if (strchr(text[col], 'O')) {
- free(text[col]);
- text[col] = g_strdup("Unread");
- }
- else {
- free(text[col]);
- text[col] = g_strdup("New");
- }
- }
- else
- text[col] = g_strdup("New");
- col++;
+ text[col] = g_strdup("");
}
temp = header_get_value(find_header(head, "References:"));
@@ -454,6 +440,21 @@
gtk_ctree_insert_node(GTK_CTREE(mail_ctree), top,
NULL, text, 0, NULL, NULL, NULL,
NULL, FALSE, TRUE);
+
+ if (config.ml_read == 1) {
+ found = find_header(head, "Status:");
+ if (found) {
+ text[col] = header_get_value(found);
+ if (strchr(text[col], 'O')) {
+ g_free(text[col]);
+ colormap = gtk_widget_get_colormap(mail_ctree);
+ pixmap = gdk_pixmap_colormap_create_from_xpm(NULL, colormap, &bitmap, NULL, g_strconcat(theme, "read.xpm", NULL));
+ gtk_ctree_node_set_pixmap(GTK_CTREE(mail_ctree), item, col, pixmap, bitmap);
+ gdk_bitmap_unref(bitmap);
+ gdk_pixmap_unref(pixmap);
+ }
+ }
+ }
temp = header_get_value(find_header(head, "Message-Id:"));
if (temp)
|
|
From: CORE C. L. <cor...@li...> - 2000-11-23 02:23:04
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
account.c account.h callbacks.c callbacks.h main.c menus.c
message.h panes.c panes.h
Log Message:
Added a check for message status in the message list, reorganized a bit. Also added a couple fields to the account struct to track the number of new and total messages. Hopefully, I'll get the account pane to show the number of new and total messages tonight.
===================================================================
RCS file: /cvsroot/corem/core/src/account.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- account.c 2000/11/21 23:39:59 1.9
+++ account.c 2000/11/23 02:23:03 1.10
@@ -22,7 +22,9 @@
ret->address = NULL;
ret->server = NULL;
ret->path = NULL;
- ret->fp = NULL;
+ ret->fp = NULL;
+ ret->messages = 0;
+ ret->new_messages = 0;
return ret;
}
@@ -88,6 +90,42 @@
return TRUE;
}
+int account_get_num_messages(Account * ac)
+{
+ if (!ac)
+ return 0;
+
+ return ac->messages;
+}
+
+int account_set_num_messages(Account * ac, int num)
+{
+ if (!ac)
+ return FALSE;
+
+ ac->messages = num;
+
+ return TRUE;
+}
+
+int account_get_num_new_messages(Account * ac)
+{
+ if (!ac)
+ return 0;
+
+ return ac->new_messages;
+}
+
+int account_set_num_new_messages(Account * ac, int num)
+{
+ if (!ac)
+ return FALSE;
+
+ ac->new_messages = num;
+
+ return TRUE;
+}
+
char *account_get_name(Account * ac)
{
if (!ac)
@@ -259,7 +297,7 @@
return TRUE;
}
-Account *get_next_folder()
+Account *get_next_account()
{
struct stat file_stat;
struct dirent *dentry = NULL;
===================================================================
RCS file: /cvsroot/corem/core/src/account.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- account.h 2000/11/21 17:59:01 1.7
+++ account.h 2000/11/23 02:23:03 1.8
@@ -10,8 +10,10 @@
/* 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 */
+ char *path; /* Path to the local mailbox. */
+ int messages; /* Number of messages in mailbox */
+ int new_messages; /* Number of new messages in mailbox */
+ FILE *fp; /* Pointer to the local mailbox file */
/* User specific info */
char *full_name; /* The full name of the user. */
@@ -53,11 +55,21 @@
/* Return a malloc()'d copy of the full name in account ac. */
char *account_get_full_name(Account * ac);
+/* Return the number of messages in the account */
+int account_get_num_messages(Account * ac);
+/* Set the number of messages to num */
+int account_set_num_messages(Account * ac, int num);
+
+/* Return the number of new messages in the account */
+int account_get_num_new_messages(Account * ac);
+/* Set the number of new messages to num */
+int account_set_num_new_messages(Account * ac, int num);
+
/* Read in the settings found in the file path, return an account structure */
Account *account_read(gchar * path);
int account_write(Account * acct);
/* Move through the various folders returning them one at a time */
-Account *get_next_folder(void);
+Account *get_next_account(void);
/* Reset the file pointer for the local mailbox */
int account_reset(Account * ac);
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- callbacks.c 2000/11/22 23:45:00 1.23
+++ callbacks.c 2000/11/23 02:23:03 1.24
@@ -15,101 +15,6 @@
GtkWidget *accounts_win_new;
extern GtkWidget *toolbar;
-/* The main account window */
-void create_account_window()
-{
- 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;
- gchar *titles[] = { "Folder Name", "Full Name", "E-mail Address",
- "Mailbox Path", NULL
- };
-
- /* Window title */
- title = g_strdup_printf("Accounts");
-
- /* Create the account window */
- accounts_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- /* Set title for the account window */
- gtk_window_set_title(GTK_WINDOW(accounts_win), title);
-
- /* Account window main vbox */
- main_vbox = gtk_vbox_new(FALSE, 0);
- gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 0);
- 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_folder())) {
- 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]);
-
- 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,
- mbox,
- (GtkDestroyNotify)
- destroy_account);
- }
-
- hbox = gtk_hbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
-
- /* The buttons at the bottom of the window */
- hbutton_box = gtk_hbutton_box_new();
- gtk_box_pack_start(GTK_BOX(hbox), hbutton_box, FALSE, FALSE, 0);
-
- /* New account button */
- button_new = gtk_button_new_with_label("New");
- gtk_widget_set_usize(GTK_WIDGET(button_new), 55, 22);
- gtk_signal_connect_object(GTK_OBJECT(button_new), "clicked",
- GTK_SIGNAL_FUNC
- (create_accounts_win_new_edit), NULL);
- gtk_container_add(GTK_CONTAINER(hbutton_box), button_new);
-
- /* Edit account button */
- button_edit = gtk_button_new_with_label("Edit");
- gtk_widget_set_usize(GTK_WIDGET(button_edit), 55, 22);
- gtk_signal_connect_object(GTK_OBJECT(button_edit), "clicked",
- GTK_SIGNAL_FUNC
- (create_accounts_win_new_edit), NULL);
- gtk_container_add(GTK_CONTAINER(hbutton_box), button_edit);
-
- /* Remove account button */
- button_remove = gtk_button_new_with_label("Remove");
- gtk_widget_set_usize(GTK_WIDGET(button_remove), 55, 22);
- gtk_container_add(GTK_CONTAINER(hbutton_box), button_remove);
-
- /* Close button */
- button_close = gtk_button_new_with_label("Close");
- gtk_signal_connect_object(GTK_OBJECT(button_close), "clicked",
- GTK_SIGNAL_FUNC(gtk_widget_destroy),
- GTK_OBJECT(accounts_win));
- gtk_container_add(GTK_CONTAINER(hbutton_box), button_close);
-
- /* Show all widgets in the accounts window */
- gtk_widget_show_all(accounts_win);
-}
-
/* The new/edit account window */
void create_accounts_win_new_edit()
{
@@ -511,7 +416,24 @@
}
if (config.ml_read == 1) {
- text[col] = g_strdup("");
+ found = find_header(head, "Status:");
+ if (found) {
+ text[col] = header_get_value(found);
+ if (strchr(text[col], 'R')) {
+ free(text[col]);
+ text[col] = g_strdup("Read");
+ }
+ else if (strchr(text[col], 'O')) {
+ free(text[col]);
+ text[col] = g_strdup("Unread");
+ }
+ else {
+ free(text[col]);
+ text[col] = g_strdup("New");
+ }
+ }
+ else
+ text[col] = g_strdup("New");
col++;
}
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- callbacks.h 2000/11/22 23:45:00 1.10
+++ callbacks.h 2000/11/23 02:23:03 1.11
@@ -56,9 +56,6 @@
/* Quit core funcion */
void core_main_quit(void);
-/* The main account window */
-void create_account_window();
-
/* The new/edit account window */
void create_accounts_win_new_edit(void);
===================================================================
RCS file: /cvsroot/corem/core/src/main.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- main.c 2000/11/23 01:08:37 1.14
+++ main.c 2000/11/23 02:23:03 1.15
@@ -95,15 +95,15 @@
- hpane = gtk_hpaned_new();
+ hpane = gtk_hpaned_new();
- {
- pane = core_create_folder_pane();
- gtk_paned_pack1(GTK_PANED(hpane), pane, TRUE, TRUE);
+ {
+ pane = core_create_folder_pane();
+ gtk_paned_pack1(GTK_PANED(hpane), pane, TRUE, TRUE);
- pane = core_create_mlist_pane();
- gtk_paned_pack2(GTK_PANED(hpane), pane, TRUE, TRUE);
- }
+ pane = core_create_mlist_pane();
+ gtk_paned_pack2(GTK_PANED(hpane), pane, TRUE, TRUE);
+ }
main_menu = create_main_menu();
gtk_container_set_border_width(GTK_CONTAINER(main_menu), 0);
===================================================================
RCS file: /cvsroot/corem/core/src/menus.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- menus.c 2000/11/23 01:08:37 1.8
+++ menus.c 2000/11/23 02:23:03 1.9
@@ -41,11 +41,12 @@
*viewmenu, *help, *helpmenu;
GtkWidget *quit, *accounts, *preferences, *themes, *themesmenu,
*toolbar, *toolbarmenu, *show, *text, *icons, *both, *about,
- *message_list, *message_listmenu, *mline_style, *mline_stylemenu,
- *mline_none, *mline_solid, *mline_dotted, *mline_tabbed, *folder_list,
- *folder_listmenu, *fline_style, *fline_stylemenu, *fline_none,
- *fline_solid, *fline_dotted, *fline_tabbed, *mpriority,
- *mread, *mattachment, *mscore, *mfrom, *msubject, *mdate, *mserver;
+ *message_list, *message_listmenu, *mline_style,
+ *mline_stylemenu, *mline_none, *mline_solid, *mline_dotted,
+ *mline_tabbed, *folder_list, *folder_listmenu, *fline_style,
+ *fline_stylemenu, *fline_none, *fline_solid, *fline_dotted,
+ *fline_tabbed, *mpriority, *mread, *mattachment, *mscore,
+ *mfrom, *msubject, *mdate, *mserver;
GSList *radio_buttons = NULL;
GSList *mline_radio = NULL;
GSList *fline_radio = NULL;
@@ -176,47 +177,64 @@
gtk_menu_append(GTK_MENU(message_listmenu), mline_style);
mline_stylemenu = gtk_menu_new();
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(mline_style), mline_stylemenu);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(mline_style),
+ mline_stylemenu);
- mline_none = gtk_radio_menu_item_new_with_label(mline_radio, "None");
- mline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_none));
+ mline_none =
+ gtk_radio_menu_item_new_with_label(mline_radio, "None");
+ mline_radio =
+ gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_none));
gtk_signal_connect_object(GTK_OBJECT(mline_none), "toggled",
- GTK_SIGNAL_FUNC(mail_ctree_change_line_style),
- GINT_TO_POINTER(0));
+ GTK_SIGNAL_FUNC
+ (mail_ctree_change_line_style),
+ GINT_TO_POINTER(0));
gtk_menu_append(GTK_MENU(mline_stylemenu), mline_none);
+
+ mline_solid =
+ gtk_radio_menu_item_new_with_label(mline_radio, "Solid");
+ mline_radio =
+ gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_solid));
+ gtk_signal_connect_object(GTK_OBJECT(mline_solid), "toggled",
+ GTK_SIGNAL_FUNC
+ (mail_ctree_change_line_style),
+ GINT_TO_POINTER(1));
+ gtk_menu_append(GTK_MENU(mline_stylemenu), mline_solid);
+
+ mline_dotted =
+ gtk_radio_menu_item_new_with_label(mline_radio, "Dotted");
+ mline_radio =
+ gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_dotted));
+ gtk_signal_connect_object(GTK_OBJECT(mline_none), "toggled",
+ GTK_SIGNAL_FUNC
+ (mail_ctree_change_line_style),
+ GINT_TO_POINTER(2));
+ gtk_menu_append(GTK_MENU(mline_stylemenu), mline_dotted);
- mline_solid = gtk_radio_menu_item_new_with_label(mline_radio, "Solid");
- mline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_solid));
- gtk_signal_connect_object(GTK_OBJECT(mline_solid), "toggled",
- GTK_SIGNAL_FUNC(mail_ctree_change_line_style),
- GINT_TO_POINTER(1));
- gtk_menu_append(GTK_MENU(mline_stylemenu), mline_solid);
-
- mline_dotted = gtk_radio_menu_item_new_with_label(mline_radio, "Dotted");
- mline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_dotted));
- gtk_signal_connect_object(GTK_OBJECT(mline_none), "toggled",
- GTK_SIGNAL_FUNC(mail_ctree_change_line_style),
- GINT_TO_POINTER(2));
- gtk_menu_append(GTK_MENU(mline_stylemenu), mline_dotted);
-
- mline_tabbed = gtk_radio_menu_item_new_with_label(mline_radio, "Tabbed");
- mline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_tabbed));
- gtk_signal_connect_object(GTK_OBJECT(mline_tabbed), "toggled",
- GTK_SIGNAL_FUNC(mail_ctree_change_line_style),
- GINT_TO_POINTER(3));
- gtk_menu_append(GTK_MENU(mline_stylemenu), mline_tabbed);
+ mline_tabbed =
+ gtk_radio_menu_item_new_with_label(mline_radio, "Tabbed");
+ mline_radio =
+ gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_tabbed));
+ gtk_signal_connect_object(GTK_OBJECT(mline_tabbed), "toggled",
+ GTK_SIGNAL_FUNC
+ (mail_ctree_change_line_style),
+ GINT_TO_POINTER(3));
+ gtk_menu_append(GTK_MENU(mline_stylemenu), mline_tabbed);
if (config.ml_linestyle == 0)
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mline_none), TRUE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (mline_none), TRUE);
- if (config.ml_linestyle == 1)
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mline_solid), TRUE);
+ if (config.ml_linestyle == 1)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (mline_solid), TRUE);
- if (config.ml_linestyle == 2)
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mline_dotted), TRUE);
+ if (config.ml_linestyle == 2)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (mline_dotted), TRUE);
- if (config.ml_linestyle == 3)
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mline_tabbed), TRUE);
+ if (config.ml_linestyle == 3)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (mline_tabbed), TRUE);
mpriority = gtk_check_menu_item_new_with_label("Show Priority");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mpriority),
@@ -279,58 +297,75 @@
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
(mserver), TRUE);
- folder_list = gtk_menu_item_new_with_label("Folder List");
- gtk_menu_append(GTK_MENU(viewmenu), folder_list);
+ folder_list = gtk_menu_item_new_with_label("Folder List");
+ gtk_menu_append(GTK_MENU(viewmenu), folder_list);
- folder_listmenu = gtk_menu_new();
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(folder_list),
- folder_listmenu);
-
- fline_style = gtk_menu_item_new_with_label("Line Style");
- gtk_menu_append(GTK_MENU(folder_listmenu), fline_style);
-
- fline_stylemenu = gtk_menu_new();
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(fline_style), fline_stylemenu);
-
- fline_none = gtk_radio_menu_item_new_with_label(fline_radio, "None");
- fline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_none));
- gtk_signal_connect_object(GTK_OBJECT(fline_none), "toggled",
- GTK_SIGNAL_FUNC(folder_ctree_change_line_style),
- GINT_TO_POINTER(0));
- gtk_menu_append(GTK_MENU(fline_stylemenu), fline_none);
-
- fline_solid = gtk_radio_menu_item_new_with_label(fline_radio, "Solid");
- fline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_solid));
- gtk_signal_connect_object(GTK_OBJECT(fline_solid), "toggled",
- GTK_SIGNAL_FUNC(folder_ctree_change_line_style),
- GINT_TO_POINTER(1));
- gtk_menu_append(GTK_MENU(fline_stylemenu), fline_solid);
-
- fline_dotted = gtk_radio_menu_item_new_with_label(fline_radio, "Dotted");
- fline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_dotted));
- gtk_signal_connect_object(GTK_OBJECT(fline_none), "toggled",
- GTK_SIGNAL_FUNC(folder_ctree_change_line_style),
- GINT_TO_POINTER(2));
- gtk_menu_append(GTK_MENU(fline_stylemenu), fline_dotted);
-
- fline_tabbed = gtk_radio_menu_item_new_with_label(fline_radio, "Tabbed");
- fline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_tabbed));
- gtk_signal_connect_object(GTK_OBJECT(fline_tabbed), "toggled",
- GTK_SIGNAL_FUNC(folder_ctree_change_line_style),
- GINT_TO_POINTER(3));
- gtk_menu_append(GTK_MENU(fline_stylemenu), fline_tabbed);
-
- if (config.fl_linestyle == 0)
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(fline_none), TRUE);
+ folder_listmenu = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(folder_list),
+ folder_listmenu);
+
+ fline_style = gtk_menu_item_new_with_label("Line Style");
+ gtk_menu_append(GTK_MENU(folder_listmenu), fline_style);
+
+ fline_stylemenu = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(fline_style),
+ fline_stylemenu);
+
+ fline_none =
+ gtk_radio_menu_item_new_with_label(fline_radio, "None");
+ fline_radio =
+ gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_none));
+ gtk_signal_connect_object(GTK_OBJECT(fline_none), "toggled",
+ GTK_SIGNAL_FUNC
+ (folder_ctree_change_line_style),
+ GINT_TO_POINTER(0));
+ gtk_menu_append(GTK_MENU(fline_stylemenu), fline_none);
- if (config.fl_linestyle == 1)
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(fline_solid), TRUE);
+ fline_solid =
+ gtk_radio_menu_item_new_with_label(fline_radio, "Solid");
+ fline_radio =
+ gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_solid));
+ gtk_signal_connect_object(GTK_OBJECT(fline_solid), "toggled",
+ GTK_SIGNAL_FUNC
+ (folder_ctree_change_line_style),
+ GINT_TO_POINTER(1));
+ gtk_menu_append(GTK_MENU(fline_stylemenu), fline_solid);
+
+ fline_dotted =
+ gtk_radio_menu_item_new_with_label(fline_radio, "Dotted");
+ fline_radio =
+ gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_dotted));
+ gtk_signal_connect_object(GTK_OBJECT(fline_none), "toggled",
+ GTK_SIGNAL_FUNC
+ (folder_ctree_change_line_style),
+ GINT_TO_POINTER(2));
+ gtk_menu_append(GTK_MENU(fline_stylemenu), fline_dotted);
+
+ fline_tabbed =
+ gtk_radio_menu_item_new_with_label(fline_radio, "Tabbed");
+ fline_radio =
+ gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_tabbed));
+ gtk_signal_connect_object(GTK_OBJECT(fline_tabbed), "toggled",
+ GTK_SIGNAL_FUNC
+ (folder_ctree_change_line_style),
+ GINT_TO_POINTER(3));
+ gtk_menu_append(GTK_MENU(fline_stylemenu), fline_tabbed);
+
+ if (config.fl_linestyle == 0)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (fline_none), TRUE);
- if (config.fl_linestyle == 2)
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(fline_dotted), TRUE);
+ if (config.fl_linestyle == 1)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (fline_solid), TRUE);
- if (config.fl_linestyle == 3)
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(fline_tabbed), TRUE);
+ if (config.fl_linestyle == 2)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (fline_dotted), TRUE);
+
+ if (config.fl_linestyle == 3)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (fline_tabbed), TRUE);
/********************************
* Help menu *
@@ -408,11 +443,14 @@
FALSE, FALSE, 0);
gtk_container_add(GTK_CONTAINER(menu_item),
hbox);
- gtk_signal_connect_object(GTK_OBJECT(menu_item),
- "activate",
- GTK_SIGNAL_FUNC
- (switch_theme),
- g_strdup(dent->d_name));
+ gtk_signal_connect_object(GTK_OBJECT
+ (menu_item),
+ "activate",
+ GTK_SIGNAL_FUNC
+ (switch_theme),
+ (gpointer)
+ g_strdup(dent->
+ d_name));
gtk_menu_append(GTK_MENU(menu), menu_item);
g_free(temp);
}
===================================================================
RCS file: /cvsroot/corem/core/src/message.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -3 -r1.1.1.1 -r1.2
--- message.h 2000/11/14 19:23:24 1.1.1.1
+++ message.h 2000/11/23 02:23:03 1.2
@@ -17,6 +17,7 @@
} MessageFlags;
#define SHOW_ALL (SHOW_ACCOUNT | SHOW_FROM | SHOW_TO | SHOW_CC | SHOW_BCC | SHOW_SUBJECT)
+#define is_new(m) (strchr(find_header(message_get_headers(m), "Status:", 'N')))
Message *new_message();
int destroy_message(Message * message);
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- panes.c 2000/11/23 01:08:37 1.10
+++ panes.c 2000/11/23 02:23:03 1.11
@@ -9,7 +9,9 @@
GtkWidget *folder_ctree;
extern GtkWidget *main_win;
extern GtkWidget *hpane;
+extern GtkWidget *ctree;
extern gchar *theme;
+extern gchar *title;
GtkWidget *core_create_folder_pane()
{
@@ -71,7 +73,7 @@
text, 0, cpixmap, cbitmap, opixmap,
obitmap, FALSE, TRUE);
- while ((mbox = get_next_folder())) {
+ while ((mbox = get_next_account())) {
if (text[0])
g_free(text[0]);
@@ -98,14 +100,18 @@
gtk_widget_set_usize(scroll, 12, 50);
gtk_widget_show_all(folder_ctree);
- if (config.ml_linestyle == 0)
- gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_NONE);
- if (config.ml_linestyle == 1)
- gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_SOLID);
- if (config.ml_linestyle == 2)
- gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_DOTTED);
- if (config.ml_linestyle == 3)
- gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_TABBED);
+ if (config.ml_linestyle == 0)
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree),
+ GTK_CTREE_LINES_NONE);
+ if (config.ml_linestyle == 1)
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree),
+ GTK_CTREE_LINES_SOLID);
+ if (config.ml_linestyle == 2)
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree),
+ GTK_CTREE_LINES_DOTTED);
+ if (config.ml_linestyle == 3)
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
+ GTK_CTREE_LINES_TABBED);
return (scroll);
}
@@ -202,7 +208,7 @@
if (config.ml_date == 1) {
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), idate,
- 150);
+ 120);
}
if (config.ml_server == 1) {
@@ -227,7 +233,7 @@
gtk_clist_set_column_widget(GTK_CLIST(mail_ctree), iread,
read);
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), iread,
- 8);
+ 38);
gtk_clist_set_column_auto_resize(GTK_CLIST(mail_ctree),
iread, FALSE);
gdk_bitmap_unref(bitmap);
@@ -280,17 +286,117 @@
gtk_container_add(GTK_CONTAINER(scroll), mail_ctree);
gtk_widget_show_all(mail_ctree);
if (config.ml_linestyle == 0)
- gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_NONE);
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
+ GTK_CTREE_LINES_NONE);
if (config.ml_linestyle == 1)
- gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_SOLID);
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
+ GTK_CTREE_LINES_SOLID);
if (config.ml_linestyle == 2)
- gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_DOTTED);
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
+ GTK_CTREE_LINES_DOTTED);
if (config.ml_linestyle == 3)
- gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_TABBED);
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
+ GTK_CTREE_LINES_TABBED);
return (scroll);
}
+/* The main account window */
+void create_account_window()
+{
+ 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;
+ gchar *titles[] = { "Folder Name", "Full Name", "E-mail Address",
+ "Mailbox Path", NULL
+ };
+
+ /* Window title */
+ title = g_strdup_printf("Accounts");
+
+ /* Create the account window */
+ accounts_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ /* Set title for the account window */
+ gtk_window_set_title(GTK_WINDOW(accounts_win), title);
+
+ /* Account window main vbox */
+ main_vbox = gtk_vbox_new(FALSE, 0);
+ gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 0);
+ 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]);
+
+ 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,
+ mbox,
+ (GtkDestroyNotify)
+ destroy_account);
+ }
+
+ hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
+
+ /* The buttons at the bottom of the window */
+ hbutton_box = gtk_hbutton_box_new();
+ gtk_box_pack_start(GTK_BOX(hbox), hbutton_box, FALSE, FALSE, 0);
+
+ /* New account button */
+ button_new = gtk_button_new_with_label("New");
+ gtk_widget_set_usize(GTK_WIDGET(button_new), 55, 22);
+ gtk_signal_connect_object(GTK_OBJECT(button_new), "clicked",
+ GTK_SIGNAL_FUNC
+ (create_accounts_win_new_edit), NULL);
+ gtk_container_add(GTK_CONTAINER(hbutton_box), button_new);
+
+ /* Edit account button */
+ button_edit = gtk_button_new_with_label("Edit");
+ gtk_widget_set_usize(GTK_WIDGET(button_edit), 55, 22);
+ gtk_signal_connect_object(GTK_OBJECT(button_edit), "clicked",
+ GTK_SIGNAL_FUNC
+ (create_accounts_win_new_edit), NULL);
+ gtk_container_add(GTK_CONTAINER(hbutton_box), button_edit);
+
+ /* Remove account button */
+ button_remove = gtk_button_new_with_label("Remove");
+ gtk_widget_set_usize(GTK_WIDGET(button_remove), 55, 22);
+ gtk_container_add(GTK_CONTAINER(hbutton_box), button_remove);
+
+ /* Close button */
+ button_close = gtk_button_new_with_label("Close");
+ gtk_signal_connect_object(GTK_OBJECT(button_close), "clicked",
+ GTK_SIGNAL_FUNC(gtk_widget_destroy),
+ GTK_OBJECT(accounts_win));
+ gtk_container_add(GTK_CONTAINER(hbutton_box), button_close);
+
+ /* Show all widgets in the accounts window */
+ gtk_widget_show_all(accounts_win);
+}
+
+
GtkWidget *core_create_message_pane(Message * message, MessageFlags mode)
{
GtkWidget *vbox;
@@ -497,47 +603,55 @@
void folder_ctree_change_line_style(gint type)
{
- if (type == 0) {
- config.fl_linestyle = 0;
- gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_NONE);
- }
-
- if (type == 1) {
- config.fl_linestyle = 1;
- gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_SOLID);
- }
-
- if (type == 2) {
- config.fl_linestyle = 2;
- gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_DOTTED);
- }
-
- if (type == 3) {
- config.fl_linestyle = 3;
- gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_TABBED);
- }
+ if (type == 0) {
+ config.fl_linestyle = 0;
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree),
+ GTK_CTREE_LINES_NONE);
+ }
+
+ if (type == 1) {
+ config.fl_linestyle = 1;
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree),
+ GTK_CTREE_LINES_SOLID);
+ }
+
+ if (type == 2) {
+ config.fl_linestyle = 2;
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree),
+ GTK_CTREE_LINES_DOTTED);
+ }
+
+ if (type == 3) {
+ config.fl_linestyle = 3;
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree),
+ GTK_CTREE_LINES_TABBED);
+ }
}
void mail_ctree_change_line_style(gint type)
{
- if (type == 0) {
- config.ml_linestyle = 0;
- gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_NONE);
- }
-
- if (type == 1) {
- config.ml_linestyle = 1;
- gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_SOLID);
- }
-
- if (type == 2) {
- config.ml_linestyle = 2;
- gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_DOTTED);
- }
-
- if (type == 3) {
- config.ml_linestyle = 3;
- gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_TABBED);
- }
+ if (type == 0) {
+ config.ml_linestyle = 0;
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
+ GTK_CTREE_LINES_NONE);
+ }
+
+ if (type == 1) {
+ config.ml_linestyle = 1;
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
+ GTK_CTREE_LINES_SOLID);
+ }
+
+ if (type == 2) {
+ config.ml_linestyle = 2;
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
+ GTK_CTREE_LINES_DOTTED);
+ }
+
+ if (type == 3) {
+ config.ml_linestyle = 3;
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree),
+ GTK_CTREE_LINES_TABBED);
+ }
}
===================================================================
RCS file: /cvsroot/corem/core/src/panes.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- panes.h 2000/11/23 01:08:37 1.4
+++ panes.h 2000/11/23 02:23:03 1.5
@@ -4,3 +4,6 @@
GtkWidget *core_create_fonts_page(GtkWidget * window);
void folder_ctree_change_line_style(gint type);
void mail_ctree_change_line_style(gint type);
+
+/* The main account window */
+void create_account_window();
|
|
From: CORE C. L. <cor...@li...> - 2000-11-23 01:08:39
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
core.h main.c menus.c panes.c panes.h prefs.c
Log Message:
added some menuitems, where you can change the ctree line style....
===================================================================
RCS file: /cvsroot/corem/core/src/core.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- core.h 2000/11/22 09:02:01 1.8
+++ core.h 2000/11/23 01:08:37 1.9
@@ -20,4 +20,6 @@
gboolean ml_subject;
gboolean ml_date;
gboolean ml_server;
+ gboolean ml_linestyle;
+ gboolean fl_linestyle;
} ConfigData;
===================================================================
RCS file: /cvsroot/corem/core/src/main.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- main.c 2000/11/22 23:45:00 1.13
+++ main.c 2000/11/23 01:08:37 1.14
@@ -93,6 +93,18 @@
thandle = gtk_handle_box_new();
create_main_toolbar();
+
+
+ hpane = gtk_hpaned_new();
+
+ {
+ pane = core_create_folder_pane();
+ gtk_paned_pack1(GTK_PANED(hpane), pane, TRUE, TRUE);
+
+ pane = core_create_mlist_pane();
+ gtk_paned_pack2(GTK_PANED(hpane), pane, TRUE, TRUE);
+ }
+
main_menu = create_main_menu();
gtk_container_set_border_width(GTK_CONTAINER(main_menu), 0);
gtk_container_add(GTK_CONTAINER(mhandle), main_menu);
@@ -105,17 +117,7 @@
GTK_POS_LEFT);
gtk_box_pack_start(GTK_BOX(main_vbox), thandle, FALSE, FALSE, 0);
- hpane = gtk_hpaned_new();
gtk_box_pack_start(GTK_BOX(main_vbox), hpane, TRUE, TRUE, 0);
-
- {
- pane = core_create_folder_pane();
- gtk_paned_pack1(GTK_PANED(hpane), pane, TRUE, TRUE);
-
- pane = core_create_mlist_pane();
- gtk_paned_pack2(GTK_PANED(hpane), pane, TRUE, TRUE);
- }
-
gtk_widget_show_all(main_win);
if (config.tb_show == 0) {
===================================================================
RCS file: /cvsroot/corem/core/src/menus.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- menus.c 2000/11/22 23:45:00 1.7
+++ menus.c 2000/11/23 01:08:37 1.8
@@ -2,6 +2,7 @@
#include "core.h"
#include "menus.h"
#include "callbacks.h"
+#include "panes.h"
#include "prefs.h"
ConfigData config;
@@ -40,9 +41,14 @@
*viewmenu, *help, *helpmenu;
GtkWidget *quit, *accounts, *preferences, *themes, *themesmenu,
*toolbar, *toolbarmenu, *show, *text, *icons, *both, *about,
- *message_list, *message_listmenu, *mpriority, *mread,
- *mattachment, *mscore, *mfrom, *msubject, *mdate, *mserver;
+ *message_list, *message_listmenu, *mline_style, *mline_stylemenu,
+ *mline_none, *mline_solid, *mline_dotted, *mline_tabbed, *folder_list,
+ *folder_listmenu, *fline_style, *fline_stylemenu, *fline_none,
+ *fline_solid, *fline_dotted, *fline_tabbed, *mpriority,
+ *mread, *mattachment, *mscore, *mfrom, *msubject, *mdate, *mserver;
GSList *radio_buttons = NULL;
+ GSList *mline_radio = NULL;
+ GSList *fline_radio = NULL;
menu = gtk_menu_bar_new();
/********************************
* File menu *
@@ -166,6 +172,52 @@
gtk_menu_item_set_submenu(GTK_MENU_ITEM(message_list),
message_listmenu);
+ mline_style = gtk_menu_item_new_with_label("Line Style");
+ gtk_menu_append(GTK_MENU(message_listmenu), mline_style);
+
+ mline_stylemenu = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(mline_style), mline_stylemenu);
+
+ mline_none = gtk_radio_menu_item_new_with_label(mline_radio, "None");
+ mline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_none));
+ gtk_signal_connect_object(GTK_OBJECT(mline_none), "toggled",
+ GTK_SIGNAL_FUNC(mail_ctree_change_line_style),
+ GINT_TO_POINTER(0));
+ gtk_menu_append(GTK_MENU(mline_stylemenu), mline_none);
+
+ mline_solid = gtk_radio_menu_item_new_with_label(mline_radio, "Solid");
+ mline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_solid));
+ gtk_signal_connect_object(GTK_OBJECT(mline_solid), "toggled",
+ GTK_SIGNAL_FUNC(mail_ctree_change_line_style),
+ GINT_TO_POINTER(1));
+ gtk_menu_append(GTK_MENU(mline_stylemenu), mline_solid);
+
+ mline_dotted = gtk_radio_menu_item_new_with_label(mline_radio, "Dotted");
+ mline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_dotted));
+ gtk_signal_connect_object(GTK_OBJECT(mline_none), "toggled",
+ GTK_SIGNAL_FUNC(mail_ctree_change_line_style),
+ GINT_TO_POINTER(2));
+ gtk_menu_append(GTK_MENU(mline_stylemenu), mline_dotted);
+
+ mline_tabbed = gtk_radio_menu_item_new_with_label(mline_radio, "Tabbed");
+ mline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(mline_tabbed));
+ gtk_signal_connect_object(GTK_OBJECT(mline_tabbed), "toggled",
+ GTK_SIGNAL_FUNC(mail_ctree_change_line_style),
+ GINT_TO_POINTER(3));
+ gtk_menu_append(GTK_MENU(mline_stylemenu), mline_tabbed);
+
+ if (config.ml_linestyle == 0)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mline_none), TRUE);
+
+ if (config.ml_linestyle == 1)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mline_solid), TRUE);
+
+ if (config.ml_linestyle == 2)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mline_dotted), TRUE);
+
+ if (config.ml_linestyle == 3)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mline_tabbed), TRUE);
+
mpriority = gtk_check_menu_item_new_with_label("Show Priority");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mpriority),
FALSE);
@@ -226,6 +278,59 @@
if (config.ml_server == 1)
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
(mserver), TRUE);
+
+ folder_list = gtk_menu_item_new_with_label("Folder List");
+ gtk_menu_append(GTK_MENU(viewmenu), folder_list);
+
+ folder_listmenu = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(folder_list),
+ folder_listmenu);
+
+ fline_style = gtk_menu_item_new_with_label("Line Style");
+ gtk_menu_append(GTK_MENU(folder_listmenu), fline_style);
+
+ fline_stylemenu = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(fline_style), fline_stylemenu);
+
+ fline_none = gtk_radio_menu_item_new_with_label(fline_radio, "None");
+ fline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_none));
+ gtk_signal_connect_object(GTK_OBJECT(fline_none), "toggled",
+ GTK_SIGNAL_FUNC(folder_ctree_change_line_style),
+ GINT_TO_POINTER(0));
+ gtk_menu_append(GTK_MENU(fline_stylemenu), fline_none);
+
+ fline_solid = gtk_radio_menu_item_new_with_label(fline_radio, "Solid");
+ fline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_solid));
+ gtk_signal_connect_object(GTK_OBJECT(fline_solid), "toggled",
+ GTK_SIGNAL_FUNC(folder_ctree_change_line_style),
+ GINT_TO_POINTER(1));
+ gtk_menu_append(GTK_MENU(fline_stylemenu), fline_solid);
+
+ fline_dotted = gtk_radio_menu_item_new_with_label(fline_radio, "Dotted");
+ fline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_dotted));
+ gtk_signal_connect_object(GTK_OBJECT(fline_none), "toggled",
+ GTK_SIGNAL_FUNC(folder_ctree_change_line_style),
+ GINT_TO_POINTER(2));
+ gtk_menu_append(GTK_MENU(fline_stylemenu), fline_dotted);
+
+ fline_tabbed = gtk_radio_menu_item_new_with_label(fline_radio, "Tabbed");
+ fline_radio = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(fline_tabbed));
+ gtk_signal_connect_object(GTK_OBJECT(fline_tabbed), "toggled",
+ GTK_SIGNAL_FUNC(folder_ctree_change_line_style),
+ GINT_TO_POINTER(3));
+ gtk_menu_append(GTK_MENU(fline_stylemenu), fline_tabbed);
+
+ if (config.fl_linestyle == 0)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(fline_none), TRUE);
+
+ if (config.fl_linestyle == 1)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(fline_solid), TRUE);
+
+ if (config.fl_linestyle == 2)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(fline_dotted), TRUE);
+
+ if (config.fl_linestyle == 3)
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(fline_tabbed), TRUE);
/********************************
* Help menu *
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- panes.c 2000/11/22 23:45:00 1.9
+++ panes.c 2000/11/23 01:08:37 1.10
@@ -96,7 +96,17 @@
gtk_clist_set_column_width(GTK_CLIST(folder_ctree), 0, 100);
gtk_widget_set_usize(scroll, 12, 50);
+ gtk_widget_show_all(folder_ctree);
+ if (config.ml_linestyle == 0)
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_NONE);
+ if (config.ml_linestyle == 1)
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_SOLID);
+ if (config.ml_linestyle == 2)
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_DOTTED);
+ if (config.ml_linestyle == 3)
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_TABBED);
+
return (scroll);
}
@@ -268,7 +278,15 @@
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add(GTK_CONTAINER(scroll), mail_ctree);
-
+ gtk_widget_show_all(mail_ctree);
+ if (config.ml_linestyle == 0)
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_NONE);
+ if (config.ml_linestyle == 1)
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_SOLID);
+ if (config.ml_linestyle == 2)
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_DOTTED);
+ if (config.ml_linestyle == 3)
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_TABBED);
return (scroll);
}
@@ -474,4 +492,52 @@
gtk_box_pack_start(GTK_BOX(vbox), scroll, TRUE, TRUE, 0);
return (vbox);
+}
+
+
+void folder_ctree_change_line_style(gint type)
+{
+ if (type == 0) {
+ config.fl_linestyle = 0;
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_NONE);
+ }
+
+ if (type == 1) {
+ config.fl_linestyle = 1;
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_SOLID);
+ }
+
+ if (type == 2) {
+ config.fl_linestyle = 2;
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_DOTTED);
+ }
+
+ if (type == 3) {
+ config.fl_linestyle = 3;
+ gtk_ctree_set_line_style(GTK_CTREE(folder_ctree), GTK_CTREE_LINES_TABBED);
+ }
+}
+
+
+void mail_ctree_change_line_style(gint type)
+{
+ if (type == 0) {
+ config.ml_linestyle = 0;
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_NONE);
+ }
+
+ if (type == 1) {
+ config.ml_linestyle = 1;
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_SOLID);
+ }
+
+ if (type == 2) {
+ config.ml_linestyle = 2;
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_DOTTED);
+ }
+
+ if (type == 3) {
+ config.ml_linestyle = 3;
+ gtk_ctree_set_line_style(GTK_CTREE(mail_ctree), GTK_CTREE_LINES_TABBED);
+ }
}
===================================================================
RCS file: /cvsroot/corem/core/src/panes.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- panes.h 2000/11/14 19:38:44 1.3
+++ panes.h 2000/11/23 01:08:37 1.4
@@ -1,6 +1,6 @@
-
GtkWidget *core_create_folder_pane(void);
GtkWidget *core_create_mlist_pane(void);
GtkWidget *core_create_message_pane(Message * message, MessageFlags mode);
-
GtkWidget *core_create_fonts_page(GtkWidget * window);
+void folder_ctree_change_line_style(gint type);
+void mail_ctree_change_line_style(gint type);
===================================================================
RCS file: /cvsroot/corem/core/src/prefs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- prefs.c 2000/11/21 22:33:40 1.5
+++ prefs.c 2000/11/23 01:08:37 1.6
@@ -352,6 +352,8 @@
config.ml_subject = 1;
config.ml_date = 1;
config.ml_server = 0;
+ config.ml_linestyle = 2;
+ config.fl_linestyle = 2;
config.theme = g_strdup("default");
home = getenv("HOME");
rc = g_strconcat(home, "/.corerc", NULL);
@@ -391,6 +393,10 @@
config.ml_date = atoi(line + 8);
} else if (g_strncasecmp(line, "ml_server=", 10) == 0) {
config.ml_server = atoi(line + 10);
+ } else if (g_strncasecmp(line, "ml_linestyle=", 13) == 0) {
+ config.ml_linestyle = atoi(line + 13);
+ } else if (g_strncasecmp(line, "fl_linestyle=", 13) == 0) {
+ config.fl_linestyle = atoi(line + 13);
} else if (g_strncasecmp(line, "theme=", 6) == 0) {
config.theme = g_strdup(line + 6);
}
@@ -432,6 +438,8 @@
fprintf(config_file, "ml_subject=%d\n", config.ml_subject);
fprintf(config_file, "ml_date=%d\n", config.ml_date);
fprintf(config_file, "ml_server=%d\n", config.ml_server);
+ fprintf(config_file, "ml_linestyle=%d\n", config.ml_linestyle);
+ fprintf(config_file, "fl_linestyle=%d\n", config.fl_linestyle);
fprintf(config_file, "theme=%s\n", config.theme);
g_free(rc);
return;
|
|
From: CORE C. L. <cor...@li...> - 2000-11-22 23:45:01
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
callbacks.c callbacks.h main.c menus.c menus.h panes.c
Log Message:
A few sanity checks, and some code to test.
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- callbacks.c 2000/11/22 09:02:01 1.22
+++ callbacks.c 2000/11/22 23:45:00 1.23
@@ -26,7 +26,8 @@
GtkWidget *button_new, *button_edit, *button_remove, *button_close;
gchar **text = NULL;
gchar *titles[] = { "Folder Name", "Full Name", "E-mail Address",
- "Mailbox Path", NULL };
+ "Mailbox Path", NULL
+ };
/* Window title */
title = g_strdup_printf("Accounts");
@@ -42,8 +43,8 @@
gtk_container_add(GTK_CONTAINER(accounts_win), main_vbox);
/* The clist for browsing accounts */
- ctree = gtk_ctree_new_with_titles(4, 0, titles);
- gtk_container_add(GTK_CONTAINER(main_vbox), ctree);
+ ctree = gtk_clist_new_with_titles(4, titles);
+ gtk_box_pack_start(GTK_BOX(main_vbox), ctree, TRUE, FALSE, 0);
while ((mbox = get_next_folder())) {
if (text[0])
g_free(text[0]);
@@ -61,9 +62,13 @@
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, mbox,
- (GtkDestroyNotify)destroy_account);
+ NULL, NULL, text, 0, NULL,
+ NULL, NULL, NULL, FALSE,
+ FALSE);
+ gtk_ctree_node_set_row_data_full(GTK_CTREE(ctree), item,
+ mbox,
+ (GtkDestroyNotify)
+ destroy_account);
}
hbox = gtk_hbox_new(FALSE, 0);
@@ -277,14 +282,20 @@
return;
}
-void switch_theme(gchar *theme)
+void switch_theme(gchar * theme)
{
- g_free(config.theme);
+ if (!theme)
+ return;
+
+ if (strcmp(theme, config.theme) == 0)
+ return;
+
+ g_free(config.theme);
config.theme = g_strdup(theme);
- set_theme_dir();
- gtk_widget_destroy(toolbar);
- create_main_toolbar();
- return;
+ set_theme_dir();
+ gtk_widget_destroy(toolbar);
+ create_main_toolbar();
+ return;
}
/* This creates the preference window with the correct title About */
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- callbacks.h 2000/11/22 09:02:01 1.9
+++ callbacks.h 2000/11/22 23:45:00 1.10
@@ -66,4 +66,4 @@
void save_account(void);
/* Function for switching the where *theme is the directory name of the theme */
-void switch_theme(gchar *theme);
+void switch_theme(gchar * theme);
===================================================================
RCS file: /cvsroot/corem/core/src/main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- main.c 2000/11/22 09:02:01 1.12
+++ main.c 2000/11/22 23:45:00 1.13
@@ -139,11 +139,15 @@
{
DIR *dir;
gchar *tmp;
- tmp = g_strconcat(getenv("HOME"), "/.core/themes/", config.theme, "/", NULL);
+ tmp =
+ g_strconcat(getenv("HOME"), "/.core/themes/", config.theme,
+ "/", NULL);
dir = opendir(tmp);
if (dir != NULL) {
- theme = g_strconcat(getenv("HOME"), "/.core/themes/", config.theme, "/", NULL);
+ theme =
+ g_strconcat(getenv("HOME"), "/.core/themes/",
+ config.theme, "/", NULL);
return TRUE;
}
tmp = g_strconcat(CORE_SHARE, "/themes/", config.theme, NULL);
===================================================================
RCS file: /cvsroot/corem/core/src/menus.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- menus.c 2000/11/22 09:02:01 1.6
+++ menus.c 2000/11/22 23:45:00 1.7
@@ -38,10 +38,10 @@
{
GtkWidget *menu, *file, *filemenu, *edit, *editmenu, *view,
*viewmenu, *help, *helpmenu;
- GtkWidget *quit, *accounts, *preferences, *themes, *themesmenu, *toolbar, *toolbarmenu,
- *show, *text, *icons, *both, *about, *message_list,
- *message_listmenu, *mpriority, *mread, *mattachment, *mscore,
- *mfrom, *msubject, *mdate, *mserver;
+ GtkWidget *quit, *accounts, *preferences, *themes, *themesmenu,
+ *toolbar, *toolbarmenu, *show, *text, *icons, *both, *about,
+ *message_list, *message_listmenu, *mpriority, *mread,
+ *mattachment, *mscore, *mfrom, *msubject, *mdate, *mserver;
GSList *radio_buttons = NULL;
menu = gtk_menu_bar_new();
/********************************
@@ -245,13 +245,15 @@
return (menu);
}
-void create_themes_menu(GtkWidget *menu)
+void create_themes_menu(GtkWidget * menu)
{
gint i;
- gchar *dirs[] = {g_strconcat(getenv("HOME"), "/.core/themes", NULL),
- g_strconcat(CORE_SHARE, "/themes", NULL)};
+ gchar *dirs[] =
+ { g_strconcat(getenv("HOME"), "/.core/themes", NULL),
+ g_strconcat(CORE_SHARE, "/themes", NULL)
+ };
- for (i = 0 ; i < 2 ; i++) {
+ for (i = 0; i < 2; i++) {
gchar *dirname = dirs[i];
DIR *dir;
struct dirent *dent;
@@ -266,7 +268,9 @@
GdkPixmap *pixmap;
GtkWidget *icon;
while ((dent = readdir(dir))) {
- gchar *temp = g_strconcat(dirname, "/", dent->d_name, NULL);
+ gchar *temp =
+ g_strconcat(dirname, "/", dent->d_name,
+ NULL);
stat(temp, &stats);
if (!S_ISDIR(stats.st_mode)) {
g_free(temp);
@@ -280,24 +284,34 @@
g_free(temp);
continue;
}
- menu_item = gtk_menu_item_new();
- label = gtk_label_new(dent->d_name);
- colormap = gtk_widget_get_colormap(menu_item);
- pixmap = gdk_pixmap_colormap_create_from_xpm(NULL, colormap,
- &bitmap, NULL,
- g_strconcat(dirname, "/",
- dent->d_name, "/new.xpm", NULL));
- icon = gtk_pixmap_new(pixmap, bitmap);
-
- hbox = gtk_hbox_new(0,8);
- gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
- gtk_container_add(GTK_CONTAINER(menu_item), hbox);
- gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(switch_theme), g_strdup(dent->d_name));
- gtk_menu_append(GTK_MENU(menu), menu_item);
- g_free(temp);
- }
+ menu_item = gtk_menu_item_new();
+ label = gtk_label_new(dent->d_name);
+ colormap =
+ gtk_widget_get_colormap(menu_item);
+ pixmap =
+ gdk_pixmap_colormap_create_from_xpm
+ (NULL, colormap, &bitmap, NULL,
+ g_strconcat(dirname, "/",
+ dent->d_name, "/new.xpm",
+ NULL));
+ icon = gtk_pixmap_new(pixmap, bitmap);
+
+ hbox = gtk_hbox_new(0, 8);
+ gtk_box_pack_start(GTK_BOX(hbox), icon,
+ FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), label,
+ FALSE, FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(menu_item),
+ hbox);
+ gtk_signal_connect_object(GTK_OBJECT(menu_item),
+ "activate",
+ GTK_SIGNAL_FUNC
+ (switch_theme),
+ g_strdup(dent->d_name));
+ gtk_menu_append(GTK_MENU(menu), menu_item);
+ g_free(temp);
}
+ }
}
return;
}
===================================================================
RCS file: /cvsroot/corem/core/src/menus.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- menus.h 2000/11/22 19:12:09 1.1
+++ menus.h 2000/11/22 23:45:00 1.2
@@ -1,2 +1,2 @@
GtkWidget *create_main_menu();
-void create_themes_menu(GtkWidget *menu);
+void create_themes_menu(GtkWidget * menu);
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- panes.c 2000/11/22 09:02:01 1.8
+++ panes.c 2000/11/22 23:45:00 1.9
@@ -110,7 +110,7 @@
GdkBitmap *bitmap;
GtkStyle *style;
GdkFont *font;
-
+
gint col = 0;
gchar *field_titles[8] =
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
@@ -171,12 +171,12 @@
gtk_signal_connect(GTK_OBJECT(mail_ctree), "tree_select_row",
GTK_SIGNAL_FUNC(mail_selected), NULL);
- font = gdk_font_load(config.default_font);
- style = gtk_style_copy(gtk_widget_get_style(hpane));
- gdk_font_unref(style->font);
- style->font = font;
- gdk_font_ref(style->font);
- gtk_widget_set_style(mail_ctree, style);
+ font = gdk_font_load(config.default_font);
+ style = gtk_style_copy(gtk_widget_get_style(hpane));
+ gdk_font_unref(style->font);
+ style->font = font;
+ gdk_font_ref(style->font);
+ gtk_widget_set_style(mail_ctree, style);
if (config.ml_from == 1) {
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), ifrom,
@@ -187,7 +187,7 @@
if (config.ml_subject == 1) {
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), isubject,
- 175);
+ 175);
}
if (config.ml_date == 1) {
|
|
From: CORE C. L. <cor...@li...> - 2000-11-22 19:12:10
|
Core CVS committal Author : smugg Project : core Module : src Added Files: menus.h Log Message: added a menus.h |
|
From: CORE C. L. <cor...@li...> - 2000-11-22 19:03:19
|
Core CVS committal Author : smugg Module : core Added Files: aclocal.m4 Log Message: added aclocal |
|
From: CORE C. L. <cor...@li...> - 2000-11-22 18:55:23
|
Core CVS committal Author : smugg Module : core Modified Files: configure.in Log Message: added AM_PATH_GLIB to configure.in and the function in aclocal.m4 =================================================================== RCS file: /cvsroot/corem/core/configure.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- configure.in 2000/11/21 22:45:01 1.3 +++ configure.in 2000/11/22 18:55:23 1.4 @@ -13,6 +13,7 @@ AM_MAINTAINER_MODE AM_PATH_GTK(1.2.0, , AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path=)) +AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(Cannot find Glib: Is glib-config in path=)) GLIB_CFLAGS=`glib-config --cflags` GLIB_LIBS=`glib-config --libs` |
|
From: CORE C. L. <cor...@li...> - 2000-11-22 09:02:03
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
callbacks.c callbacks.h core.h main.c menus.c panes.c
Log Message:
still havent fixed the switch_theme issue, added a new bug for you to fix =) hehe, check the create_account_window() in callbacks.c i cnt se what i have done wrong =( btw i couldnt sleep so i got up just as soon as my mom left to work, now im gonna lay down next to my gf and try to get some sleep cya
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- callbacks.c 2000/11/21 23:25:47 1.21
+++ callbacks.c 2000/11/22 09:02:01 1.22
@@ -1,5 +1,4 @@
#include "message.h"
-
#include "core.h"
#include "callbacks.h"
#include "panes.h"
@@ -10,22 +9,24 @@
extern ConfigData config;
extern gchar *title;
-GtkWidget *clist;
+GtkWidget *ctree;
GtkWidget *folder_name, *full_name, *email_address, *type, *username,
*password, *server, *path;
GtkWidget *accounts_win_new;
-
+extern GtkWidget *toolbar;
/* The main account window */
void create_account_window()
{
+ 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;
gchar *titles[] = { "Folder Name", "Full Name", "E-mail Address",
- "Mailbox Path"
- };
+ "Mailbox Path", NULL };
/* Window title */
title = g_strdup_printf("Accounts");
@@ -41,9 +42,29 @@
gtk_container_add(GTK_CONTAINER(accounts_win), main_vbox);
/* The clist for browsing accounts */
- clist = gtk_clist_new_with_titles(4, titles);
- gtk_widget_set_usize(GTK_WIDGET(clist), 600, 180);
- gtk_container_add(GTK_CONTAINER(main_vbox), clist);
+ ctree = gtk_ctree_new_with_titles(4, 0, titles);
+ gtk_container_add(GTK_CONTAINER(main_vbox), ctree);
+ while ((mbox = get_next_folder())) {
+ 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]);
+
+ 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, mbox,
+ (GtkDestroyNotify)destroy_account);
+ }
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
@@ -254,6 +275,16 @@
gtk_widget_destroy(accounts_win_new);
return;
+}
+
+void switch_theme(gchar *theme)
+{
+ g_free(config.theme);
+ config.theme = g_strdup(theme);
+ set_theme_dir();
+ gtk_widget_destroy(toolbar);
+ create_main_toolbar();
+ return;
}
/* This creates the preference window with the correct title About */
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- callbacks.h 2000/11/22 04:58:37 1.8
+++ callbacks.h 2000/11/22 09:02:01 1.9
@@ -65,4 +65,5 @@
/* Save account */
void save_account(void);
+/* Function for switching the where *theme is the directory name of the theme */
void switch_theme(gchar *theme);
===================================================================
RCS file: /cvsroot/corem/core/src/core.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- core.h 2000/11/21 22:33:40 1.7
+++ core.h 2000/11/22 09:02:01 1.8
@@ -1,5 +1,8 @@
-#include <stdio.h>
+#include <dirent.h>
#include <gtk/gtk.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
typedef struct {
gint xsize;
===================================================================
RCS file: /cvsroot/corem/core/src/main.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- main.c 2000/11/22 04:58:37 1.11
+++ main.c 2000/11/22 09:02:01 1.12
@@ -12,6 +12,7 @@
GtkWidget *main_win;
GtkWidget *mhandle;
GtkWidget *thandle;
+GtkWidget *hpane;
GtkWidget *toolbar;
GtkWidget *new;
GtkWidget *reply;
@@ -59,7 +60,6 @@
{
GtkWidget *main_vbox;
GtkWidget *main_menu;
- GtkWidget *hpane;
GtkWidget *pane;
config_read();
@@ -240,7 +240,11 @@
GTK_SIGNAL_FUNC
(create_mail_window_forward), NULL);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
+
+ gtk_widget_show_all(toolbar);
gtk_container_add(GTK_CONTAINER(thandle), toolbar);
+ gtk_widget_queue_resize(GTK_WIDGET(thandle));
+
return FALSE;
}
===================================================================
RCS file: /cvsroot/corem/core/src/menus.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- menus.c 2000/11/22 04:58:37 1.5
+++ menus.c 2000/11/22 09:02:01 1.6
@@ -3,43 +3,10 @@
#include "menus.h"
#include "callbacks.h"
#include "prefs.h"
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
ConfigData config;
extern GtkWidget *toolbar;
-/*static GtkItemFactoryEntry main_menu_items[] = {
- {"/File", NULL, NULL, 0, "<Branch>"},
- {"/File/Quit", NULL, core_main_quit, 0, NULL},
-
- {"/Edit", NULL, NULL, 0, "<Branch>"},
- {"/Edit/Options...", NULL, create_preferences_window, 0, NULL},
-
- {"/View", NULL, NULL, 0, "<Branch>"},
- {"/View/Messagelist", NULL, NULL, 0, "<Branch>"},
- {"/View/Messagelist/Display", NULL, NULL, 0, "<Branch>"},
- {"/View/Messagelist/Display/Priority", NULL, NULL, 0, "<CheckItem>"},
- {"/View/Messagelist/Display/Read", NULL, NULL, 0, "<CheckItem>"},
- {"/View/Messagelist/Display/Attachment", NULL, NULL, 0,
- "<CheckItem>"},
- {"/View/Messagelist/Display/Score", NULL, NULL, 0, "<CheckItem>"},
- {"/View/Messagelist/Display/From", NULL, NULL, 0, "<CheckItem>"},
- {"/View/Messagelist/Display/Subject", NULL, NULL, 0, "<CheckItem>"},
- {"/View/Messagelist/Display/Date", NULL, NULL, 0, "<CheckItem>"},
- {"/View/Toolbar/sep", NULL, NULL, 0, "<Separator>"},
- {"/View/Toolbar/Show", NULL, toolbar_change_layout, 0, "<ToggleItem>"},
- {"/View/Toolbar/As Text", NULL, NULL, 0, "<RadioItem>"},
- {"/View/Toolbar/As Icons", NULL, NULL, 0, "<RadioItem>"},
- {"/View/Toolbar/As Both", NULL, NULL, 0, "<RadioItem>"},
- {"/View/Toolbar/sep", NULL, NULL, 0, "<Separator>"},
- {"/View/Toolbar/Theme", NULL, NULL, 0, "<Branch>"},
-
- {"/Help", NULL, NULL, 0, "<LastBranch>"},
- {"/Help/About", NULL, create_core_about_window, 0, NULL},
-};*/
-
static GtkItemFactoryEntry mail_menu_items[] = {
{"/File", NULL, NULL, 0, "<Branch>"},
{"/File/Close", NULL, NULL, 0, NULL},
@@ -332,14 +299,5 @@
}
}
}
- return;
-}
-
-void switch_theme(gchar *theme)
-{
- config.theme = g_strdup(theme);
- set_theme_dir();
- gtk_widget_destroy(toolbar);
- create_main_toolbar();
return;
}
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- panes.c 2000/11/22 04:58:37 1.7
+++ panes.c 2000/11/22 09:02:01 1.8
@@ -1,5 +1,3 @@
-#include <gtk/gtk.h>
-
#include "message.h"
#include "core.h"
#include "panes.h"
@@ -10,9 +8,9 @@
GtkWidget *mail_ctree;
GtkWidget *folder_ctree;
extern GtkWidget *main_win;
+extern GtkWidget *hpane;
extern gchar *theme;
-
GtkWidget *core_create_folder_pane()
{
GtkWidget *scroll;
@@ -45,7 +43,7 @@
}
font = gdk_font_load(config.default_font);
- style = gtk_style_copy(gtk_widget_get_style(main_win));
+ style = gtk_style_copy(gtk_widget_get_style(hpane));
gdk_font_unref(style->font);
style->font = font;
gdk_font_ref(style->font);
@@ -110,6 +108,9 @@
GdkColormap *colormap;
GdkPixmap *pixmap;
GdkBitmap *bitmap;
+ GtkStyle *style;
+ GdkFont *font;
+
gint col = 0;
gchar *field_titles[8] =
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
@@ -166,9 +167,16 @@
}
- mail_ctree = gtk_ctree_new_with_titles(col, 0, field_titles);
+ mail_ctree = gtk_ctree_new_with_titles(col, 1, field_titles);
gtk_signal_connect(GTK_OBJECT(mail_ctree), "tree_select_row",
GTK_SIGNAL_FUNC(mail_selected), NULL);
+
+ font = gdk_font_load(config.default_font);
+ style = gtk_style_copy(gtk_widget_get_style(hpane));
+ gdk_font_unref(style->font);
+ style->font = font;
+ gdk_font_ref(style->font);
+ gtk_widget_set_style(mail_ctree, style);
if (config.ml_from == 1) {
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), ifrom,
|
|
From: CORE C. L. <cor...@li...> - 2000-11-22 04:58:38
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
callbacks.h main.c menus.c panes.c
Log Message:
add a themes menu, witch displays a icon, and a theme name, also added a switch_theme witch doesnt work, could you look in to it nathan? cant get the shit to work proper, need to get to bed now =)! have fun =) hehe cya tomorrow, mail me and tell me your online times!
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- callbacks.h 2000/11/21 17:59:01 1.7
+++ callbacks.h 2000/11/22 04:58:37 1.8
@@ -64,3 +64,5 @@
/* Save account */
void save_account(void);
+
+void switch_theme(gchar *theme);
===================================================================
RCS file: /cvsroot/corem/core/src/main.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- main.c 2000/11/21 23:25:47 1.10
+++ main.c 2000/11/22 04:58:37 1.11
@@ -90,8 +90,8 @@
GTK_POS_LEFT);
gtk_box_pack_start(GTK_BOX(main_vbox), mhandle, FALSE, FALSE, 0);
- create_main_toolbar();
thandle = gtk_handle_box_new();
+ create_main_toolbar();
main_menu = create_main_menu();
gtk_container_set_border_width(GTK_CONTAINER(main_menu), 0);
@@ -105,8 +105,6 @@
GTK_POS_LEFT);
gtk_box_pack_start(GTK_BOX(main_vbox), thandle, FALSE, FALSE, 0);
- gtk_container_add(GTK_CONTAINER(thandle), toolbar);
-
hpane = gtk_hpaned_new();
gtk_box_pack_start(GTK_BOX(main_vbox), hpane, TRUE, TRUE, 0);
@@ -141,15 +139,11 @@
{
DIR *dir;
gchar *tmp;
+ tmp = g_strconcat(getenv("HOME"), "/.core/themes/", config.theme, "/", NULL);
- tmp =
- g_strconcat(getenv("HOME"), "/.core/themes/", config.theme,
- NULL);
dir = opendir(tmp);
if (dir != NULL) {
- theme =
- g_strconcat(getenv("HOME"), "/.core/themes/",
- config.theme, "/", NULL);
+ theme = g_strconcat(getenv("HOME"), "/.core/themes/", config.theme, "/", NULL);
return TRUE;
}
tmp = g_strconcat(CORE_SHARE, "/themes/", config.theme, NULL);
@@ -246,8 +240,8 @@
GTK_SIGNAL_FUNC
(create_mail_window_forward), NULL);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
-
- return (toolbar);
+ gtk_container_add(GTK_CONTAINER(thandle), toolbar);
+ return FALSE;
}
===================================================================
RCS file: /cvsroot/corem/core/src/menus.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- menus.c 2000/11/14 19:38:44 1.4
+++ menus.c 2000/11/22 04:58:37 1.5
@@ -1,9 +1,14 @@
#include "message.h"
#include "core.h"
+#include "menus.h"
#include "callbacks.h"
#include "prefs.h"
+#include <dirent.h>
+#include <sys/stat.h>
+#include <sys/types.h>
ConfigData config;
+extern GtkWidget *toolbar;
/*static GtkItemFactoryEntry main_menu_items[] = {
{"/File", NULL, NULL, 0, "<Branch>"},
@@ -66,7 +71,7 @@
{
GtkWidget *menu, *file, *filemenu, *edit, *editmenu, *view,
*viewmenu, *help, *helpmenu;
- GtkWidget *quit, *accounts, *preferences, *toolbar, *toolbarmenu,
+ GtkWidget *quit, *accounts, *preferences, *themes, *themesmenu, *toolbar, *toolbarmenu,
*show, *text, *icons, *both, *about, *message_list,
*message_listmenu, *mpriority, *mread, *mattachment, *mscore,
*mfrom, *msubject, *mdate, *mserver;
@@ -115,6 +120,14 @@
viewmenu = gtk_menu_new();
gtk_menu_item_set_submenu(GTK_MENU_ITEM(view), viewmenu);
+ themes = gtk_menu_item_new_with_label("Themes");
+ gtk_menu_append(GTK_MENU(viewmenu), themes);
+
+ themesmenu = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(themes), themesmenu);
+
+ create_themes_menu(themesmenu);
+
toolbar = gtk_menu_item_new_with_label("Toolbar");
gtk_menu_append(GTK_MENU(viewmenu), toolbar);
@@ -263,4 +276,70 @@
gtk_menu_append(GTK_MENU(helpmenu), about);
return (menu);
+}
+
+void create_themes_menu(GtkWidget *menu)
+{
+ gint i;
+ gchar *dirs[] = {g_strconcat(getenv("HOME"), "/.core/themes", NULL),
+ g_strconcat(CORE_SHARE, "/themes", NULL)};
+
+ for (i = 0 ; i < 2 ; i++) {
+ gchar *dirname = dirs[i];
+ DIR *dir;
+ struct dirent *dent;
+ struct stat stats;
+ dir = opendir(dirname);
+ if (dir) {
+ GtkWidget *menu_item;
+ GtkWidget *label;
+ GtkWidget *hbox;
+ GdkBitmap *bitmap;
+ GdkColormap *colormap;
+ GdkPixmap *pixmap;
+ GtkWidget *icon;
+ while ((dent = readdir(dir))) {
+ gchar *temp = g_strconcat(dirname, "/", dent->d_name, NULL);
+ stat(temp, &stats);
+ if (!S_ISDIR(stats.st_mode)) {
+ g_free(temp);
+ continue;
+ }
+ if (!strcmp(dent->d_name, ".")) {
+ continue;
+ g_free(temp);
+ }
+ if (!strcmp(dent->d_name, "..")) {
+ g_free(temp);
+ continue;
+ }
+ menu_item = gtk_menu_item_new();
+ label = gtk_label_new(dent->d_name);
+ colormap = gtk_widget_get_colormap(menu_item);
+ pixmap = gdk_pixmap_colormap_create_from_xpm(NULL, colormap,
+ &bitmap, NULL,
+ g_strconcat(dirname, "/",
+ dent->d_name, "/new.xpm", NULL));
+ icon = gtk_pixmap_new(pixmap, bitmap);
+
+ hbox = gtk_hbox_new(0,8);
+ gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(menu_item), hbox);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(switch_theme), g_strdup(dent->d_name));
+ gtk_menu_append(GTK_MENU(menu), menu_item);
+ g_free(temp);
+ }
+ }
+ }
+ return;
+}
+
+void switch_theme(gchar *theme)
+{
+ config.theme = g_strdup(theme);
+ set_theme_dir();
+ gtk_widget_destroy(toolbar);
+ create_main_toolbar();
+ return;
}
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- panes.c 2000/11/21 22:33:40 1.6
+++ panes.c 2000/11/22 04:58:37 1.7
@@ -172,35 +172,29 @@
if (config.ml_from == 1) {
gtk_clist_set_column_width(GTK_CLIST(mail_ctree), ifrom,
- 250);
+ 237);
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);
+ gtk_clist_set_column_width(GTK_CLIST(mail_ctree), isubject,
+ 175);
}
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);
+ 150);
}
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) {
|
|
From: CORE C. L. <cor...@li...> - 2000-11-21 23:39:59
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
account.c
Log Message:
Now all of the accounts will be displayed, not just the last one found.
===================================================================
RCS file: /cvsroot/corem/core/src/account.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- account.c 2000/11/21 17:59:01 1.8
+++ account.c 2000/11/21 23:39:59 1.9
@@ -293,8 +293,11 @@
if (stat(temp, &file_stat) < 0)
break;
- if (S_ISREG(file_stat.st_mode))
+ if (S_ISREG(file_stat.st_mode)) {
mbox = account_read(temp);
+ g_free(temp);
+ break;
+ }
/* g_free(dentry); */
g_free(temp);
|
|
From: CORE C. L. <cor...@li...> - 2000-11-21 23:25:47
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
Makefile.am callbacks.c main.c
Log Message:
Fixed a theme directory issue, and an autoconf/automake issue.
===================================================================
RCS file: /cvsroot/corem/core/src/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- Makefile.am 2000/11/21 22:45:01 1.3
+++ Makefile.am 2000/11/21 23:25:47 1.4
@@ -6,7 +6,7 @@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
DEFS = -DCORE_SHARE=\"$(prefix)/share/core\" -DCORE_VERSION=\"@VERSION@\"
-INCLUDES = -I$(top_srcdir) $(GTK_CFLAGS) $(GLIB_CFLAGS)-I ..
+INCLUDES = -I$(top_srcdir) $(GTK_CFLAGS) $(GLIB_CFLAGS) -I..
bin_PROGRAMS = core
core_SOURCES = main.c \
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- callbacks.c 2000/11/21 22:33:40 1.20
+++ callbacks.c 2000/11/21 23:25:47 1.21
@@ -24,7 +24,8 @@
GtkWidget *hbutton_box;
GtkWidget *button_new, *button_edit, *button_remove, *button_close;
gchar *titles[] = { "Folder Name", "Full Name", "E-mail Address",
- "Mailbox Path" };
+ "Mailbox Path"
+ };
/* Window title */
title = g_strdup_printf("Accounts");
@@ -56,8 +57,7 @@
gtk_widget_set_usize(GTK_WIDGET(button_new), 55, 22);
gtk_signal_connect_object(GTK_OBJECT(button_new), "clicked",
GTK_SIGNAL_FUNC
- (create_accounts_win_new_edit),
- NULL);
+ (create_accounts_win_new_edit), NULL);
gtk_container_add(GTK_CONTAINER(hbutton_box), button_new);
/* Edit account button */
@@ -65,8 +65,7 @@
gtk_widget_set_usize(GTK_WIDGET(button_edit), 55, 22);
gtk_signal_connect_object(GTK_OBJECT(button_edit), "clicked",
GTK_SIGNAL_FUNC
- (create_accounts_win_new_edit),
- NULL);
+ (create_accounts_win_new_edit), NULL);
gtk_container_add(GTK_CONTAINER(hbutton_box), button_edit);
/* Remove account button */
@@ -95,10 +94,10 @@
GtkWidget *hbutton_box;
GtkWidget *button_save, *button_cancel;
- /* Set the right title for the window */
- /* This still needs to be done. It can be figured out by looking for a
- * selected row in the account clist. */
- title = g_strdup("New");
+ /* Set the right title for the window */
+ /* This still needs to be done. It can be figured out by looking for a
+ * selected row in the account clist. */
+ title = g_strdup("New");
/* Create the new/edit account window */
accounts_win_new = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@@ -120,8 +119,8 @@
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
/* Folder name entry */
- folder_name = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(folder_name), "");
+ folder_name = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(folder_name), "");
gtk_widget_set_usize(GTK_WIDGET(folder_name), 200, 20);
gtk_table_attach(GTK_TABLE(table), folder_name, 1, 2, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -133,7 +132,7 @@
/* Full name entry */
full_name = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(full_name), "");
+ gtk_entry_set_text(GTK_ENTRY(full_name), "");
gtk_widget_set_usize(GTK_WIDGET(full_name), 200, 20);
gtk_table_attach(GTK_TABLE(table), full_name, 1, 2, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -145,7 +144,7 @@
/* E-mail address entry */
email_address = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(email_address), "");
+ gtk_entry_set_text(GTK_ENTRY(email_address), "");
gtk_widget_set_usize(GTK_WIDGET(email_address), 200, 20);
gtk_table_attach(GTK_TABLE(table), email_address, 1, 2, 2,
3, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -162,7 +161,7 @@
/* Username entry */
username = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(username), "");
+ gtk_entry_set_text(GTK_ENTRY(username), "");
gtk_widget_set_usize(GTK_WIDGET(username), 100, 20);
gtk_table_attach(GTK_TABLE(table), username, 1, 2, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -174,7 +173,7 @@
/* Password entry */
password = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(password), "");
+ gtk_entry_set_text(GTK_ENTRY(password), "");
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);
@@ -186,7 +185,7 @@
/* Server entry */
server = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(server), "");
+ gtk_entry_set_text(GTK_ENTRY(server), "");
gtk_widget_set_usize(GTK_WIDGET(server), 100, 20);
gtk_table_attach(GTK_TABLE(table), server, 1, 2, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -198,7 +197,7 @@
/* Path entry */
path = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(path), "");
+ gtk_entry_set_text(GTK_ENTRY(path), "");
gtk_widget_set_usize(GTK_WIDGET(path), 100, 20);
gtk_table_attach(GTK_TABLE(table), path, 3, 4, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
===================================================================
RCS file: /cvsroot/corem/core/src/main.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- main.c 2000/11/21 22:33:40 1.9
+++ main.c 2000/11/21 23:25:47 1.10
@@ -17,7 +17,7 @@
GtkWidget *reply;
GtkWidget *reply_all;
GtkWidget *forward;
-gchar *theme;
+gchar *theme;
int main(int argc, char **argv)
{
@@ -65,8 +65,7 @@
set_theme_dir();
- title =
- g_strdup_printf("Core %s", CORE_VERSION);
+ title = g_strdup_printf("Core %s", CORE_VERSION);
main_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(GTK_WIDGET(main_win), config.xsize,
config.ysize);
@@ -142,21 +141,28 @@
{
DIR *dir;
gchar *tmp;
- tmp = g_strconcat(getenv("HOME"), "/.core/themes/", config.theme, NULL);
+
+ tmp =
+ g_strconcat(getenv("HOME"), "/.core/themes/", config.theme,
+ NULL);
dir = opendir(tmp);
if (dir != NULL) {
- theme = g_strconcat(getenv("HOME"), "/.core/themes/", config.theme, NULL);
- return 1;
+ theme =
+ g_strconcat(getenv("HOME"), "/.core/themes/",
+ config.theme, "/", NULL);
+ return TRUE;
}
tmp = g_strconcat(CORE_SHARE, "/themes/", config.theme, NULL);
dir = opendir(tmp);
if (dir != NULL) {
- theme = g_strconcat(CORE_SHARE, "/themes/", config.theme, NULL);;
- return 1;
+ theme =
+ g_strconcat(CORE_SHARE, "/themes/", config.theme, "/",
+ NULL);
+ return TRUE;
}
- return 0;
+ return FALSE;
}
GtkWidget *create_main_toolbar()
@@ -177,8 +183,8 @@
gdk_pixmap_colormap_create_from_xpm(NULL, colormap,
&bitmap, NULL,
g_strconcat(theme,
- "new.xpm",
- NULL));
+ "new.xpm",
+ NULL));
new = gtk_pixmap_new(pixmap, bitmap);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "New",
"Send a new message.",
|
|
From: CORE C. L. <cor...@li...> - 2000-11-21 22:45:02
|
Core CVS committal Author : smugg Module : core Modified Files: Makefile.am configure.in Log Message: glib cflags added =================================================================== RCS file: /cvsroot/corem/core/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- Makefile.am 2000/11/21 19:57:55 1.1 +++ Makefile.am 2000/11/21 22:45:01 1.2 @@ -4,6 +4,8 @@ GTK_CFLAGS = $(GTK_CFLAGS) GTK_LIBS = $(GTK_LIBS) +GLIB_CFLAGS = $(GLIB_CFLAGS) +GLIB_LIBS = $(GLIB_LIBS) docs_DATA = README AUTHORS INSTALL ChangeLog docsdir = $(prefix)/doc/core =================================================================== RCS file: /cvsroot/corem/core/configure.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- configure.in 2000/11/21 22:33:40 1.2 +++ configure.in 2000/11/21 22:45:01 1.3 @@ -14,17 +14,15 @@ AM_PATH_GTK(1.2.0, , AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path=)) - - - - - -GTK_LIBS=`gtk-config --libs` +GLIB_CFLAGS=`glib-config --cflags` +GLIB_LIBS=`glib-config --libs` GTK_CFLAGS=`gtk-config --cflags` -PREFIX="-Dx$prefix" -AC_SUBST(GTK_LIBS) +GTK_LIBS=`gtk-config --libs` + +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) AC_SUBST(GTK_CFLAGS) -AC_SUBST(PREFIX) +AC_SUBST(GTK_LIBS) AC_OUTPUT( Makefile \ |
|
From: CORE C. L. <cor...@li...> - 2000-11-21 22:45:02
|
Core CVS committal Author : smugg Project : core Module : src Modified Files: Makefile.am Log Message: glib cflags added =================================================================== RCS file: /cvsroot/corem/core/src/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- Makefile.am 2000/11/21 22:33:40 1.2 +++ Makefile.am 2000/11/21 22:45:01 1.3 @@ -1,10 +1,12 @@ MAINTAINERCLEANFILES = Makefile.in CFLAGS = -g -W -Wall -Wno-implicit -GTK_CFLAGS = -I@GTK_CFLAGS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ DEFS = -DCORE_SHARE=\"$(prefix)/share/core\" -DCORE_VERSION=\"@VERSION@\" -INCLUDES = -I$(top_srcdir) $(GTK_CFLAGS) -I .. +INCLUDES = -I$(top_srcdir) $(GTK_CFLAGS) $(GLIB_CFLAGS)-I .. bin_PROGRAMS = core core_SOURCES = main.c \ @@ -16,4 +18,4 @@ panes.c panes.h \ prefs.c prefs.h \ util.c util.h -core_LDADD = @GTK_LIBS@ +core_LDADD = $(GLIB_LIBS) $(GTK_LIBS) |
|
From: CORE C. L. <cor...@li...> - 2000-11-21 22:33:40
|
Core CVS committal Author : smugg Module : core Modified Files: configure.in Log Message: added a set_theme_dir() =================================================================== RCS file: /cvsroot/corem/core/configure.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- configure.in 2000/11/21 19:57:55 1.1 +++ configure.in 2000/11/21 22:33:40 1.2 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to create configure. -AC_INIT(src/main.c) +AC_INIT(src/core.h) AM_INIT_AUTOMAKE(core, 0.0.1) AC_PROG_CC @@ -12,11 +12,19 @@ AM_MAINTAINER_MODE -LIBS="$LIBS -lm" +AM_PATH_GTK(1.2.0, , AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path=)) + + + + + + GTK_LIBS=`gtk-config --libs` -IMLIB_CFLAGS=`gtk-config --cflags` +GTK_CFLAGS=`gtk-config --cflags` +PREFIX="-Dx$prefix" AC_SUBST(GTK_LIBS) AC_SUBST(GTK_CFLAGS) +AC_SUBST(PREFIX) AC_OUTPUT( Makefile \ |
|
From: CORE C. L. <cor...@li...> - 2000-11-21 22:33:40
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
Makefile.am callbacks.c core.h main.c panes.c prefs.c
Log Message:
added a set_theme_dir()
===================================================================
RCS file: /cvsroot/corem/core/src/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- Makefile.am 2000/11/21 19:57:55 1.1
+++ Makefile.am 2000/11/21 22:33:40 1.2
@@ -1,11 +1,19 @@
MAINTAINERCLEANFILES = Makefile.in
CFLAGS = -g -W -Wall -Wno-implicit
-GTK_CFLAGS = @GTK_CFLAGS@
+GTK_CFLAGS = -I@GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
+DEFS = -DCORE_SHARE=\"$(prefix)/share/core\" -DCORE_VERSION=\"@VERSION@\"
+INCLUDES = -I$(top_srcdir) $(GTK_CFLAGS) -I ..
bin_PROGRAMS = core
-core_SOURCES = main.c account.c account.h callbacks.c callbacks.h \
- headers.c headers.h message.c message.h menus.c menus.h \
- panes.c panes.h prefs.c prefs.h util.c util.h
+core_SOURCES = main.c \
+ account.c account.h \
+ callbacks.c callbacks.h \
+ headers.c headers.h \
+ message.c message.h \
+ menus.c menus.h \
+ panes.c panes.h \
+ prefs.c prefs.h \
+ util.c util.h
core_LDADD = @GTK_LIBS@
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- callbacks.c 2000/11/21 17:59:01 1.19
+++ callbacks.c 2000/11/21 22:33:40 1.20
@@ -88,7 +88,6 @@
/* The new/edit account window */
void create_accounts_win_new_edit()
{
-
GtkWidget *main_vbox;
GtkWidget *table;
GtkWidget *label;
@@ -96,10 +95,10 @@
GtkWidget *hbutton_box;
GtkWidget *button_save, *button_cancel;
- /* Set the right title for the window */
- /* This still needs to be done. It can be figured out by looking for a
- * selected row in the account clist. */
- title = g_strdup("New");
+ /* Set the right title for the window */
+ /* This still needs to be done. It can be figured out by looking for a
+ * selected row in the account clist. */
+ title = g_strdup("New");
/* Create the new/edit account window */
accounts_win_new = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@@ -121,8 +120,8 @@
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
/* Folder name entry */
- folder_name = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(folder_name), "");
+ folder_name = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(folder_name), "");
gtk_widget_set_usize(GTK_WIDGET(folder_name), 200, 20);
gtk_table_attach(GTK_TABLE(table), folder_name, 1, 2, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -134,7 +133,7 @@
/* Full name entry */
full_name = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(full_name), "");
+ gtk_entry_set_text(GTK_ENTRY(full_name), "");
gtk_widget_set_usize(GTK_WIDGET(full_name), 200, 20);
gtk_table_attach(GTK_TABLE(table), full_name, 1, 2, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -146,7 +145,7 @@
/* E-mail address entry */
email_address = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(email_address), "");
+ gtk_entry_set_text(GTK_ENTRY(email_address), "");
gtk_widget_set_usize(GTK_WIDGET(email_address), 200, 20);
gtk_table_attach(GTK_TABLE(table), email_address, 1, 2, 2,
3, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -163,7 +162,7 @@
/* Username entry */
username = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(username), "");
+ gtk_entry_set_text(GTK_ENTRY(username), "");
gtk_widget_set_usize(GTK_WIDGET(username), 100, 20);
gtk_table_attach(GTK_TABLE(table), username, 1, 2, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -175,7 +174,7 @@
/* Password entry */
password = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(password), "");
+ gtk_entry_set_text(GTK_ENTRY(password), "");
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);
@@ -187,7 +186,7 @@
/* Server entry */
server = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(server), "");
+ gtk_entry_set_text(GTK_ENTRY(server), "");
gtk_widget_set_usize(GTK_WIDGET(server), 100, 20);
gtk_table_attach(GTK_TABLE(table), server, 1, 2, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -199,7 +198,7 @@
/* Path entry */
path = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(path), "");
+ gtk_entry_set_text(GTK_ENTRY(path), "");
gtk_widget_set_usize(GTK_WIDGET(path), 100, 20);
gtk_table_attach(GTK_TABLE(table), path, 3, 4, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
===================================================================
RCS file: /cvsroot/corem/core/src/core.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- core.h 2000/11/14 19:38:44 1.6
+++ core.h 2000/11/21 22:33:40 1.7
@@ -1,11 +1,6 @@
#include <stdio.h>
#include <gtk/gtk.h>
-/* core version information */
-#define CORE_MAJOR 0
-#define CORE_MINOR 0
-#define CORE_MICRO 0
-
typedef struct {
gint xsize;
gint ysize;
===================================================================
RCS file: /cvsroot/corem/core/src/main.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- main.c 2000/11/20 10:02:03 1.8
+++ main.c 2000/11/21 22:33:40 1.9
@@ -1,8 +1,10 @@
#include "message.h"
-
#include "core.h"
#include "callbacks.h"
#include "panes.h"
+#include <dirent.h>
+#include <sys/types.h>
+#define PREFIX "/usr"
GtkWidget *message_pane;
ConfigData config;
@@ -15,28 +17,44 @@
GtkWidget *reply;
GtkWidget *reply_all;
GtkWidget *forward;
-
+gchar *theme;
int main(int argc, char **argv)
{
gchar *dir;
+ /* Create $HOME/.core directory */
dir = g_strconcat(getenv("HOME"), "/.core", NULL);
mkdir(dir, 0700);
g_free(dir);
+
+ /* Create $HOME/.core/accounts directory */
dir = g_strconcat(getenv("HOME"), "/.core/accounts", NULL);
mkdir(dir, 0700);
g_free(dir);
+
+ /* Create $HOME/.core/themes directory */
dir = g_strconcat(getenv("HOME"), "/.core/themes", NULL);
mkdir(dir, 0700);
g_free(dir);
+
+ /* Set locale */
gtk_set_locale();
+
+ /* Init */
gtk_init(&argc, &argv);
+
+ /* Create main window */
create_core_main_window();
+
+ /* Here core sleeps until the core_main_quit is called */
gtk_main();
+
+ /* Returns nothing */
return 0;
}
+/* The main window callback */
void create_core_main_window(void)
{
GtkWidget *main_vbox;
@@ -44,9 +62,11 @@
GtkWidget *hpane;
GtkWidget *pane;
config_read();
+
+ set_theme_dir();
+
title =
- g_strdup_printf("Core %d.%d.%d", CORE_MAJOR, CORE_MINOR,
- CORE_MICRO);
+ g_strdup_printf("Core %s", CORE_VERSION);
main_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(GTK_WIDGET(main_win), config.xsize,
config.ysize);
@@ -118,15 +138,32 @@
}
}
+int set_theme_dir()
+{
+ DIR *dir;
+ gchar *tmp;
+ tmp = g_strconcat(getenv("HOME"), "/.core/themes/", config.theme, NULL);
+ dir = opendir(tmp);
+ if (dir != NULL) {
+ theme = g_strconcat(getenv("HOME"), "/.core/themes/", config.theme, NULL);
+ return 1;
+ }
+ tmp = g_strconcat(CORE_SHARE, "/themes/", config.theme, NULL);
+ dir = opendir(tmp);
+
+ if (dir != NULL) {
+ theme = g_strconcat(CORE_SHARE, "/themes/", config.theme, NULL);;
+ return 1;
+ }
+
+ return 0;
+}
+
GtkWidget *create_main_toolbar()
{
- gchar *theme;
GdkBitmap *bitmap;
GdkColormap *colormap;
GdkPixmap *pixmap;
- theme =
- g_strconcat(g_getenv("HOME"), "/.core/themes/", config.theme,
- "/", NULL);
toolbar =
gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
@@ -140,8 +177,8 @@
gdk_pixmap_colormap_create_from_xpm(NULL, colormap,
&bitmap, NULL,
g_strconcat(theme,
- "new.xpm",
- NULL));
+ "new.xpm",
+ NULL));
new = gtk_pixmap_new(pixmap, bitmap);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "New",
"Send a new message.",
===================================================================
RCS file: /cvsroot/corem/core/src/panes.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- panes.c 2000/11/20 22:32:00 1.5
+++ panes.c 2000/11/21 22:33:40 1.6
@@ -10,7 +10,9 @@
GtkWidget *mail_ctree;
GtkWidget *folder_ctree;
extern GtkWidget *main_win;
+extern gchar *theme;
+
GtkWidget *core_create_folder_pane()
{
GtkWidget *scroll;
@@ -22,7 +24,6 @@
GdkPixmap *cpixmap, *opixmap;
GtkStyle *style;
GdkFont *font;
- gchar *theme;
gchar *folder_titles[] = { "Folders", "Msg", "New", NULL };
gchar **text = NULL;
@@ -50,9 +51,6 @@
gdk_font_ref(style->font);
gtk_widget_set_style(folder_ctree, style);
- theme =
- g_strconcat(getenv("HOME"), "/.core/themes/",
- config.theme, "/", NULL);
colormap = gtk_widget_get_colormap(folder_ctree);
cpixmap =
gdk_pixmap_colormap_create_from_xpm(NULL, colormap,
@@ -117,11 +115,7 @@
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
gint ipriority, iread, iattachment, iscore, ifrom, isubject, idate,
iserver;
- gchar *theme;
gchar **text = NULL;
- theme =
- g_strconcat(getenv("HOME"), "/.core/themes/", config.theme,
- "/", NULL);
if (config.ml_from == 1) {
field_titles[col] = "From";
===================================================================
RCS file: /cvsroot/corem/core/src/prefs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- prefs.c 2000/11/20 21:02:13 1.4
+++ prefs.c 2000/11/21 22:33:40 1.5
@@ -6,6 +6,7 @@
extern GtkWidget *folder_ctree;
extern GtkWidget *mail_ctree;
extern GtkWidget *main_win;
+extern gchar *theme;
static void pref_selected(GtkWidget * list, GtkCTreeNode * node);
static void ok_clicked();
static void apply_clicked();
@@ -32,7 +33,6 @@
GtkCTreeNode *top, *item;
GtkWidget *label;
GtkWidget *separator;
- gchar *theme;
GdkBitmap *bitmap;
GdkColormap *colormap;
GdkPixmap *pixmap;
@@ -44,10 +44,6 @@
gchar *title[] = { "Options" };
gchar *node[] = { "Core" };
- theme =
- g_strconcat(getenv("HOME"), "/.core/themes/", config.theme,
- "/", NULL);
-
pref_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(GTK_WIDGET(pref_win), 700, 400);
gtk_window_set_title(GTK_WINDOW(pref_win), wintitle);
@@ -116,11 +112,11 @@
logo = gtk_pixmap_new(pixmap, bitmap);
gtk_box_pack_start(GTK_BOX(corevbox), logo, TRUE, TRUE, 0);
- sprintf(buf, "\nCore %d.%d.%d\n\n"
+ sprintf(buf, "\nCore %s\n\n"
"Core is witten by:\n"
"Christopher Rosendahl <sm...@no...>\n"
"Nathan Ingersoll <ningerso@d.umn.edu>\n",
- CORE_MAJOR, CORE_MINOR, CORE_MICRO);
+ CORE_VERSION);
label = gtk_label_new(buf);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0);
gtk_box_pack_start(GTK_BOX(corevbox), label, TRUE, TRUE,
@@ -292,8 +288,7 @@
(GTK_ENTRY(entry)));
gtk_font_selection_dialog_set_preview_text
(GTK_FONT_SELECTION_DIALOG(fontsel),
- g_strdup_printf("Core %d.%d.%d", CORE_MAJOR, CORE_MINOR,
- CORE_MICRO));
+ g_strdup_printf("Core %s", CORE_VERSION));
gtk_signal_connect(GTK_OBJECT
(GTK_FONT_SELECTION_DIALOG
(fontsel)->cancel_button), "clicked",
|
|
From: CORE C. L. <cor...@li...> - 2000-11-21 19:57:56
|
Core CVS committal Author : smugg Module : core Added Files: ChangeLog Makefile.am acsite.m4 autogen.sh configure.in core.spec.in Removed Files: CONTACT Makefile Log Message: Added autoconf/automake stuff, cleaned up some stuff |
|
From: CORE C. L. <cor...@li...> - 2000-11-21 19:57:56
|
Core CVS committal Author : smugg Project : core Module : src Added Files: Makefile.am Removed Files: Makefile Log Message: Added autoconf/automake stuff, cleaned up some stuff |
|
From: CORE C. L. <cor...@li...> - 2000-11-21 17:59:02
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
account.c account.h callbacks.c callbacks.h
Log Message:
Fixed new_account to initialize all members of account struct. Made callbacks.c
use the account API.
===================================================================
RCS file: /cvsroot/corem/core/src/account.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- account.c 2000/11/21 05:10:40 1.7
+++ account.c 2000/11/21 17:59:01 1.8
@@ -17,6 +17,8 @@
ret->name = NULL;
ret->full_name = NULL;
+ ret->username = NULL;
+ ret->password = NULL;
ret->address = NULL;
ret->server = NULL;
ret->path = NULL;
@@ -62,6 +64,30 @@
return TRUE;
}
+int account_set_username(Account * ac, char *username)
+{
+ if (!username || !ac)
+ return FALSE;
+
+ if (ac->username)
+ free(ac->username);
+
+ ac->username = g_strdup(username);
+ return TRUE;
+}
+
+int account_set_password(Account * ac, char *password)
+{
+ if (!password || !ac)
+ return FALSE;
+
+ if (ac->password)
+ free(ac->password);
+
+ ac->password = g_strdup(password);
+ return TRUE;
+}
+
char *account_get_name(Account * ac)
{
if (!ac)
@@ -182,35 +208,55 @@
account_set_server(acct, line + 12);
else if (g_strncasecmp(line, "full_name=", 10) == 0)
account_set_fullname(acct, line + 10);
- else if (g_strncasecmp(line, "email_address=", 14) == 0)
- account_set_address(acct, line + 14);
- else if (g_strncasecmp(line, "path=", 5) == 0)
- account_set_path(acct, line + 5);
+ else if (g_strncasecmp(line, "email_address=", 14) == 0)
+ account_set_address(acct, line + 14);
+ else if (g_strncasecmp(line, "path=", 5) == 0)
+ account_set_path(acct, line + 5);
}
return acct;
}
-Account *account_write(Account * acct)
+int account_write(Account * acct)
{
FILE *fp;
- gchar *file = g_strconcat(getenv("HOME"), "/.core/accounts/", acct->name, NULL);
+ gchar *file;
+
+ if (!acct)
+ return FALSE;
+
+ file =
+ g_strconcat(getenv("HOME"), "/.core/accounts/", acct->name,
+ NULL);
fp = fopen(file, "w");
if (fp == NULL) {
perror("fopen");
- return NULL;
+ return FALSE;
}
+
+ if (acct->name && *acct->name)
+ fprintf(fp, "account_name=%s\n", acct->name);
- fprintf(fp, "account_name=%s\n", acct->name);
- fprintf(fp, "full_name=%s\n", acct->full_name);
- fprintf(fp, "email_address=%s\n", acct->address);
- fprintf(fp, "username=%s\n", acct->username);
- fprintf(fp, "password=%s\n", acct->password);
- fprintf(fp, "smtp_server=%s\n", acct->server);
- fprintf(fp, "path=%s\n", acct->path);
+ if (acct->full_name && *acct->full_name)
+ fprintf(fp, "full_name=%s\n", acct->full_name);
- return NULL;
+ if (acct->address && *acct->address)
+ fprintf(fp, "email_address=%s\n", acct->address);
+
+ if (acct->username && *acct->username)
+ fprintf(fp, "username=%s\n", acct->username);
+
+ if (acct->username && *acct->username)
+ fprintf(fp, "password=%s\n", acct->password);
+
+ if (acct->server && *acct->server)
+ fprintf(fp, "smtp_server=%s\n", acct->server);
+
+ if (acct->path && *acct->path)
+ fprintf(fp, "path=%s\n", acct->path);
+
+ return TRUE;
}
Account *get_next_folder()
===================================================================
RCS file: /cvsroot/corem/core/src/account.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- account.h 2000/11/21 05:10:40 1.6
+++ account.h 2000/11/21 17:59:01 1.7
@@ -55,7 +55,7 @@
/* Read in the settings found in the file path, return an account structure */
Account *account_read(gchar * path);
-Account *account_write(Account * acct);
+int account_write(Account * acct);
/* 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.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- callbacks.c 2000/11/21 05:10:40 1.18
+++ callbacks.c 2000/11/21 17:59:01 1.19
@@ -5,10 +5,11 @@
#include "panes.h"
extern Account *current_mbox;
-extern Account *mail_ctree;
-extern ConfigData config;
+extern GtkWidget *mail_ctree;
extern GtkWidget *main_win;
+extern ConfigData config;
extern gchar *title;
+
GtkWidget *clist;
GtkWidget *folder_name, *full_name, *email_address, *type, *username,
*password, *server, *path;
@@ -20,11 +21,10 @@
{
GtkWidget *accounts_win;
GtkWidget *main_vbox, *hbox;
- GtkWidget *hbutton_box;
+ GtkWidget *hbutton_box;
GtkWidget *button_new, *button_edit, *button_remove, *button_close;
gchar *titles[] = { "Folder Name", "Full Name", "E-mail Address",
- "Mailbox Path"
- };
+ "Mailbox Path" };
/* Window title */
title = g_strdup_printf("Accounts");
@@ -49,8 +49,7 @@
/* The buttons at the bottom of the window */
hbutton_box = gtk_hbutton_box_new();
- gtk_box_pack_start(GTK_BOX(hbox), hbutton_box, FALSE, FALSE,
- 0);
+ gtk_box_pack_start(GTK_BOX(hbox), hbutton_box, FALSE, FALSE, 0);
/* New account button */
button_new = gtk_button_new_with_label("New");
@@ -58,7 +57,7 @@
gtk_signal_connect_object(GTK_OBJECT(button_new), "clicked",
GTK_SIGNAL_FUNC
(create_accounts_win_new_edit),
- GINT_TO_POINTER(0));
+ NULL);
gtk_container_add(GTK_CONTAINER(hbutton_box), button_new);
/* Edit account button */
@@ -67,7 +66,7 @@
gtk_signal_connect_object(GTK_OBJECT(button_edit), "clicked",
GTK_SIGNAL_FUNC
(create_accounts_win_new_edit),
- GINT_TO_POINTER(1));
+ NULL);
gtk_container_add(GTK_CONTAINER(hbutton_box), button_edit);
/* Remove account button */
@@ -87,9 +86,9 @@
}
/* The new/edit account window */
-void create_accounts_win_new_edit(gint type) /* type 0 for new account and
- type 1 for edit a account */
+void create_accounts_win_new_edit()
{
+
GtkWidget *main_vbox;
GtkWidget *table;
GtkWidget *label;
@@ -97,11 +96,10 @@
GtkWidget *hbutton_box;
GtkWidget *button_save, *button_cancel;
- /* Set the right title for the window */
- if (type == 0)
- title = g_strdup_printf("New Account");
- if (type == 1)
- title = g_strdup_printf("Edit Account");
+ /* Set the right title for the window */
+ /* This still needs to be done. It can be figured out by looking for a
+ * selected row in the account clist. */
+ title = g_strdup("New");
/* Create the new/edit account window */
accounts_win_new = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@@ -123,7 +121,8 @@
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
/* Folder name entry */
- folder_name = gtk_entry_new();
+ folder_name = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(folder_name), "");
gtk_widget_set_usize(GTK_WIDGET(folder_name), 200, 20);
gtk_table_attach(GTK_TABLE(table), folder_name, 1, 2, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -135,6 +134,7 @@
/* Full name entry */
full_name = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(full_name), "");
gtk_widget_set_usize(GTK_WIDGET(full_name), 200, 20);
gtk_table_attach(GTK_TABLE(table), full_name, 1, 2, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -146,6 +146,7 @@
/* E-mail address entry */
email_address = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(email_address), "");
gtk_widget_set_usize(GTK_WIDGET(email_address), 200, 20);
gtk_table_attach(GTK_TABLE(table), email_address, 1, 2, 2,
3, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -162,6 +163,7 @@
/* Username entry */
username = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(username), "");
gtk_widget_set_usize(GTK_WIDGET(username), 100, 20);
gtk_table_attach(GTK_TABLE(table), username, 1, 2, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -173,6 +175,7 @@
/* Password entry */
password = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(password), "");
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);
@@ -184,6 +187,7 @@
/* Server entry */
server = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(server), "");
gtk_widget_set_usize(GTK_WIDGET(server), 100, 20);
gtk_table_attach(GTK_TABLE(table), server, 1, 2, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -195,6 +199,7 @@
/* Path entry */
path = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(path), "");
gtk_widget_set_usize(GTK_WIDGET(path), 100, 20);
gtk_table_attach(GTK_TABLE(table), path, 3, 4, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
@@ -212,8 +217,7 @@
button_save = gtk_button_new_with_label("Save");
gtk_widget_set_usize(GTK_WIDGET(button_save), 55, 22);
gtk_signal_connect(GTK_OBJECT(button_save), "clicked",
- GTK_SIGNAL_FUNC(save_account),
- GINT_TO_POINTER(type));
+ GTK_SIGNAL_FUNC(save_account), NULL);
gtk_container_add(GTK_CONTAINER(hbutton_box), button_save);
/* Cancel button */
@@ -229,20 +233,24 @@
}
-void save_account(gint type)
+void save_account()
{
Account *acct;
acct = new_account();
- acct->name = gtk_entry_get_text(GTK_ENTRY(folder_name));
- acct->full_name = gtk_entry_get_text(GTK_ENTRY(full_name));
- acct->address = gtk_entry_get_text(GTK_ENTRY(email_address));
- /*acct->type = gtk_entry_get_text(GTK_ENTRY(type));*/
- acct->username = gtk_entry_get_text(GTK_ENTRY(username));
- acct->password = gtk_entry_get_text(GTK_ENTRY(password));
- acct->server = gtk_entry_get_text(GTK_ENTRY(server));
- acct->path = gtk_entry_get_text(GTK_ENTRY(path));
+ account_set_name(acct, gtk_entry_get_text(GTK_ENTRY(folder_name)));
+ account_set_fullname(acct,
+ gtk_entry_get_text(GTK_ENTRY(full_name)));
+ account_set_address(acct,
+ gtk_entry_get_text(GTK_ENTRY(email_address)));
+ /*acct->type = gtk_entry_get_text(GTK_ENTRY(type)); */
+ account_set_username(acct,
+ gtk_entry_get_text(GTK_ENTRY(username)));
+ account_set_password(acct,
+ gtk_entry_get_text(GTK_ENTRY(password)));
+ account_set_server(acct, gtk_entry_get_text(GTK_ENTRY(server)));
+ account_set_path(acct, gtk_entry_get_text(GTK_ENTRY(path)));
account_write(acct);
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- callbacks.h 2000/11/21 05:10:40 1.6
+++ callbacks.h 2000/11/21 17:59:01 1.7
@@ -60,7 +60,7 @@
void create_account_window();
/* The new/edit account window */
-void create_accounts_win_new_edit(gint type);
+void create_accounts_win_new_edit(void);
/* Save account */
-void save_account(gint type);
+void save_account(void);
|
|
From: CORE C. L. <cor...@li...> - 2000-11-21 05:10:41
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
account.c account.h callbacks.c callbacks.h
Log Message:
added a save_account, and account_write, now it works saving a account, fixed the folder_selected bug, now we need to fix listing of accounts for the main accounts window
===================================================================
RCS file: /cvsroot/corem/core/src/account.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- account.c 2000/11/20 22:59:01 1.6
+++ account.c 2000/11/21 05:10:40 1.7
@@ -182,15 +182,37 @@
account_set_server(acct, line + 12);
else if (g_strncasecmp(line, "full_name=", 10) == 0)
account_set_fullname(acct, line + 10);
- else if (g_strncasecmp(line, "path=", 5) == 0)
- account_set_path(acct, line + 5);
- else if (g_strncasecmp(line, "email_address=", 14) == 0)
- account_set_address(acct, line + 14);
+ else if (g_strncasecmp(line, "email_address=", 14) == 0)
+ account_set_address(acct, line + 14);
+ else if (g_strncasecmp(line, "path=", 5) == 0)
+ account_set_path(acct, line + 5);
}
return acct;
}
+Account *account_write(Account * acct)
+{
+ FILE *fp;
+ gchar *file = g_strconcat(getenv("HOME"), "/.core/accounts/", acct->name, NULL);
+
+ fp = fopen(file, "w");
+ if (fp == NULL) {
+ perror("fopen");
+ return NULL;
+ }
+
+ fprintf(fp, "account_name=%s\n", acct->name);
+ fprintf(fp, "full_name=%s\n", acct->full_name);
+ fprintf(fp, "email_address=%s\n", acct->address);
+ fprintf(fp, "username=%s\n", acct->username);
+ fprintf(fp, "password=%s\n", acct->password);
+ fprintf(fp, "smtp_server=%s\n", acct->server);
+ fprintf(fp, "path=%s\n", acct->path);
+
+ return NULL;
+}
+
Account *get_next_folder()
{
struct stat file_stat;
@@ -235,11 +257,11 @@
return mbox;
}
-int account_reset_file(Account *ac)
+int account_reset_file(Account * ac)
{
- if (!ac || !ac->fp)
- return FALSE;
+ if (!ac || !ac->fp)
+ return FALSE;
- rewind(ac->fp);
- return TRUE;
+ rewind(ac->fp);
+ return TRUE;
}
===================================================================
RCS file: /cvsroot/corem/core/src/account.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- account.h 2000/11/20 22:59:01 1.5
+++ account.h 2000/11/21 05:10:40 1.6
@@ -55,8 +55,9 @@
/* Read in the settings found in the file path, return an account structure */
Account *account_read(gchar * path);
+Account *account_write(Account * acct);
/* Move through the various folders returning them one at a time */
Account *get_next_folder(void);
/* Reset the file pointer for the local mailbox */
-int account_reset(Account *ac);
+int account_reset(Account * ac);
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- callbacks.c 2000/11/20 22:59:01 1.17
+++ callbacks.c 2000/11/21 05:10:40 1.18
@@ -14,37 +14,45 @@
*password, *server, *path;
GtkWidget *accounts_win_new;
+
+/* The main account window */
void create_account_window()
{
GtkWidget *accounts_win;
- GtkWidget *main_vbox, *vbox;
- GtkWidget *hbutton_box;
+ GtkWidget *main_vbox, *hbox;
+ GtkWidget *hbutton_box;
GtkWidget *button_new, *button_edit, *button_remove, *button_close;
gchar *titles[] = { "Folder Name", "Full Name", "E-mail Address",
"Mailbox Path"
};
+ /* Window title */
title = g_strdup_printf("Accounts");
+ /* Create the account window */
accounts_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ /* Set title for the account window */
gtk_window_set_title(GTK_WINDOW(accounts_win), title);
+ /* Account window main vbox */
main_vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 0);
gtk_container_add(GTK_CONTAINER(accounts_win), main_vbox);
- vbox = gtk_vbox_new(FALSE, 0);
- gtk_container_set_border_width(GTK_CONTAINER(vbox), 0);
- gtk_box_pack_start(GTK_BOX(main_vbox), vbox, TRUE, TRUE, 0);
-
+ /* The clist for browsing accounts */
clist = gtk_clist_new_with_titles(4, titles);
gtk_widget_set_usize(GTK_WIDGET(clist), 600, 180);
- gtk_container_add(GTK_CONTAINER(vbox), clist);
+ gtk_container_add(GTK_CONTAINER(main_vbox), clist);
+
+ hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
+ /* The buttons at the bottom of the window */
hbutton_box = gtk_hbutton_box_new();
- gtk_box_pack_start(GTK_BOX(main_vbox), hbutton_box, FALSE, FALSE,
+ gtk_box_pack_start(GTK_BOX(hbox), hbutton_box, FALSE, FALSE,
0);
+ /* New account button */
button_new = gtk_button_new_with_label("New");
gtk_widget_set_usize(GTK_WIDGET(button_new), 55, 22);
gtk_signal_connect_object(GTK_OBJECT(button_new), "clicked",
@@ -53,6 +61,7 @@
GINT_TO_POINTER(0));
gtk_container_add(GTK_CONTAINER(hbutton_box), button_new);
+ /* Edit account button */
button_edit = gtk_button_new_with_label("Edit");
gtk_widget_set_usize(GTK_WIDGET(button_edit), 55, 22);
gtk_signal_connect_object(GTK_OBJECT(button_edit), "clicked",
@@ -61,135 +70,153 @@
GINT_TO_POINTER(1));
gtk_container_add(GTK_CONTAINER(hbutton_box), button_edit);
+ /* Remove account button */
button_remove = gtk_button_new_with_label("Remove");
gtk_widget_set_usize(GTK_WIDGET(button_remove), 55, 22);
gtk_container_add(GTK_CONTAINER(hbutton_box), button_remove);
-
- hbutton_box = gtk_hbutton_box_new();
- gtk_box_pack_start(GTK_BOX(main_vbox), hbutton_box, FALSE, FALSE,
- 0);
+ /* Close button */
button_close = gtk_button_new_with_label("Close");
gtk_signal_connect_object(GTK_OBJECT(button_close), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT(accounts_win));
gtk_container_add(GTK_CONTAINER(hbutton_box), button_close);
+ /* Show all widgets in the accounts window */
gtk_widget_show_all(accounts_win);
}
-
-void create_accounts_win_new_edit(gint type)
+/* The new/edit account window */
+void create_accounts_win_new_edit(gint type) /* type 0 for new account and
+ type 1 for edit a account */
{
- GtkWidget *main_vbox, *hbox;
+ GtkWidget *main_vbox;
GtkWidget *table;
GtkWidget *label;
GtkWidget *sep1;
GtkWidget *hbutton_box;
GtkWidget *button_save, *button_cancel;
+ /* Set the right title for the window */
if (type == 0)
title = g_strdup_printf("New Account");
if (type == 1)
title = g_strdup_printf("Edit Account");
-
+ /* Create the new/edit account window */
accounts_win_new = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(accounts_win_new), title);
+ /* Main vbox, in here everything goes */
main_vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 0);
gtk_container_add(GTK_CONTAINER(accounts_win_new), main_vbox);
+ /* A nice table with 2 columns */
table = gtk_table_new(4, 2, FALSE);
gtk_table_set_row_spacings(GTK_TABLE(table), 2);
gtk_box_pack_start(GTK_BOX(main_vbox), table, FALSE, FALSE, 4);
+ /* Folder name label */
label = gtk_label_new("Folder Name:");
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* Folder name entry */
folder_name = gtk_entry_new();
gtk_widget_set_usize(GTK_WIDGET(folder_name), 200, 20);
gtk_table_attach(GTK_TABLE(table), folder_name, 1, 2, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* Full name label */
label = gtk_label_new("Full Name:");
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* Full name entry */
full_name = gtk_entry_new();
gtk_widget_set_usize(GTK_WIDGET(full_name), 200, 20);
gtk_table_attach(GTK_TABLE(table), full_name, 1, 2, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* E-mail address label */
label = gtk_label_new("E-mail Address:");
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2,
3, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* E-mail address entry */
email_address = gtk_entry_new();
gtk_widget_set_usize(GTK_WIDGET(email_address), 200, 20);
gtk_table_attach(GTK_TABLE(table), email_address, 1, 2, 2,
3, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* A nice table with 4 columns */
table = gtk_table_new(2, 4, FALSE);
gtk_table_set_row_spacings(GTK_TABLE(table), 2);
gtk_box_pack_start(GTK_BOX(main_vbox), table, FALSE, FALSE, 4);
+ /* Username label */
label = gtk_label_new("Username:");
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* Username entry */
username = gtk_entry_new();
gtk_widget_set_usize(GTK_WIDGET(username), 100, 20);
gtk_table_attach(GTK_TABLE(table), username, 1, 2, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* Password label */
label = gtk_label_new("Password:");
gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0,
1, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* Password entry */
password = gtk_entry_new();
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);
+ /* Server label */
label = gtk_label_new("Server:");
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* Server entry */
server = gtk_entry_new();
gtk_widget_set_usize(GTK_WIDGET(server), 100, 20);
gtk_table_attach(GTK_TABLE(table), server, 1, 2, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* Path label */
label = gtk_label_new("Path:");
gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ /* Path entry */
path = gtk_entry_new();
gtk_widget_set_usize(GTK_WIDGET(path), 100, 20);
gtk_table_attach(GTK_TABLE(table), path, 3, 4, 1,
2, GTK_EXPAND | GTK_FILL, 0, 1, 1);
- hbox = gtk_hbox_new(FALSE, 0);
- gtk_container_set_border_width(GTK_CONTAINER(hbox), 0);
- gtk_box_pack_start(GTK_BOX(main_vbox), hbox, TRUE, TRUE, 0);
-
+ /* A separator betwen the entryboxes and the buttons */
sep1 = gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(main_vbox), sep1, TRUE, TRUE, 0);
+ /* A new hbutton box */
hbutton_box = gtk_hbutton_box_new();
gtk_box_pack_start(GTK_BOX(main_vbox), hbutton_box, FALSE, FALSE,
0);
+ /* Save button */
button_save = gtk_button_new_with_label("Save");
gtk_widget_set_usize(GTK_WIDGET(button_save), 55, 22);
- /*gtk_signal_connect(GTK_OBJECT(button_save), "clicked",
- GTK_SIGNAL_FUNC(account_write),
- GINT_TO_POINTER(type)); */
+ gtk_signal_connect(GTK_OBJECT(button_save), "clicked",
+ GTK_SIGNAL_FUNC(save_account),
+ GINT_TO_POINTER(type));
gtk_container_add(GTK_CONTAINER(hbutton_box), button_save);
+ /* Cancel button */
button_cancel = gtk_button_new_with_label("Cancel");
gtk_widget_set_usize(GTK_WIDGET(button_cancel), 55, 22);
gtk_signal_connect_object(GTK_OBJECT(button_cancel), "clicked",
@@ -197,63 +224,42 @@
GTK_OBJECT(accounts_win_new));
gtk_container_add(GTK_CONTAINER(hbutton_box), button_cancel);
+ /* Show all widgets in new/edit account window */
gtk_widget_show_all(accounts_win_new);
}
-void account_write()
+void save_account(gint type)
{
- /*FILE *account;
- gchar *account_file;
- gchar *acct_name, *fullname, *email, *spool, *pop, *smtp;
-
- acct_name = g_strdup(gtk_entry_get_text(GTK_ENTRY(account_name)));
- fullname = g_strdup(gtk_entry_get_text(GTK_ENTRY(full_name)));
- email = g_strdup(gtk_entry_get_text(GTK_ENTRY(email_address)));
- if (type == 0)
- spool = g_strdup(gtk_entry_get_text(GTK_ENTRY(spoolfile)));
- if (type == 1)
- pop = g_strdup(gtk_entry_get_text(GTK_ENTRY(popserver)));
- mtp = g_strdup(gtk_entry_get_text(GTK_ENTRY(smtpserver)));
-
- account_file =
- g_strconcat(getenv("HOME"), "/.core/accounts/", acct_name, NULL);
-
- if (g_strcasecmp(acct_name, "") == 0) {
- g_print("ERROR: You must specify a account name");
- return;
- }
-
- account = fopen(account_file, "w");
- if (account == NULL) {
- fprintf(account, "ERROR: Cannot write to account file\n");
- return;
- }
-
- if (type == 0)
- fprintf(account, "account_type=mbox\n");
- if (type == 1)
- fprintf(account, "account_type=pop3\n");
- fprintf(account, "account_name=%s\n", acct_name);
- fprintf(account, "full_name=%s\n", fullname);
- fprintf(account, "email_address=%s\n", email);
- if (type == 0)
- fprintf(account, "spoolfile=%s\n", spool);
- if (type == 1)
- fprintf(account, "popserver=%s\n", pop);
- fprintf(account, "smtpserver=%s\n", smtp);
+ Account *acct;
+
+ acct = new_account();
- gtk_widget_destroy(accounts_win_new);
- return; */
+ acct->name = gtk_entry_get_text(GTK_ENTRY(folder_name));
+ acct->full_name = gtk_entry_get_text(GTK_ENTRY(full_name));
+ acct->address = gtk_entry_get_text(GTK_ENTRY(email_address));
+ /*acct->type = gtk_entry_get_text(GTK_ENTRY(type));*/
+ acct->username = gtk_entry_get_text(GTK_ENTRY(username));
+ acct->password = gtk_entry_get_text(GTK_ENTRY(password));
+ acct->server = gtk_entry_get_text(GTK_ENTRY(server));
+ acct->path = gtk_entry_get_text(GTK_ENTRY(path));
+
+ account_write(acct);
+
+ gtk_widget_destroy(accounts_win_new);
+ return;
}
+/* This creates the preference window with the correct title About */
void create_core_about_window(void)
{
+ /* Set the title */
gchar *title = g_strdup_printf("About");
+ /* Pass the title to right callback */
create_preferences_window_cb(title);
}
-
+/* Calls the create_mail_window_cb showing the right stuff for viewing a mail */
void create_mail_window_view(GtkWidget * button, gpointer data)
{
Message *m;
@@ -271,6 +277,7 @@
button = NULL;
}
+/* Calls the create_mail_window_cb showing the right stuff for creating a new mail */
void create_mail_window_new(GtkWidget * button)
{
Message *m;
@@ -285,6 +292,7 @@
button = NULL;
}
+/* Calls the create_mail_window_cb showing the right stuff for replying to a mail */
void create_mail_window_reply(GtkWidget * button, gpointer data)
{
Message *m;
@@ -301,6 +309,7 @@
button = NULL;
}
+/* Calls the create_mail_window_cb showing the right stuff to reply to all recipients of a mail */
void create_mail_window_reply_all(GtkWidget * button, gpointer data)
{
Message *m;
@@ -316,6 +325,7 @@
button = NULL;
}
+/* Calls the create_mail_window_cb showing the right stuff to forward a mail */
void create_mail_window_forward(GtkWidget * button, gpointer data)
{
Message *m;
@@ -332,6 +342,7 @@
button = NULL;
}
+/* The real create_mail_window callback */
void create_mail_window_cb(gchar * title, Message * message,
MessageFlags mode)
{
@@ -362,6 +373,7 @@
gtk_widget_show_all(mail);
}
+/* Function when selecting a folder */
int folder_selected(GtkWidget * list, GList * node, gint col,
gpointer data)
{
@@ -372,10 +384,7 @@
mbox = (Account *) gtk_ctree_node_get_row_data(GTK_CTREE(list),
GTK_CTREE_NODE
(node));
- title =
- g_strdup_printf("Core %d.%d.%d", CORE_MAJOR,
- CORE_MINOR, CORE_MICRO);
- gtk_window_set_title(GTK_WINDOW(main_win), title);
+
while (1) {
GtkCTreeNode *top, *item;
char *temp;
@@ -485,17 +494,18 @@
free);
destroy_message(message);
}
- current_mbox = mbox;
- account_reset_file(mbox);
+ current_mbox = mbox;
+ account_reset_file(mbox);
return TRUE;
data = NULL;
}
+/* Function for unselecting a item in the folder ctree */
int folder_unselected(GtkWidget * list, GList * node, gint col,
gpointer data)
{
- gtk_ctree_remove_node(GTK_CTREE(mail_ctree), NULL);
+ gtk_ctree_remove_node(GTK_CTREE(mail_ctree), NULL);
return TRUE;
list = NULL;
@@ -504,6 +514,7 @@
data = NULL;
}
+/* Function for selecting a mail in the mail ctree */
int mail_selected(GtkWidget * list, GList * node, gint col, gpointer data)
{
char *temp;
@@ -522,6 +533,9 @@
data = NULL;
}
+/* Function for unselecting a mail in the mail ctree
+ * Don't really need to do anything in this function, nothing to free from memory
+ */
int mail_unselected(GtkWidget * list, GList * node, gint col,
gpointer data)
{
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- callbacks.h 2000/11/20 21:02:13 1.5
+++ callbacks.h 2000/11/21 05:10:40 1.6
@@ -1,31 +1,66 @@
+/* This function is called from main() to create the main window */
void create_core_main_window(void);
+
+/* This function creates the preference window with 'About' as title */
void create_core_about_window(void);
+
+/* The main menu widget */
GtkWidget *create_main_menu();
+
+/* The toolbar that goes in the main window */
GtkWidget *create_main_toolbar();
-void create_account_window();
+
+/* The real callback for create_mail_window_view/new/reply/reply_all/forward */
void create_mail_window_cb(gchar * title, Message * message,
MessageFlags mode);
+
+/* Calls the create_mail_window_cb showing the right stuff for viewing a mail */
void create_mail_window_view(GtkWidget * button, gpointer data);
+
+/* Calls the create_mail_window_cb showing the right stuff for creating a new mail */
void create_mail_window_new(GtkWidget * button);
+
+/* Calls the create_mail_window_cb showing the right stuff for replying to a mail */
void create_mail_window_reply(GtkWidget * button, gpointer data);
+
+/* Calls the create_mail_window_cb showing the right stuff to reply to all recipients of a mail */
void create_mail_window_reply_all(GtkWidget * button, gpointer data);
+
+/* Calls the create_mail_window_cb showing the right stuff to forward a mail */
void create_mail_window_forward(GtkWidget * button, gpointer data);
+/* The mail window menu */
void create_mail_menu(GtkWidget * window, GtkWidget ** menubar);
+/* Function when selecting a folder */
int folder_selected(GtkWidget * list, GList * node, gint col,
gpointer data);
+/* Function when unselecting a folder */
int folder_unselected(GtkWidget * list, GList * node, gint col,
gpointer data);
+/* Function for selecting a mail in the mail ctree */
int mail_selected(GtkWidget * list, GList * node, gint col, gpointer data);
+
+/* Function for unselecting a mail in the mail ctree
+ * Don't really need to do anything in this function, nothing to free from memory */
int mail_unselected(GtkWidget * list, GList * node, gint col,
gpointer data);
+/* Menu function for hiding/shoing the toolbar */
void toolbar_hide_show();
+
+/* Change toolbar typ, 0 for text, 1 for icons and 2 for both text and icons */
void toolbar_change_layout(gint type);
+
+/* Quit core funcion */
void core_main_quit(void);
+/* The main account window */
+void create_account_window();
+
+/* The new/edit account window */
void create_accounts_win_new_edit(gint type);
-void create_accounts_win_delete();
-void account_write();
+
+/* Save account */
+void save_account(gint type);
|
|
From: CORE C. L. <cor...@li...> - 2000-11-20 22:59:02
|
Core CVS committal
Author : rbdpngn
Project : core
Module : src
Modified Files:
account.c account.h callbacks.c
Log Message:
Fixed some folder selection bugs. Still one more lurking, I'll have to look at it again later.
===================================================================
RCS file: /cvsroot/corem/core/src/account.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- account.c 2000/11/20 21:02:13 1.5
+++ account.c 2000/11/20 22:59:01 1.6
@@ -234,3 +234,12 @@
return mbox;
}
+
+int account_reset_file(Account *ac)
+{
+ if (!ac || !ac->fp)
+ return FALSE;
+
+ rewind(ac->fp);
+ return TRUE;
+}
===================================================================
RCS file: /cvsroot/corem/core/src/account.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- account.h 2000/11/20 22:32:00 1.4
+++ account.h 2000/11/20 22:59:01 1.5
@@ -23,7 +23,6 @@
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() */
@@ -58,3 +57,6 @@
Account *account_read(gchar * path);
/* Move through the various folders returning them one at a time */
Account *get_next_folder(void);
+
+/* Reset the file pointer for the local mailbox */
+int account_reset(Account *ac);
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- callbacks.c 2000/11/20 22:32:00 1.16
+++ callbacks.c 2000/11/20 22:59:01 1.17
@@ -485,7 +485,8 @@
free);
destroy_message(message);
}
- current_mbox = mbox;
+ current_mbox = mbox;
+ account_reset_file(mbox);
return TRUE;
data = NULL;
@@ -494,6 +495,8 @@
int folder_unselected(GtkWidget * list, GList * node, gint col,
gpointer data)
{
+ gtk_ctree_remove_node(GTK_CTREE(mail_ctree), NULL);
+
return TRUE;
list = NULL;
node = NULL;
|