Re: Print support




Opps....

That was _SO_ wrong :(

First I posted it in wrong mailinglist, second I forgot to include the patch :)

I'm trying again :)

-Ragnar-


On Wed, 13 Oct 1999 08:39:23 Ragnar Henriksen wrote:
> 
> This patch includes:
> 
> * adding print support (very simple, but working)
> * adding new popup menus (message list and mblist)
> * added back some charset stuff that where missing. (it's now working again)
> * body-area in the composewindow uses balsa_app.message_font. (I don't like those large fonts)
> 
> About print.
> The print support is very simple. It makes a tmp-file and uses gnome_execute_shell() to
> execute a external command, and deletes it.
> 
> The command is build like this <command> <args> <tmp-file>. The file is allways the last
> argument.
> 
> In settings-preferences->printing the command could look like this: a2ps -d -q. I haven't
> added code to pharse the commandline yet.
> 
> Hope you find it usefull, I know I do :)
> 
> 
> 
> 
> -Ragnar-

diff -ruN balsa/libbalsa/mailbox.c balsa-new/libbalsa/mailbox.c
--- balsa/libbalsa/mailbox.c	Sat Oct  9 02:46:34 1999
+++ balsa-new/libbalsa/mailbox.c	Sat Oct  9 03:54:46 1999
@@ -1148,6 +1148,9 @@
   if (stat (filename, &st) == -1)
     return MAILBOX_UNKNOWN;
 
+  if (S_ISDIR (st.st_mode)) 
+      return MAILBOX_MAILDIR;
+
   switch (mx_get_magic (filename))
     {
     case M_MBOX:
diff -ruN balsa/src/Makefile.am balsa-new/src/Makefile.am
--- balsa/src/Makefile.am	Sat Oct  9 02:46:34 1999
+++ balsa-new/src/Makefile.am	Sat Oct  9 04:24:32 1999
@@ -56,7 +56,6 @@
 	$(top_builddir)/libbalsa/libbalsa.a \
 	$(top_builddir)/libmutt/libmutt.a \
 	$(top_builddir)/libbalsa/libbalsa.a \
-	-lPropList	\
 	-lpthread	\
 	-lgthread	\
 	@LIBESD_LIB@	\
diff -ruN balsa/src/Makefile.in balsa-new/src/Makefile.in
--- balsa/src/Makefile.in	Sat Oct  9 02:47:03 1999
+++ balsa-new/src/Makefile.in	Sat Oct  9 04:31:58 1999
@@ -135,7 +135,7 @@
 INCLUDES =  	-DGNOMELOCALEDIR=\""$(datadir)/locale"\"		-I.							-I${top_srcdir}/libbalsa				-I${top_srcdir}						-I$(top_srcdir)/idl					-I$(top_builddir)/idl					-I${top_builddir}/libmutt				 $(GNOME_INCLUDEDIR)
 
 
-balsa_LDADD =  	$(top_builddir)/libbalsa/libbalsa.a 	$(top_builddir)/libmutt/libmutt.a 	$(top_builddir)/libbalsa/libbalsa.a 	-lPropList		-lpthread		-lgthread		@LIBESD_LIB@		$(GNOME_LIBDIR) 	$(top_builddir)/idl/libbalsasrv.a 	$(GNOMEGNORBA_LIBS)  	$(INTLLIBS)
+balsa_LDADD =  	$(top_builddir)/libbalsa/libbalsa.a 	$(top_builddir)/libmutt/libmutt.a 	$(top_builddir)/libbalsa/libbalsa.a 	-lpthread		-lgthread		@LIBESD_LIB@		$(GNOME_LIBDIR) 	$(top_builddir)/idl/libbalsasrv.a 	$(GNOMEGNORBA_LIBS)  	$(INTLLIBS)
 
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
diff -ruN balsa/src/address-book.c balsa-new/src/address-book.c
--- balsa/src/address-book.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/address-book.c	Sat Oct  9 03:54:46 1999
@@ -198,6 +198,36 @@
     return FALSE;
 }
 
+static void
+ab_find(GtkWidget * group_entry)
+{
+    gchar *entry_text;
+    gpointer         row;
+    gchar            *new;
+    gint num;
+
+    g_return_if_fail(book_clist);
+
+    entry_text = gtk_entry_get_text(GTK_ENTRY(group_entry));
+    gtk_clist_freeze(GTK_CLIST(book_clist));
+
+    num = 0;
+    while ( (row = gtk_clist_get_row_data(book_clist, num))!= NULL) {
+	gtk_clist_get_text(GTK_CLIST(book_clist), num, 0, &new);
+	if (strncasecmp(new, entry_text,strlen(entry_text)) == 0){
+	    //	    gtk_clist_select_row(GTK_CLIST(book_clist), num, 0);
+	    gtk_clist_moveto(GTK_CLIST(book_clist), num, 0, 0, 0);
+	    break;
+	}
+	num++;
+    }
+
+    gtk_clist_thaw(GTK_CLIST(book_clist));
+}
+
+
+
+
 gint
 address_book_cb(GtkWidget * widget, gpointer data)
 {
@@ -207,6 +237,8 @@
                    *hbox,
                    *box2,
                    *scrolled_window;
+    GtkWidget      *find_label,
+	           *find_entry;
     gchar          *titles[2] =
     {N_("Name"), N_("E-Mail Address")};
 
@@ -224,6 +256,25 @@
     gtk_clist_column_titles_passive(GTK_CLIST(add_clist));
 
     ab_entry = (GtkWidget *) data;
+
+    find_entry = gtk_entry_new();
+    gtk_signal_connect(GTK_OBJECT(find_entry), "changed", GTK_SIGNAL_FUNC(ab_find),   find_entry);
+
+
+    find_label = gtk_label_new(N_("Name:"));
+
+    gtk_table_attach (GTK_TABLE (find_entry), find_label, 0, 1, 0, 1,
+		    GTK_FILL, GTK_FILL, 10, 10);
+    composing = FALSE;
+    
+    hbox = gtk_hbox_new(FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ 
+    box2 = gtk_vbox_new(FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(hbox), box2, FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(box2), gtk_label_new(N_("Address Book")), FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(box2), find_label, FALSE, FALSE, 3);
+    gtk_box_pack_start(GTK_BOX(box2), find_entry, TRUE, TRUE, 3);
 
     composing = FALSE;
 
diff -ruN balsa/src/balsa-app.c balsa-new/src/balsa-app.c
--- balsa/src/balsa-app.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/balsa-app.c	Tue Oct 12 16:07:18 1999
@@ -112,7 +112,7 @@
   balsa_app.new_messages = 0;
 
   balsa_app.check_mail_timer = 0;
-
+  balsa_app.checkbox = TRUE;
   balsa_app.debug = FALSE;
   balsa_app.previewpane = TRUE;
 
@@ -130,6 +130,11 @@
   /*encoding */
   balsa_app.encoding_style = 0;
   balsa_app.charset = NULL;
+
+  /* printing */
+  balsa_app.PrintCommand.PrintCommand = NULL;
+  balsa_app.PrintCommand.linesize = 0;
+  balsa_app.PrintCommand.breakline = 0;
 
 }
 
diff -ruN balsa/src/balsa-app.h balsa-new/src/balsa-app.h
--- balsa/src/balsa-app.h	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/balsa-app.h	Tue Oct 12 16:03:48 1999
@@ -37,11 +37,20 @@
 #define MESSAGEBOX_WIDTH 450
 #define MESSAGEBOX_HEIGHT 150
 
-#define DEFAULT_MESSAGE_FONT "-adobe-helvetica-medium-r-normal--12-*-72-72-p-*-iso8859-1"
+#define DEFAULT_MESSAGE_FONT "-adobe-helvetica-medium-r-normal--10-*-72-72-p-*-iso8859-1"
 
 #define DEFAULT_CHARSET "ISO-8859-1"
 #define DEFAULT_ENCODING ENC8BIT
 
+typedef struct stPrinting Printing_t;
+
+struct stPrinting{
+    gint  breakline;
+    gint  linesize;
+    gchar *PrintCommand;
+};
+
+
 /* global balsa application structure */
 extern struct BalsaApplication
 {
@@ -101,6 +110,11 @@
   /* encoding stuff */
   gint encoding_style;
   gchar *charset;
+
+  gint checkbox;
+
+  /* printing */
+  Printing_t PrintCommand;
 
       
 }
diff -ruN balsa/src/balsa-init.c balsa-new/src/balsa-init.c
--- balsa/src/balsa-init.c	Sat Oct  9 03:19:52 1999
+++ balsa-new/src/balsa-init.c	Sat Oct  9 04:07:09 1999
@@ -679,6 +679,7 @@
   balsa_app.trash = mailbox;
 
   config_global_save ();
+  config_load( BALSA_CONFIG_FILE );
 
   gtk_widget_destroy (prefs->real_name);
   gtk_widget_destroy (prefs->email);
diff -ruN balsa/src/balsa-mblist.c balsa-new/src/balsa-mblist.c
--- balsa/src/balsa-mblist.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/balsa-mblist.c	Tue Oct 12 19:14:15 1999
@@ -361,12 +361,14 @@
 	  if (mbnode->mailbox->type == MAILBOX_MH ||
 	      mbnode->mailbox->type == MAILBOX_MAILDIR)
 	    {
-	      gtk_ctree_set_node_info (ctree, cnode, mbnode->mailbox->name, 5,
-				       NULL, NULL,
-				       NULL, NULL,
-				       G_NODE_IS_LEAF (gnode),
-				       mbnode->expanded);
-	      gtk_ctree_node_set_row_data (ctree, cnode, mbnode->mailbox);
+		gtk_ctree_set_node_info (ctree, cnode, g_basename (mbnode->name), 5,
+					 balsa_icon_get_pixmap (BALSA_ICON_DIR_CLOSED),
+					 balsa_icon_get_bitmap (BALSA_ICON_DIR_CLOSED),
+					 balsa_icon_get_pixmap (BALSA_ICON_DIR_OPEN),
+					 balsa_icon_get_bitmap (BALSA_ICON_DIR_OPEN),
+					 G_NODE_IS_LEAF (gnode),
+					 mbnode->expanded);
+		gtk_ctree_node_set_row_data (ctree, cnode, mbnode->mailbox);
 	    }
 	  else
 	    {
@@ -379,7 +381,7 @@
 		  style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (ctree)));
                   gdk_font_unref(style->font);
 		  font = gdk_font_load
-					("-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1");
+					("-adobe-courier-medium-r-normal-*-*-120-*-*-*-*-iso8859-1");
 		  style->font = font;
                   gdk_font_ref(style->font);
 
diff -ruN balsa/src/index-child.c balsa-new/src/index-child.c
--- balsa/src/index-child.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/index-child.c	Tue Oct 12 22:44:40 1999
@@ -33,6 +33,11 @@
 static void index_child_class_init (IndexChildClass *);
 static void index_child_init (IndexChild *);
 
+extern void print_current_message_cb(GtkWidget *widget, gpointer data);
+extern void replyto_message_cb (GtkWidget * widget, gpointer data);
+extern void replytoall_message_cb (GtkWidget * widget, gpointer data);
+extern void forward_message_cb (GtkWidget * widget, gpointer data);
+
 /* DND declarations */
 enum
   {
@@ -86,6 +91,8 @@
 static void undelete_message_cb (GtkWidget *, BalsaIndex *);
 static void transfer_messages_cb (BalsaMBList *, Mailbox *, GtkCTreeNode *, GdkEventButton *, BalsaIndex *);
 
+static void open_message_cb (GtkWidget *, BalsaIndex *);
+
 void
 index_child_changed (GnomeMDI * mdi, GnomeMDIChild * mdi_child)
 {
@@ -270,8 +277,6 @@
       hadj->step_increment = 10;
       gtk_paned_add2 (GTK_PANED (vpane), sw);
 
-
-
       gtk_widget_show_all (vpane);
 
     }
@@ -396,7 +401,58 @@
   GtkWidget *bmbl;
 
   menu = gtk_menu_new ();
-  menuitem = gtk_menu_item_new_with_label (_ ("Transfer"));
+
+  menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_OPEN, _ ("Open"));
+  gtk_signal_connect (GTK_OBJECT (menuitem),
+		      "activate",
+		      (GtkSignalFunc)open_message_cb,
+		      (gpointer) bindex);
+  gtk_menu_append (GTK_MENU(menu), menuitem);
+  gtk_widget_show(menuitem);
+
+  menuitem = gnome_stock_menu_item (GNOME_STOCK_MENU_PRINT, _ ("Print"));
+  gtk_signal_connect (GTK_OBJECT (menuitem),
+		      "activate",     
+		      (GtkSignalFunc) print_current_message_cb,
+		      bindex);
+  gtk_menu_append (GTK_MENU (menu), menuitem);
+  gtk_widget_show (menuitem);
+
+  menuitem = gtk_menu_item_new();
+  gtk_menu_item_configure(menuitem, GNOME_APP_UI_SEPARATOR, 0);
+  gtk_menu_append (GTK_MENU(menu), menuitem);
+  gtk_widget_show(menuitem);
+
+  menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_MAIL_RPL, _ ("Reply"));
+  gtk_signal_connect (GTK_OBJECT (menuitem),
+		      "activate",
+		      (GtkSignalFunc) replyto_message_cb,
+		      bindex);
+  gtk_menu_append (GTK_MENU(menu), menuitem);
+  gtk_widget_show(menuitem);
+
+  menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_MAIL_RPL, _ ("Reply to all"));
+  gtk_signal_connect (GTK_OBJECT (menuitem),
+		      "activate",
+		      (GtkSignalFunc) replytoall_message_cb,
+		      bindex);
+  gtk_menu_append (GTK_MENU(menu), menuitem);
+  gtk_widget_show(menuitem);
+
+  menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_MAIL_FWD, _ ("Forward"));
+  gtk_signal_connect (GTK_OBJECT (menuitem),
+		      "activate",
+		      (GtkSignalFunc) forward_message_cb,
+		      bindex);
+  gtk_menu_append (GTK_MENU(menu), menuitem);
+  gtk_widget_show(menuitem);
+
+  menuitem = gtk_menu_item_new();
+  gtk_menu_item_configure(menuitem, GNOME_APP_UI_SEPARATOR, 0);
+  gtk_menu_append (GTK_MENU(menu), menuitem);
+  gtk_widget_show(menuitem);
+
+  menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_BLANK, _ ("Transfer"));
 
   submenu = gtk_menu_new ();
   smenuitem = gtk_menu_item_new ();
