|
From: CORE C. L. <cor...@li...> - 2000-11-20 10:02:33
|
Core CVS committal
Author : smugg
Project : core
Module : src
Modified Files:
account.c callbacks.c callbacks.h main.c prefs.c
Log Message:
fixed some theming issues
===================================================================
RCS file: /cvsroot/corem/core/src/account.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- account.c 2000/11/16 05:46:47 1.3
+++ account.c 2000/11/20 10:02:03 1.4
@@ -160,77 +160,77 @@
* Returns: nothing
*/
-Account *account_read(gchar * path)
+Account *account_read(gchar *path)
{
FILE *fp;
- gchar *line;
- Account *acct;
+ gchar *line;
+ Account *acct;
- fp = fopen(path, "r");
+ fp = fopen(path, "r");
if (fp == NULL) {
perror("fopen");
return NULL;
- }
+ }
- acct = new_account();
+ acct = new_account();
-
+
while ((line = get_next_line(fp)) != NULL) {
- if (g_strncasecmp(line, "account_name=", 13) == 0)
+ if (g_strncasecmp(line, "account_name=", 13) == 0)
account_set_name(acct, line + 13);
else if (g_strncasecmp(line, "smtp_server=", 12) == 0)
account_set_server(acct, line + 12);
- else if (g_strncasecmp(line, "full_name=", 10) == 0)
+ else if (g_strncasecmp(line, "full_name=", 10) == 0)
account_set_fullname(acct, line + 10);
- else if (g_strncasecmp(line, "path=", 5) == 0)
+ else if (g_strncasecmp(line, "path=", 5) == 0)
account_set_path(acct, line + 5);
- else if (g_strncasecmp(line, "email_address=", 14) == 0)
+ else if (g_strncasecmp(line, "email_address=", 14) == 0)
account_set_address(acct, line + 14);
- }
+ }
- return acct;
+ return acct;
}
Account *get_next_folder()
{
- struct stat file_stat;
- struct dirent *dentry = NULL;
- char *temp = NULL;
- char *path = NULL;
- Account *mbox = NULL;
-
- temp = g_strdup(getenv("HOME"));
- if (!temp)
- return NULL;
-
- asprintf(&path, "%s/.core/accounts", temp);
- if (!path)
- return NULL;
- g_free(temp);
-
- if (!acct_dir)
- acct_dir = opendir(path);
-
- if (!acct_dir) {
- perror("opendir");
- return NULL;
- }
-
- while ((dentry = readdir(acct_dir)) != NULL) {
-
- asprintf(&temp, "%s/%s", path, dentry->d_name);
- if (!temp)
- break;
-
- if (stat(temp, &file_stat) < 0)
- break;
-
- if (S_ISREG(file_stat.st_mode))
- mbox = account_read(temp);
-
- /* g_free(dentry); */
- g_free(temp);
- }
+ struct stat file_stat;
+ struct dirent *dentry = NULL;
+ char *temp = NULL;
+ char *path = NULL;
+ Account *mbox = NULL;
+
+ temp = g_strdup(getenv("HOME"));
+ if (!temp)
+ return NULL;
+
+ asprintf(&path, "%s/.core/accounts", temp);
+ if (!path)
+ return NULL;
+ g_free(temp);
+
+ if (!acct_dir)
+ acct_dir = opendir(path);
+
+ if (!acct_dir) {
+ perror("opendir");
+ return NULL;
+ }
+
+ while ((dentry = readdir(acct_dir)) != NULL) {
+
+ asprintf(&temp, "%s/%s", path, dentry->d_name);
+ if (!temp)
+ break;
+
+ if (stat(temp, &file_stat) < 0)
+ break;
+
+ if (S_ISREG(file_stat.st_mode))
+ mbox = account_read(temp);
+
+ /* g_free(dentry); */
+ g_free(temp);
+ }
return mbox;
}
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- callbacks.c 2000/11/16 21:15:09 1.13
+++ callbacks.c 2000/11/20 10:02:03 1.14
@@ -18,7 +18,7 @@
{
GtkWidget *accounts_win;
GtkWidget *main_vbox, *vbox;
- GtkWidget *table;
+ GtkWidget *hbutton_box;
GtkWidget *button_new, *button_edit, *button_remove, *button_close;
gchar *titles[] =
{ "Folder Name", "Full Name", "E-mail Address",
@@ -35,15 +35,14 @@
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 0);
- gtk_container_add(GTK_CONTAINER(main_vbox), vbox);
+ gtk_box_pack_start(GTK_BOX(main_vbox), vbox, TRUE, TRUE, 0);
clist = gtk_clist_new_with_titles(4, titles);
gtk_widget_set_usize(GTK_WIDGET(clist), 600, 180);
gtk_container_add(GTK_CONTAINER(vbox), clist);
- table = gtk_table_new(3, 4, FALSE);
- gtk_table_set_row_spacings(GTK_TABLE(table), 2);
- gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 4);
+ hbutton_box = gtk_hbutton_box_new();
+ gtk_box_pack_start(GTK_BOX(main_vbox), hbutton_box, FALSE, FALSE, 0);
button_new = gtk_button_new_with_label("New");
gtk_widget_set_usize(GTK_WIDGET(button_new), 55, 22);
@@ -51,8 +50,7 @@
GTK_SIGNAL_FUNC
(create_accounts_win_new_edit),
GINT_TO_POINTER(0));
- gtk_table_attach(GTK_TABLE(table), button_new, 0, 1, 0, 1,
- GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ gtk_container_add(GTK_CONTAINER(hbutton_box), button_new);
button_edit = gtk_button_new_with_label("Edit");
gtk_widget_set_usize(GTK_WIDGET(button_edit), 55, 22);
@@ -60,20 +58,20 @@
GTK_SIGNAL_FUNC
(create_accounts_win_new_edit),
GINT_TO_POINTER(1));
- gtk_table_attach(GTK_TABLE(table), button_edit, 1, 2, 0, 1,
- GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ gtk_container_add(GTK_CONTAINER(hbutton_box), button_edit);
button_remove = gtk_button_new_with_label("Remove");
gtk_widget_set_usize(GTK_WIDGET(button_remove), 55, 22);
- gtk_table_attach(GTK_TABLE(table), button_remove, 2, 3, 0, 1,
- GTK_EXPAND | GTK_FILL, 0, 1, 1);
+ 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);
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_box_pack_end(GTK_BOX(main_vbox), button_close, FALSE, FALSE,
- 4);
+ gtk_container_add(GTK_CONTAINER(hbutton_box), button_close);
gtk_widget_show_all(accounts_win);
}
@@ -85,6 +83,7 @@
GtkWidget *table;
GtkWidget *label;
GtkWidget *sep1;
+ GtkWidget *hbutton_box;
GtkWidget *button_save, *button_cancel;
if (type == 0)
@@ -173,24 +172,27 @@
hbox = gtk_hbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 0);
- gtk_box_pack_end(GTK_BOX(main_vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(main_vbox), hbox, TRUE, TRUE, 0);
sep1 = gtk_hseparator_new();
- gtk_box_pack_end(GTK_BOX(main_vbox), sep1, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(main_vbox), sep1, TRUE, TRUE, 0);
+
+ hbutton_box = gtk_hbutton_box_new();
+ gtk_box_pack_start(GTK_BOX(main_vbox), hbutton_box, FALSE, FALSE, 0);
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_box_pack_start(GTK_BOX(hbox), button_save, TRUE, TRUE, 0);
+ gtk_container_add(GTK_CONTAINER(hbutton_box), button_save);
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",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT(accounts_win_new));
- gtk_box_pack_start(GTK_BOX(hbox), button_cancel, TRUE, TRUE, 0);
+ gtk_container_add(GTK_CONTAINER(hbutton_box), button_cancel);
gtk_widget_show_all(accounts_win_new);
}
@@ -209,7 +211,7 @@
spool = g_strdup(gtk_entry_get_text(GTK_ENTRY(spoolfile)));
if (type == 1)
pop = g_strdup(gtk_entry_get_text(GTK_ENTRY(popserver)));
- smtp = g_strdup(gtk_entry_get_text(GTK_ENTRY(smtpserver)));
+ mtp = g_strdup(gtk_entry_get_text(GTK_ENTRY(smtpserver)));
account_file =
g_strconcat(getenv("HOME"), "/.core/accounts/", acct_name, NULL);
@@ -357,10 +359,9 @@
gtk_widget_show_all(mail);
}
-int folder_selected(GtkWidget * list, GList * node /*, gint col,
- gpointer data */ )
+int folder_selected(GtkWidget * list, GList * node, gint col,
+ gpointer data)
{
- gint col;
Message *message = NULL;
Account *mbox = NULL;
char *text[7] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
===================================================================
RCS file: /cvsroot/corem/core/src/callbacks.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- callbacks.h 2000/11/16 04:12:18 1.3
+++ callbacks.h 2000/11/20 10:02:03 1.4
@@ -13,8 +13,8 @@
void create_mail_menu(GtkWidget * window, GtkWidget ** menubar);
-int folder_selected(GtkWidget * list, GList * node /*, gint col,
- gpointer data */ );
+int folder_selected(GtkWidget * list, GList * node, gint col,
+ gpointer data);
int folder_unselected( /*GtkWidget * list, GList * node, gint col,
gpointer data */ );
===================================================================
RCS file: /cvsroot/corem/core/src/main.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- main.c 2000/11/14 22:07:28 1.7
+++ main.c 2000/11/20 10:02:03 1.8
@@ -140,7 +140,7 @@
gdk_pixmap_colormap_create_from_xpm(NULL, colormap,
&bitmap, NULL,
g_strconcat(theme,
- "new-mail32x32.xpm",
+ "new.xpm",
NULL));
new = gtk_pixmap_new(pixmap, bitmap);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "New",
@@ -158,7 +158,7 @@
gdk_pixmap_colormap_create_from_xpm(NULL, colormap,
&bitmap, NULL,
g_strconcat(theme,
- "reply32x32.xpm",
+ "reply.xpm",
NULL));
reply = gtk_pixmap_new(pixmap, bitmap);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Reply",
@@ -176,7 +176,7 @@
gdk_pixmap_colormap_create_from_xpm(NULL, colormap,
&bitmap, NULL,
g_strconcat(theme,
- "reply-all32x32.xpm",
+ "reply-all.xpm",
NULL));
reply_all = gtk_pixmap_new(pixmap, bitmap);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Reply All",
@@ -194,7 +194,7 @@
gdk_pixmap_colormap_create_from_xpm(NULL, colormap,
&bitmap, NULL,
g_strconcat(theme,
- "forward32x32.xpm",
+ "forward.xpm",
NULL));
forward = gtk_pixmap_new(pixmap, bitmap);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Forward",
===================================================================
RCS file: /cvsroot/corem/core/src/prefs.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- prefs.c 2000/11/16 05:46:47 1.2
+++ prefs.c 2000/11/20 10:02:03 1.3
@@ -295,18 +295,18 @@
g_strdup_printf("Core %d.%d.%d", CORE_MAJOR, CORE_MINOR,
CORE_MICRO));
gtk_signal_connect(GTK_OBJECT
- (GTK_FONT_SELECTION_DIALOG
- (fontsel)->cancel_button), "clicked",
+ (GTK_FONT_SELECTION_DIALOG(fontsel)->
+ cancel_button), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy), fontsel);
gtk_signal_connect(GTK_OBJECT
(GTK_FONT_SELECTION_DIALOG(fontsel)->ok_button),
"clicked", GTK_SIGNAL_FUNC(set_font), fontsel);
gtk_object_set_data(GTK_OBJECT
- (GTK_FONT_SELECTION_DIALOG
- (fontsel)->ok_button), "entry", entry);
+ (GTK_FONT_SELECTION_DIALOG(fontsel)->
+ ok_button), "entry", entry);
gtk_widget_hide(GTK_WIDGET
- (GTK_FONT_SELECTION_DIALOG
- (fontsel)->apply_button));
+ (GTK_FONT_SELECTION_DIALOG(fontsel)->
+ apply_button));
gtk_widget_show(fontsel);
return;
button = NULL;
|