|
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,
|