@@ -446,6 +502,12 @@
   gtk_widget_show (menuitem);
 
 #endif
+
+  menuitem = gtk_menu_item_new();
+  gtk_menu_item_configure(menuitem, GNOME_APP_UI_SEPARATOR, 0);
+  gtk_menu_append (GTK_MENU(menu), menuitem);
+  gtk_widget_show(menuitem);
+
   menuitem = gnome_stock_menu_item (GNOME_STOCK_MENU_TRASH, _ ("Delete"));
   gtk_signal_connect (GTK_OBJECT (menuitem),
 		      "activate",
@@ -512,6 +574,21 @@
     }
 }
 
+static void
+open_message_cb (GtkWidget * widget, BalsaIndex * bindex)
+{
+    GtkCList *clist;
+    GList *list;
+    Message *message;
+
+    g_return_if_fail (widget != NULL);
+    g_return_if_fail (bindex != NULL);
+
+    clist = GTK_CLIST (bindex);
+    list = clist->selection;
+    message = gtk_clist_get_row_data (clist, GPOINTER_TO_INT (list->data));
+    message_window_new (message);
+}
 
 static void
 delete_message_cb (GtkWidget * widget, BalsaIndex * bindex)
diff -ruN balsa/src/local-mailbox.c balsa-new/src/local-mailbox.c
--- balsa/src/local-mailbox.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/local-mailbox.c	Tue Oct 12 08:37:54 1999
@@ -98,18 +98,23 @@
     if (strcmp (path, MAILBOX_LOCAL (balsa_app.trash)->path) == 0)
       return;
 
