re: initial setup problem




>My apologies if this has been answered before, but in checking the
>archives, I can't find an answer.  I'm trying to run Balsa 0.4.6.2, but
>when I run the program for the first time, it acts as if the inbox &
>outbox can't be created.  I'm at a loss, as in checking the archives,
>downloading 0.4.6.2 should have solved the problem, i.e. the program
>can't create a .balsarc file.  HELP!
>Someone had posted a patch for getting past the next button in the
>setup notebook, but in looking at the patch posted, it looks like it was
>implemented already in the balsa-init.c and I'm not sure that was
>applicable to the ceation of the mail directories required by balsa.
>
>Regards,
>Erich R. Carter


Yes, there is a problem if say.. the directory /home/user/Mail/outbox exists,
then balsa can't create a file named outbox, and there isn't really any error 
handling for this, and the user interface gets stuck in a loop.
So.. ya wanna know what ?
I fiddled with the code, and i make an informative value be returned from
mx_get_magic(..), that handles this special case.
There is still a loop with the initial screens, so maybe an exit button
somewhere would make sense ?

Harley Waagmeester
verzee on #gimp
linux@netamerica.com

The stuff is below this line.

--- libmutt/mx.h	Wed Oct 21 05:54:03 1998
+++ ../balsa-now/mx.h	Wed Oct 21 04:21:02 1998
@@ -28,7 +28,8 @@
   M_MMDF,
   M_MH,
   M_MAILDIR,
-  M_IMAP
+  M_IMAP,
+  M_DIR_TYPE_UNKNOWN
 };
 
 WHERE short DefaultMagic INITVAL (M_MBOX);
--- libmutt/mx.c	Wed Oct 21 05:35:59 1998
+++ ../balsa-now/mx.c	Wed Oct 21 04:19:07 1998
@@ -381,6 +381,7 @@
     if (mx_is_mh(path))
       return (M_MH);
 
+    return(M_DIR_TYPE_UNKNOWN);
   }
   else if (st.st_size == 0)
   {
--- libbalsa/mailbox.c	Wed Oct 21 05:35:57 1998
+++ ../balsa-now/mailbox.c	Wed Oct 21 04:52:49 1998
@@ -358,6 +362,7 @@
       g_free (MAILBOX_IMAP (mailbox)->path);
       break;
 
+    case MAILBOX_DIR_TYPE_UNKNOWN:  
     case MAILBOX_UNKNOWN:
       break;
     }
@@ -431,6 +436,7 @@
       g_string_free (tmp, TRUE);
       break;
 
+    case MAILBOX_DIR_TYPE_UNKNOWN:  
     case MAILBOX_UNKNOWN:
       break;
     }
@@ -1005,6 +1011,9 @@
       break;
     case M_IMAP:
       return MAILBOX_IMAP;
+      break;
+    case M_DIR_TYPE_UNKNOWN:
+      return MAILBOX_DIR_TYPE_UNKNOWN;
       break;
     default:
       return MAILBOX_UNKNOWN;
--- libbalsa/mailbox.h	Wed Oct 21 05:35:57 1998
+++ ../balsa-now/mailbox.h	Wed Oct 21 04:24:35 1998
@@ -40,6 +40,7 @@
     MAILBOX_MAILDIR,
     MAILBOX_POP3,
     MAILBOX_IMAP,
+    MAILBOX_DIR_TYPE_UNKNOWN,
     MAILBOX_UNKNOWN
   }
 
 
--- src/balsa-init.c	Wed Oct 21 05:36:02 1998
+++ ../balsa-now/balsa-init.c	Wed Oct 21 05:27:08 1998
@@ -407,11 +407,18 @@
   GString *str;
   gchar *mbox;
   gint clicked_button;
+  gint mbox_type;
 
   str = g_string_new (NULL);
 
   mbox = gtk_entry_get_text (GTK_ENTRY (prefs->inbox));
-  if (mailbox_valid (mbox) == MAILBOX_UNKNOWN)
+  if ((mbox_type = mailbox_valid (mbox)) == MAILBOX_DIR_TYPE_UNKNOWN)
+    {
+      g_string_sprintf (str, "\"%s\" is a directory.\nIt's contents are unknown.\n\nPlease choose another name or remove the directory.", mbox);
+      goto DIR_EXISTS;
+    }
+    
+  if (mbox_type  == MAILBOX_UNKNOWN)
     {
       g_string_sprintf (str, "Mailbox \"%s\" is not valid.\n\nWould you like to create it?", mbox);
       goto BADMAILBOX;
@@ -417,8 +424,14 @@
       goto BADMAILBOX;
     }
 
+
   mbox = gtk_entry_get_text (GTK_ENTRY (prefs->outbox));
-  if (mailbox_valid (mbox) == MAILBOX_UNKNOWN)
+  if ((mbox_type = mailbox_valid (mbox)) == MAILBOX_DIR_TYPE_UNKNOWN)
+    {
+      g_string_sprintf (str, "\"%s\" is a directory.\nIt's contents are unknown.\n\nPlease choose another name or remove the directory.", mbox);
+      goto DIR_EXISTS;
+    }
+  if (mbox_type == MAILBOX_UNKNOWN)
     {
       g_string_sprintf (str, "Mailbox \"%s\" is not valid.\n\nWould you like to create it?", mbox);
       goto BADMAILBOX;
@@ -424,8 +437,14 @@
       goto BADMAILBOX;
     }
 
+
   mbox = gtk_entry_get_text (GTK_ENTRY (prefs->trash));
-  if (mailbox_valid (mbox) == MAILBOX_UNKNOWN)
+  if ((mbox_type = mailbox_valid (mbox)) == MAILBOX_DIR_TYPE_UNKNOWN)
+    {
+      g_string_sprintf (str, "\"%s\" is a directory.\nIt's contents are unknown.\n\nPlease choose another name or remove the directory.", mbox);
+      goto DIR_EXISTS;
+    }
+  if (mbox_type == MAILBOX_UNKNOWN)
     {
       g_string_sprintf (str, "Mailbox \"%s\" is not valid.\n\nWould you like to create it?", mbox);
       goto BADMAILBOX;
@@ -459,6 +478,17 @@
 				   GNOME_STOCK_BUTTON_OK,
 				   NULL);
     }
+DIR_EXISTS:
+  ask = gnome_message_box_new (str->str,
+			       GNOME_MESSAGE_BOX_QUESTION,
+			       GNOME_STOCK_BUTTON_OK,
+			       NULL);
+  clicked_button = gnome_dialog_run (GNOME_DIALOG (ask));
+  g_string_free (str, TRUE);
+  if (clicked_button == 0)
+    {
+      return;
+    }
 }
 
 static void
--- src/mailbox-conf.c	Wed Oct 21 05:36:02 1998
+++ ../balsa-now/mailbox-conf.c	Wed Oct 21 04:50:23 1998
@@ -374,6 +376,7 @@
 	}
       gtk_notebook_set_page (GTK_NOTEBOOK (mcw->notebook), MC_PAGE_IMAP);
       break;
+    case MAILBOX_DIR_TYPE_UNKNOWN:  
     case MAILBOX_UNKNOWN:
       /* do nothing for now */
       break;
@@ -442,6 +446,7 @@
       config_mailbox_update (mailbox, old_mbox_name);
 #endif
       break;
+    case MAILBOX_DIR_TYPE_UNKNOWN:  
     case MAILBOX_UNKNOWN:
       /* Do nothing for now */
       break;



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