-  if (isdir && type == MAILBOX_UNKNOWN)
+  if (isdir && (type == MAILBOX_MAILDIR || type == MAILBOX_UNKNOWN))
     {
       gchar *tmppath;
       MailboxNode *mbnode;
 
-      mbnode = mailbox_node_new (path, NULL, TRUE);
+      mailbox = mailbox_new(type);
+      mailbox->name = g_strdup(name);
+      MAILBOX_LOCAL(mailbox)->path = g_strdup(path);
+      mbnode = mailbox_node_new(path, mailbox, isdir);
+
       tmppath = g_strdup_printf ("%s/.expanded", path);
 
       if (access (tmppath, F_OK) != -1)
 	mbnode->expanded = TRUE;
       else
 	mbnode->expanded = FALSE;
+
       node = g_node_new (mbnode);
 
       g_free(tmppath);
@@ -222,7 +227,7 @@
 	{
 	  add_mailbox (d->d_name, filename, MAILBOX_UNKNOWN, 1);
 	}
-      if (mailbox_type != MAILBOX_MAILDIR)
+      if (mailbox_type == MAILBOX_MAILDIR || mailbox_type == MAILBOX_MH)
 	{
 	  dpc = opendir (filename);
 	  if (!dpc)
@@ -254,7 +259,7 @@
   struct dirent *d;
 
   /*Duplicates mailboxes!*/
-  return;
+  //return;
 
   dp = opendir (balsa_app.local_mail_directory);
   if (!dp)
diff -ruN balsa/src/mailbox-conf.c balsa-new/src/mailbox-conf.c
--- balsa/src/mailbox-conf.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/mailbox-conf.c	Sat Oct  9 03:54:46 1999
@@ -41,6 +41,7 @@
     MC_PAGE_LOCAL,
     MC_PAGE_POP3,
     MC_PAGE_IMAP,
+    MC_PAGE_FOLDER,
   }
 MailboxConfPageType;
 
@@ -60,7 +61,7 @@
 
     MailboxConfPageType next_page;
 
-    /* for local mailboxes */
+    /* for local mailboxes and folders*/
     GtkWidget *local_mailbox_name;
     GtkWidget *local_mailbox_path;
 
@@ -97,7 +98,7 @@
 static GtkWidget *create_local_mailbox_page (void);
 static GtkWidget *create_pop_mailbox_page (void);
 static GtkWidget *create_imap_mailbox_page (void);
-
+static GtkWidget *create_folder_page(void);
 
 void mailbox_conf_edit_imap_server (GtkWidget * widget, gpointer data);
 
@@ -270,6 +271,10 @@
 			    create_imap_mailbox_page (),
 			    NULL);
 
+  gtk_notebook_append_page (GTK_NOTEBOOK (mcw->notebook),
+			    create_folder_page(),
+			    NULL);
+
   /* close button (bottom dialog) */
   bbox = GNOME_DIALOG (mcw->window)->action_area;
   gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
@@ -320,6 +325,9 @@
     switch (type)
       {
       case MAILBOX_MAILDIR:
+	  gtk_notebook_set_page (GTK_NOTEBOOK (mcw->notebook), MC_PAGE_FOLDER);
+	  break;
+
       case MAILBOX_MBOX:
       case MAILBOX_MH:
 	gtk_notebook_set_page (GTK_NOTEBOOK (mcw->notebook), MC_PAGE_LOCAL);
@@ -348,6 +356,14 @@
     {
     case MAILBOX_MH:
     case MAILBOX_MAILDIR:
+	gtk_notebook_set_page(GTK_NOTEBOOK (mcw->notebook), MC_PAGE_FOLDER);
+	if (mailbox)
+	{
+	  gtk_entry_set_text (GTK_ENTRY (mcw->local_mailbox_name), mailbox->name);
+	  gtk_entry_set_text (GTK_ENTRY (mcw->local_mailbox_path), MAILBOX_LOCAL (mailbox)->path);
+	}
+	break;
+
     case MAILBOX_MBOX:
       gtk_notebook_set_page (GTK_NOTEBOOK (mcw->notebook), MC_PAGE_LOCAL);
       if (mailbox)
@@ -508,8 +524,9 @@
   
   switch (mailbox->type)
     {
-    case MAILBOX_MH:
     case MAILBOX_MAILDIR:
+	break;
+    case MAILBOX_MH:
     case MAILBOX_MBOX:
       {
 	gchar *filename;
@@ -671,6 +688,57 @@
       add_mailboxes_for_checking (mailbox);
       break;
 
+    case MC_PAGE_FOLDER:
+	{
+	    gchar *pathname = gtk_entry_get_text (GTK_ENTRY ((mcw->local_mailbox_path)));
+	    gchar *filename = gtk_entry_get_text (GTK_ENTRY ((mcw->local_mailbox_name)));
+	    gchar *longname;
+	    longname = g_malloc(strlen(pathname) + strlen(filename) + 10);
+	    if (pathname[strlen(pathname)] == '/')
+		sprintf(longname,"%s%s",pathname,filename);
+	    else
+		sprintf(longname,"%s%c%s",pathname,'/',filename);
+		
+	    type = mailbox_valid (longname);
+	    if (type == MAILBOX_MAILDIR) {
+		GtkWidget *msgbox;
+		gchar *ptr;
+		ptr = g_strdup_printf (_("Folder already exist !\n"));
+		msgbox = gnome_message_box_new (ptr, GNOME_MESSAGE_BOX_ERROR, _("Cancel"), NULL);
+		free (ptr);
+		gtk_window_set_modal (GTK_WINDOW (msgbox), TRUE);
+		gnome_dialog_run (GNOME_DIALOG (msgbox));
+		return NULL;
+
+	    }
+
+            {
+	    int fd = mkdir (longname, S_IRUSR | S_IWUSR| S_IXUSR);
+
+	    if (fd < 0) {
+		GtkWidget *msgbox;
+		gchar *ptr;
+		ptr = g_strdup_printf (_("Cannot create folder '%s': %s\n"), filename, strerror (errno));
+		msgbox = gnome_message_box_new (ptr, GNOME_MESSAGE_BOX_ERROR, _("Cancel"), NULL);
+		free (ptr);
+		gtk_window_set_modal (GTK_WINDOW (msgbox), TRUE);
+		gnome_dialog_run (GNOME_DIALOG (msgbox));
+		return NULL;
+	      }
+	    close (fd);
+	    }
+
+	    mailbox = mailbox_new (MAILBOX_MAILDIR);
+	
+	    mailbox->name = g_strdup (gtk_entry_get_text (GTK_ENTRY (mcw->local_mailbox_name)));
+	    MAILBOX_LOCAL (mailbox)->path = g_strdup (longname);
+	    node = g_node_new (mailbox_node_new (mailbox->name, mailbox,
+						 TRUE));
+	    g_node_append (balsa_app.mailbox_nodes, node);
+
+	}
+
+	break;
 
 /* IMAP Mailboxes */
     case MC_PAGE_IMAP:
@@ -710,6 +778,7 @@
       break;
     }
 
+
   return mailbox;
 }
 
@@ -812,6 +881,13 @@
   gtk_signal_connect (GTK_OBJECT (radio_button), "clicked", GTK_SIGNAL_FUNC (set_next_page), (gpointer) MC_PAGE_IMAP);
   gtk_widget_show (radio_button);
 
+  /* New Folder */
+  radio_button = gtk_radio_button_new_with_label
+      (gtk_radio_button_group(GTK_RADIO_BUTTON (radio_button)), _("Folder"));
+  gtk_box_pack_start(GTK_BOX(vbox), radio_button, FALSE, FALSE, 0);
+  gtk_signal_connect (GTK_OBJECT (radio_button), "clicked", GTK_SIGNAL_FUNC (set_next_page), (gpointer) MC_PAGE_FOLDER);
+  gtk_widget_show(radio_button);
+
   return vbox;
 }
 
@@ -854,6 +930,43 @@
 }
 
 static GtkWidget *
+create_folder_page (void)
+{
+  GtkWidget *vbox;
+  GtkWidget *label;
+  GtkWidget *table;
+  GtkWidget *file;
+
+  vbox = gtk_vbox_new (FALSE, 0);
+
+  table = gtk_table_new (2, 2, FALSE);
+  gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 5);
+
+  /* mailbox name */
+  label = gtk_label_new (_("Folder Name:"));
+  gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
+		    GTK_FILL, GTK_FILL, 10, 10);
+
+  mcw->local_mailbox_name = gtk_entry_new ();
+  gtk_table_attach (GTK_TABLE (table), mcw->local_mailbox_name, 1, 2, 0, 1,
+		    GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 10);
+
+  /* path to file */
+  label = gtk_label_new (_("Folder path:"));
+  gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
+		    GTK_FILL, GTK_FILL, 10, 10);
+
+  file = gnome_file_entry_new ("Folder Path", "Folder Path");
+  mcw->local_mailbox_path = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (file));
+  gtk_table_attach (GTK_TABLE (table), file, 1, 2, 1, 2,
+		    GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 10);
+
+  return vbox;
+}
+
+static GtkWidget *
 create_pop_mailbox_page (void)
 {
   GtkWidget *return_widget;
@@ -1077,6 +1190,10 @@
     case MC_PAGE_LOCAL:
       gtk_notebook_set_page (GTK_NOTEBOOK (mcw->notebook), MC_PAGE_LOCAL);
       break;
+ 
+   case MC_PAGE_FOLDER:
+	gtk_notebook_set_page(GTK_NOTEBOOK(mcw->notebook), MC_PAGE_FOLDER);
+	break;
 
     case MC_PAGE_POP3:
       set_next_page (NULL, MC_PAGE_POP3);
diff -ruN balsa/src/main-window.c balsa-new/src/main-window.c
--- balsa/src/main-window.c	Sat Oct  9 02:46:34 1999
+++ balsa-new/src/main-window.c	Tue Oct 12 22:47:28 1999
@@ -41,6 +41,7 @@
 #include "mailbox-conf.h"
 #include "mblist-window.h"
 #include "threads.h"
+#include "mime.h"
 #define MAILBOX_DATA "mailbox_data"
 
 #define APPBAR_KEY "balsa_appbar"
@@ -63,10 +64,12 @@
 static void check_new_messages_cb (GtkWidget *, gpointer data);
 gint progress_window_change_cb (GtkWidget * widget, gpointer data);
 
+void print_current_message_cb (GtkWidget * widget, gpointer data);
+
 static void new_message_cb (GtkWidget * widget, gpointer data);
-static void replyto_message_cb (GtkWidget * widget, gpointer data);
-static void replytoall_message_cb (GtkWidget * widget, gpointer data);
-static void forward_message_cb (GtkWidget * widget, gpointer data);
+void replyto_message_cb (GtkWidget * widget, gpointer data);
+void replytoall_message_cb (GtkWidget * widget, gpointer data);
+void forward_message_cb (GtkWidget * widget, gpointer data);
 static void continue_message_cb (GtkWidget * widget, gpointer data);
 
 static void next_message_cb (GtkWidget * widget, gpointer data);
@@ -97,8 +100,13 @@
  GNOME_STOCK_MENU_MAIL_RCV, 'M', GDK_CONTROL_MASK, NULL
   },
 
-
   GNOMEUIINFO_SEPARATOR,
+  /* Ctrl-I */
+  {
+    GNOME_APP_UI_ITEM, N_ ("Pr_int"), N_("Print current mail"),
+    print_current_message_cb, NULL, NULL, GNOME_APP_PIXMAP_STOCK,
+    GNOME_STOCK_MENU_MAIL_RCV, 'I', GDK_CONTROL_MASK, NULL
+  },
 
   GNOMEUIINFO_MENU_EXIT_ITEM(close_main_window, NULL), 
 
@@ -259,10 +267,11 @@
     next_message_cb, NULL, NULL, GNOME_APP_PIXMAP_STOCK,
     GNOME_STOCK_PIXMAP_FORWARD, 'N', 0, NULL
   },
-#ifdef BALSA_SHOW_ALL
+
   GNOMEUIINFO_SEPARATOR,
-  GNOMEUIINFO_ITEM_STOCK (N_ ("Print"), N_ ("Print current message"), NULL, GNOME_STOCK_PIXMAP_PRINT),
-#endif
+  GNOMEUIINFO_ITEM_STOCK (N_ ("Print"), N_ ("Print current message"), 
+			  print_current_message_cb, GNOME_STOCK_PIXMAP_PRINT),
+
   GNOMEUIINFO_END
 };
 
@@ -402,6 +411,10 @@
 
   mblist_open_window (mdi);
 
+  /* added default opening of inbox folder */
+  /* must be a config parameter */
+  mblist_open_mailbox(balsa_app.inbox);
+
   refresh_main_window ();
 
 }
@@ -478,6 +491,80 @@
  * Callbacks
  */
 
+void print_current_message_cb(GtkWidget *widget, gpointer data)
+{
+  GtkCList *clist;
+  GList *list;
+  Message *message;
+  Address *addr = NULL;
+  gchar *tmp;
+  GString *printtext = g_string_new ("\n\n");
+  FILE * fp;
+  gchar tmp_file_name[PATH_MAX + 1];
+  gchar *print_command = NULL;
+
+
+  g_return_if_fail (widget != NULL);
+
+  if (!balsa_app.current_index_child)
+    return;
+
+  clist = GTK_CLIST (balsa_app.current_index_child->index);
+  list = clist->selection;
+  while (list)
+    {
+      sprintf(tmp_file_name,"%s/balsa-print", g_get_home_dir());
+      fp = fopen(tmp_file_name,"wra+");
+      message = gtk_clist_get_row_data (clist, GPOINTER_TO_INT (list->data));
+      addr = message->from    ;
+      tmp = address_to_gchar (addr);
+      fprintf(fp, "\n\n");
+      fprintf(fp, "From:    \t%s\n", tmp);
+      fprintf(fp, "Sendt:   \t%s\n", message->date);
+      tmp = make_string_from_list (message->to_list);
+      fprintf(fp, "To:      \t%s\n", tmp);
+      fprintf(fp, "Subject: \t%s\n", message->subject);
+      fprintf(fp, "\n");
+
+      message_body_ref (message);
+      printtext = content2reply (message, NULL);
+      if (balsa_app.PrintCommand.breakline == TRUE) {
+	  int i = 0 , j = 0;
+	  while (i <= balsa_app.PrintCommand.linesize && printtext->str[j++] != '\0') {
+	      if ( printtext->str[j] == '\n') {
+		  printf("\n");
+		  fprintf(fp, "\n");
+		  i = 0;
+		  continue;
+	      }
+	      if ( i ==  balsa_app.PrintCommand.linesize && printtext->str[j] != '\0') {
+		  i = 0;
+		  fprintf(fp, "\n");
+	      }
+	      fprintf(fp, "%c", printtext->str[j]);
+	      i++;
+	  }
+      }
+      else
+	  fprintf(fp, "%s\n",printtext->str);
+
+      message_body_unref (message);
+
+      fflush(fp);
+      fclose (fp);
+
+      print_command = g_strdup_printf("%s %s", balsa_app.PrintCommand.PrintCommand, tmp_file_name);
+      if(print_command) {
+	  gnome_execute_shell(NULL, print_command);
+	  g_free(print_command);
+      }
+      /* uses sleep here so gnome_execute_shell reaches the file before itæ's removed */
+      sleep(1);
+      unlink(tmp_file_name);
+      list = list->next;
+    }
+}
+
 static void
 check_new_messages_cb (GtkWidget * widget, gpointer data)
 {
@@ -485,6 +572,7 @@
    pthread_mutex_lock( &mailbox_lock );
    if( checking_mail )
    {
+       printf("allerede\n");
      pthread_mutex_unlock( &mailbox_lock );
      return;
    }
@@ -493,15 +581,15 @@
 /*  create progress dialog:
  *  see function check_all_show_progress below  -- David
  */
-  progress_window = gnome_dialog_new("Checking Mail...", GNOME_STOCK_BUTTON_OK, NULL);
-  gnome_dialog_set_close(GNOME_DIALOG( progress_window ), TRUE);
-
-  g_free( current_dialog_message );
-  current_dialog_message = g_strdup( "Checking Mail....");
-  progress_text = gtk_label_new( current_dialog_message );
-  pthread_mutex_unlock( &mailbox_lock );
+       progress_window = gnome_dialog_new("Checking Mail...", GNOME_STOCK_BUTTON_OK, NULL);
+       gnome_dialog_set_close(GNOME_DIALOG( progress_window ), TRUE);
+   
+       g_free( current_dialog_message );
+       current_dialog_message = g_strdup( "Checking Mail....");
+       progress_text = gtk_label_new( current_dialog_message );
+       pthread_mutex_unlock( &mailbox_lock );
 
-  gtk_signal_connect( GTK_OBJECT(progress_text),
+       gtk_signal_connect( GTK_OBJECT(progress_text),
   						"event",
   						GTK_SIGNAL_FUNC( progress_window_change_cb),
   						NULL );
@@ -519,7 +607,7 @@
   					NULL,
   					(void *) &check_messages_thread,
   					(void *) NULL );
-
+  
 }
 
 void
@@ -575,7 +663,7 @@
 }
 
 
-static void
+void
 replyto_message_cb (GtkWidget * widget, gpointer data)
 {
   GtkCList *clist;
@@ -597,7 +685,7 @@
     }
 }
 
-static void
+void
 replytoall_message_cb (GtkWidget * widget, gpointer data)
 {
   GtkCList *clist;
@@ -620,7 +708,7 @@
 }
 
 
-static void
+void
 forward_message_cb (GtkWidget * widget, gpointer data)
 {
   GtkCList *clist;
@@ -744,6 +832,7 @@
 static void
 mblist_window_cb (GtkWidget * widget, gpointer data)
 {
+
   mblist_open_window (mdi);
 }
 
diff -ruN balsa/src/main-window.h balsa-new/src/main-window.h
--- balsa/src/main-window.h	Sat Oct  9 02:46:34 1999
+++ balsa-new/src/main-window.h	Tue Oct 12 16:02:36 1999
@@ -29,5 +29,8 @@
 void main_window_set_cursor (gint type);
 void mblist_close_mailbox (Mailbox * mailbox);
 void check_messages_thread( void );
-
+void print_current_message_cb(GtkWidget *widget, gpointer data);
+void replyto_message_cb (GtkWidget * widget, gpointer data);
+void replytoall_message_cb (GtkWidget * widget, gpointer data);
+void forward_message_cb (GtkWidget * widget, gpointer data);
 #endif /* __main_window_h__ */
diff -ruN balsa/src/mblist-window.c balsa-new/src/mblist-window.c
--- balsa/src/mblist-window.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/mblist-window.c	Tue Oct 12 16:18:56 1999
@@ -241,11 +241,11 @@
       
       
       if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
-	
 	{
 	  /* double click with button left */
-	  
-	  mblist_open_mailbox (mailbox);  
+	  if (mailbox->type != MAILBOX_MAILDIR) {
+	      mblist_open_mailbox (mailbox);  
+	  }
 	  return TRUE;
 	}
      
@@ -291,13 +291,15 @@
 static void
 mb_open_cb (GtkWidget * widget, Mailbox * mailbox)
 {
-  mblist_open_mailbox (mailbox);
+    if (mailbox->type != MAILBOX_MAILDIR)
+	mblist_open_mailbox (mailbox);
 }
 
 static void
 mb_close_cb (GtkWidget * widget, Mailbox * mailbox)
 {
-  mblist_close_mailbox (mailbox);
+    if (mailbox->type != MAILBOX_MAILDIR)
+	mblist_close_mailbox (mailbox);
 }
 
 static void
@@ -340,36 +342,56 @@
 
   menu = gtk_menu_new ();
 
+  menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_NEW, _ ("New..."));
+  gtk_signal_connect (GTK_OBJECT (menuitem),
+		      "activate",
+		      GTK_SIGNAL_FUNC (mb_add_cb),
+		      mailbox);
+  gtk_menu_append (GTK_MENU(menu), menuitem);
+  gtk_widget_show(menuitem);
+
   if (mailbox)
     {
-      menuitem = gtk_menu_item_new_with_label (_ ("Open Mailbox"));
-      gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
-			  GTK_SIGNAL_FUNC (mb_open_cb), mailbox);
-      gtk_menu_append (GTK_MENU (menu), menuitem);
-      gtk_widget_show (menuitem);
-     
-      menuitem = gtk_menu_item_new_with_label (_ ("Close Mailbox"));
-      gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
-			  GTK_SIGNAL_FUNC (mb_close_cb), mailbox);
-      gtk_menu_append (GTK_MENU (menu), menuitem);
-      gtk_widget_show (menuitem);
+	
+	if (mailbox->type != MAILBOX_MAILDIR) {
+	    menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_OPEN, _ ("Open Mailbox"));
+	    gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
+				GTK_SIGNAL_FUNC (mb_open_cb), mailbox);
+	    gtk_menu_append (GTK_MENU (menu), menuitem);
+	    gtk_widget_show (menuitem);
+	}
+
+	if (mailbox->type != MAILBOX_MAILDIR) {
+	    menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_CLOSE, _ ("Close Mailbox"));
+	    gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
+				GTK_SIGNAL_FUNC (mb_close_cb), mailbox);
+	    gtk_menu_append (GTK_MENU (menu), menuitem);
+	    gtk_widget_show (menuitem);
+	}
     }
   
-  menuitem = gtk_menu_item_new_with_label (_ ("Add New Mailbox"));
-  gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
-		      GTK_SIGNAL_FUNC (mb_add_cb), mailbox);
-  gtk_menu_append (GTK_MENU (menu), menuitem);
-  gtk_widget_show (menuitem);
+  menuitem = gtk_menu_item_new();
+  gtk_menu_item_configure(menuitem, GNOME_APP_UI_SEPARATOR, 0);
+  gtk_menu_append (GTK_MENU(menu), menuitem);
+  gtk_widget_show(menuitem);
   
   if (mailbox)
     {
-      menuitem = gtk_menu_item_new_with_label (_ ("Edit Mailbox Properties"));
+	if (mailbox->type == MAILBOX_MAILDIR)
+	    menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_PROP, _ ("Folder Properties"));
+	else
+	    menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_PROP, _ ("Mailbox Properties"));
+
       gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
 			  GTK_SIGNAL_FUNC (mb_conf_cb), mailbox);
       gtk_menu_append (GTK_MENU (menu), menuitem);
       gtk_widget_show (menuitem);
       
-      menuitem = gtk_menu_item_new_with_label (_ ("Delete Mailbox"));
+      if (mailbox->type == MAILBOX_MAILDIR)
+	  menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_TRASH, _ ("Delete Folder"));
+      else
+	  menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_TRASH, _ ("Delete Mailbox"));
+
       gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
 			  GTK_SIGNAL_FUNC (mb_del_cb), mailbox);
       gtk_menu_append (GTK_MENU (menu), menuitem);
@@ -434,7 +456,8 @@
       gnome_dialog_run (GNOME_DIALOG (err_dialog));
       return;
     }
-  mblist_open_mailbox (mailbox);
+  if (mailbox->type != MAILBOX_MAILDIR)
+      mblist_open_mailbox (mailbox);
 }
 
 
@@ -449,7 +472,8 @@
       gnome_dialog_run (GNOME_DIALOG (err_dialog));
       return;
     }
-  mblist_close_mailbox (mailbox);
+  if (mailbox->type != MAILBOX_MAILDIR)
+      mblist_close_mailbox (mailbox);
 }
 
 
diff -ruN balsa/src/message-window.c balsa-new/src/message-window.c
--- balsa/src/message-window.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/message-window.c	Tue Oct 12 15:45:17 1999
@@ -42,6 +42,8 @@
 
 static GnomeUIInfo file_menu[] =
 {
+  GNOMEUIINFO_MENU_PRINT_ITEM(print_current_message_cb, NULL),
+  GNOMEUIINFO_SEPARATOR,
   GNOMEUIINFO_MENU_CLOSE_ITEM(close_message_window, NULL),
 
   GNOMEUIINFO_END
diff -ruN balsa/src/pref-manager.c balsa-new/src/pref-manager.c
--- balsa/src/pref-manager.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/pref-manager.c	Tue Oct 12 15:42:00 1999
@@ -43,6 +43,7 @@
 
     GtkWidget *previewpane;
     GtkWidget *debug;		/* enable/disable debugging */
+    GtkWidget *checkbox;
 
 #ifdef BALSA_SHOW_INFO
     GtkWidget *mblist_show_mb_content_info;
@@ -56,7 +57,11 @@
       /* charset */
     GtkRadioButton *encoding_type[NUM_ENCODING_MODES];
     GtkWidget *charset;
-
+    
+      /* printing */
+    GtkWidget *PrintCommand;
+    GtkWidget *PrintBreakline;
+    GtkWidget *PrintLinesize;
 
   }
 PropertyUI;
@@ -100,7 +105,7 @@
 static GtkWidget *create_display_page (void);
 static GtkWidget *create_misc_page (void);
 static GtkWidget *create_encoding_page (void);
-
+static GtkWidget *create_printing_page (void);
 
 /* save the settings */
 static void apply_prefs (GnomePropertyBox * pbox, gint page, PropertyUI * pui);
@@ -189,12 +194,18 @@
 			     create_misc_page (),
 			     label);
 
-  /* Misc page */
+  /* Encoding page */
   label = gtk_label_new (_ ("Encoding"));
   gtk_notebook_append_page (
 		    GTK_NOTEBOOK (GNOME_PROPERTY_BOX (pui->pbox)->notebook),
 			     create_encoding_page (),
 			     label);
+  /* Printing page */
+  label = gtk_label_new (_ ("Printing"));
+  gtk_notebook_append_page(
+		    GTK_NOTEBOOK (GNOME_PROPERTY_BOX (pui->pbox)->notebook),
+		             create_printing_page (),
+		             label);
   set_prefs ();
   for (i = 0; i < NUM_TOOLBAR_MODES; i++)
     {
@@ -204,6 +215,8 @@
 
   gtk_signal_connect (GTK_OBJECT (pui->previewpane), "toggled",
 		      GTK_SIGNAL_FUNC (properties_modified_cb), pui->pbox);
+  gtk_signal_connect (GTK_OBJECT (pui->checkbox), "toggled",
+		      GTK_SIGNAL_FUNC (properties_modified_cb), pui->pbox);
   gtk_signal_connect (GTK_OBJECT (pui->debug), "toggled",
 		      GTK_SIGNAL_FUNC (properties_modified_cb), pui->pbox);
 #ifdef BALSA_SHOW_INFO
@@ -251,6 +264,17 @@
 			  properties_modified_cb, pui->pbox);
     }
 
+  /* printing */
+  gtk_signal_connect (GTK_OBJECT (pui->PrintCommand), "changed",
+		      GTK_SIGNAL_FUNC (properties_modified_cb),
+		      pui->pbox);
+  gtk_signal_connect (GTK_OBJECT (pui->PrintBreakline), "toggled",
+		      GTK_SIGNAL_FUNC (properties_modified_cb),
+		      pui->pbox);
+  gtk_signal_connect (GTK_OBJECT (pui->PrintLinesize), "changed",
+  		      GTK_SIGNAL_FUNC (properties_modified_cb),
+  		      pui->pbox);
+
 
   /* set data and show the whole thing */
   gtk_widget_show_all (GTK_WIDGET (pui->pbox));
@@ -305,6 +329,7 @@
 	break;
       }
   balsa_app.debug = GTK_TOGGLE_BUTTON (pui->debug)->active;
+  balsa_app.checkbox = GTK_TOGGLE_BUTTON(pui->checkbox)->active;
   balsa_app.previewpane = GTK_TOGGLE_BUTTON (pui->previewpane)->active;
 #ifdef BALSA_SHOW_INFO
   if (balsa_app.mblist_show_mb_content_info != GTK_TOGGLE_BUTTON (pui->mblist_show_mb_content_info)->active)
@@ -336,6 +361,14 @@
 	break;
       }
 
+  /* printing */
+  g_free (balsa_app.PrintCommand.PrintCommand);
+  balsa_app.PrintCommand.PrintCommand =
+      g_strdup( gtk_entry_get_text(GTK_ENTRY (pui->PrintCommand)));
+
+  balsa_app.PrintCommand.linesize = atoi(gtk_entry_get_text(GTK_ENTRY( pui->PrintLinesize)));
+  balsa_app.PrintCommand.breakline =  GTK_TOGGLE_BUTTON(pui->PrintBreakline)->active;
+
   refresh_main_window ();
 
   /*
@@ -352,6 +385,7 @@
 set_prefs (void)
 {
   gint i;
+  gchar tmp[10];
 
   for (i = 0; i < NUM_TOOLBAR_MODES; i++)
     if (balsa_app.toolbar_style == toolbar_type[i])
@@ -372,6 +406,7 @@
 
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pui->previewpane), balsa_app.previewpane);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pui->debug), balsa_app.debug);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pui->checkbox), balsa_app.checkbox);
 #ifdef BALSA_SHOW_INFO
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pui->mblist_show_mb_content_info), balsa_app.mblist_show_mb_content_info);
 #endif
@@ -391,6 +426,11 @@
 	break;
       }
 
+  /*printing */
+  gtk_entry_set_text(GTK_ENTRY(pui->PrintCommand), balsa_app.PrintCommand.PrintCommand);
+  sprintf(tmp, "%d", balsa_app.PrintCommand.linesize);
+  gtk_entry_set_text(GTK_ENTRY(pui->PrintLinesize), tmp);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pui->PrintBreakline), balsa_app.PrintCommand.breakline);
 
 }
 
@@ -689,7 +729,9 @@
   pui->debug = gtk_check_button_new_with_label (_("Debug"));
   gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (pui->debug), TRUE, TRUE, 2);
 
-
+  pui->checkbox = gtk_check_button_new_with_label(_("Show check box"));
+  gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (pui->checkbox), TRUE, TRUE, 2);
+ 
   /* arp --- table containing leadin label and string. */
   table = gtk_table_new (1, 2, FALSE);
 
@@ -789,6 +831,66 @@
       group = gtk_radio_button_group (pui->encoding_type[i]);
     }
 
+
+  return vbox;
+
+}
+
+/*
+ * printing notepad
+ */
+static GtkWidget *
+create_printing_page ()
+{
+   
+  GtkWidget *vbox;
+  GtkWidget *frame;
+
+  /* arp */
+  GtkWidget *vbox1;
+  GtkWidget *table;
+  GtkWidget *label;
+
+  vbox = gtk_vbox_new (FALSE, 5);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
+
+  frame = gtk_frame_new (_("Printing"));
+  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 5);
+
+  vbox1 = gtk_vbox_new (FALSE, 0);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5);
+  gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (vbox1));
+
+  
+  table = gtk_table_new (1, 2, FALSE);
+
+  label = gtk_label_new (_("Print command:"));
+  gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
+		    GTK_FILL, GTK_FILL, 10, 10);
+
+   pui->PrintCommand = gtk_entry_new ();
+   gtk_table_attach (GTK_TABLE (table), pui->PrintCommand, 1, 2, 0, 1,
+		    GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 10);
+
+   //gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (table), TRUE, TRUE, 2);
+
+  label = gtk_label_new (_ ("Linesize:"));
+  gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
+		    GTK_FILL, GTK_FILL, 10, 10);
+
+  pui->PrintLinesize = gtk_entry_new ();
+  gtk_table_attach (GTK_TABLE (table), pui->PrintLinesize, 1, 2, 1, 2,
+		    GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 10);
+
+
+   gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (table), TRUE, TRUE, 2);
+
+   pui->PrintBreakline = gtk_check_button_new_with_label(_("Break line"));
+   gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (pui->PrintBreakline), TRUE, TRUE, 2);
+ 
+   gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (table), TRUE, TRUE, 2);
 
   return vbox;
 
diff -ruN balsa/src/save-restore.c balsa-new/src/save-restore.c
--- balsa/src/save-restore.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/save-restore.c	Tue Oct 12 20:24:41 1999
@@ -233,6 +233,7 @@
     safe_get_dstring( "reply_leading=> ", &( balsa_app.quote_str ), &okay );
     safe_get_dstring( "msg_font=" DEFAULT_MESSAGE_FONT, &( balsa_app.message_font ), &okay );
     safe_get_dstring( "charset=" DEFAULT_CHARSET, &( balsa_app.charset ), &okay );
+    mutt_set_charset(balsa_app.charset);
     get_dint( "encoding", 2, &( balsa_app.encoding_style ), &okay );
     get_dint( "toolbar_style", GTK_TOOLBAR_BOTH, (gint *) &( balsa_app.toolbar_style ), &okay );
     get_dint( "use_preview_pane", TRUE, &( balsa_app.previewpane ), &okay );
@@ -240,6 +241,7 @@
     get_dint( "show_content_info", TRUE, &( balsa_app.mblist_show_mb_content_info ), &okay );
 #endif
     get_dint( "use_debug", FALSE, &( balsa_app.debug ), &okay );
+    get_dint( "check_box", TRUE, &( balsa_app.checkbox ), &okay);
     get_dint( "main_width", 640, &( balsa_app.mw_width ), &okay );
     get_dint( "main_height", 480, &( balsa_app.mw_height ), &okay );
     get_dint( "mblist_width", 100, &( balsa_app.mblist_width ), &okay );
@@ -274,12 +276,32 @@
     gnome_config_set_int( "show_content_info", balsa_app.mblist_show_mb_content_info );
 #endif
     gnome_config_set_int( "use_debug", balsa_app.debug );
+    gnome_config_set_int( "check_box", balsa_app.checkbox );
     gnome_config_set_int( "main_width", balsa_app.mw_width );
     gnome_config_set_int( "main_height", balsa_app.mw_height );
     gnome_config_set_int( "mblist_width", balsa_app.mblist_width );
     gnome_config_set_int( "mblist_width", balsa_app.mblist_height );
 }
 
+static gboolean load_printing( void )
+{
+    gboolean okay = TRUE;
+    int ii;
+ 
+    safe_get_dstring( "command=a2ps -d -q", &( balsa_app.PrintCommand.PrintCommand ), &okay);
+    get_dint("breakline", FALSE, &( balsa_app.PrintCommand.breakline), &okay);
+    get_dint("linesize", 78, &( balsa_app.PrintCommand.linesize), &okay);
+ 
+    return okay;
+}
+/**/
+static gboolean save_printing( void )
+{
+    gnome_config_set_string("command", balsa_app.PrintCommand.PrintCommand);
+    gnome_config_set_int("breakline", balsa_app.PrintCommand.breakline);
+    gnome_config_set_int("linesize", balsa_app.PrintCommand.linesize);
+}
+
 /****************************************************************************/
 
 static gboolean load_mbox( void )
@@ -331,6 +353,7 @@
     safe_get_string( "username", &( (MAILBOX_POP3( mb ))->user ), &okay );
     safe_get_pstring( "password", &( (MAILBOX_POP3( mb ))->passwd ), &okay );
     safe_get_string( "server", &( (MAILBOX_POP3( mb ))->server ), &okay );
+    safe_get_string( "lastuid", &( (MAILBOX_POP3( mb ))->last_popped_uid), &okay );
     get_dint( "check", 0, &( (MAILBOX_POP3( mb ))->check ), &okay );
     get_dint( "delete_from_server", 0, &( (MAILBOX_POP3( mb ))->delete_from_server ), &okay );
     
@@ -355,6 +378,7 @@
     gnome_config_set_string( "name", mbox->name );
     gnome_config_set_string( "username", mp->user );
     gnome_config_private_set_string( "password", mp->passwd );
+    gnome_config_set_string( "lastuid", mp->last_popped_uid );
     set_magic_box( mbox );
 }
 
@@ -425,6 +449,8 @@
 	    load_imap();
 	} else if( strncmp( key, "pop3 ", 5 ) == 0 ) {
 	    load_pop3();
+	} else if( strcmp( key, "Printing") == 0) {
+	    load_printing();
 	} else if( strncmp( key, "Placement", 9 ) == 0 ) {
 	    /*Skip stuff we don't want*/
 	} else if( strncmp( key, "History:", 8 ) == 0 ) {
@@ -445,6 +471,14 @@
 	load_user_prefs();
 	done_prefs = TRUE;
     }
+
+
+    /*Printing*/
+    combined = g_strconcat( filename, "Printing/", NULL);
+    gnome_config_push_prefix( combined );
+    g_free(combined);
+    load_printing();
+    
 }
 
 static gboolean save_mailbox( Mailbox *box )
@@ -508,6 +542,13 @@
     gnome_config_push_prefix( combined );
     g_free( combined );
     save_user_prefs();
+    gnome_config_pop_prefix();    
+
+    /* Printing */
+    combined = g_strconcat( filename, "Printing/", NULL );
+    gnome_config_push_prefix( combined );
+    g_free( combined );
+    save_printing();
     gnome_config_pop_prefix();    
 
     save_mailbox( balsa_app.inbox );
diff -ruN balsa/src/sendmsg-window.c balsa-new/src/sendmsg-window.c
--- balsa/src/sendmsg-window.c	Sat Oct  9 01:19:44 1999
+++ balsa-new/src/sendmsg-window.c	Tue Oct 12 21:36:09 1999
@@ -511,7 +511,7 @@
   GtkStyle *style;
 
   style = gtk_style_new ();
-  font = gdk_font_load ("-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1");
+  font = gdk_font_load (balsa_app.message_font);
   colormap = gtk_widget_get_colormap (GTK_WIDGET (msg->attachments));
   style->font = font;
 
@@ -520,6 +520,7 @@
   msg->text = gtk_text_new (NULL, NULL);
   gtk_text_set_editable (GTK_TEXT (msg->text), TRUE);
   gtk_text_set_word_wrap (GTK_TEXT (msg->text), TRUE);
+
   gtk_widget_set_style (msg->text, style);
   gtk_widget_set_usize (msg->text, (82 * 7) + (2 * msg->text->style->klass->xthickness), -1);
   gtk_widget_show (msg->text);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]