Re: Patch



> > Here's another patch. It includes:
> Please always send context or unified diffs, and if possible, attach
> patches as text/plain or something. context diffs are easier to apply
> when something has changed between the version you patch against and the
> version the maintainer has.
Sorry, here is a unified (cvs diff -u) diff against the latest CVS
tree. 

About GPG support: I have been wondering where the GPG settings should
go: in identities or in prefs? You might want to use GPG only
with certain identities and have different default keys for each
entry. Anyone?

Jelmer

-- 
Jelmer Vernooij <jelmer@nl.linux.org> - http://nl.linux.org/~jelmer/
Development And Underdevelopment: http://library.thinkquest.org/C0110231/
Listening to Bush - Machine Head
 19:42:01 up 23:03,  7 users,  load average: 0.13, 0.25, 0.25
Index: libbalsa/address-book-extern.c
===================================================================
RCS file: /cvs/gnome/balsa/libbalsa/address-book-extern.c,v
retrieving revision 1.2
diff -u -r1.2 address-book-extern.c
--- libbalsa/address-book-extern.c	2001/12/01 23:43:44	1.2
+++ libbalsa/address-book-extern.c	2001/12/12 19:18:00
@@ -36,8 +36,6 @@
 #include "information.h"
 #include "abook-completion.h"
 
-/* FIXME: Perhaps the whole thing could be rewritten to use a g_scanner ?? */
-
 /* FIXME: Arbitrary constant */
 #define LINE_LEN 256
 
Index: libinit_balsa/balsa-druid-page-user.gob
===================================================================
RCS file: /cvs/gnome/balsa/libinit_balsa/balsa-druid-page-user.gob,v
retrieving revision 1.14
diff -u -r1.14 balsa-druid-page-user.gob
--- libinit_balsa/balsa-druid-page-user.gob	2001/11/13 23:05:15	1.14
+++ libinit_balsa/balsa-druid-page-user.gob	2001/12/12 19:18:00
@@ -25,6 +25,8 @@
 #include "balsa-initdruid.h"
 #include "balsa-druid-page.h"
 
+#define MAILNAME_FILE "/etc/mailname" /* FIXME: Find this location with configure ? */
+
 %}
 
 %{
@@ -87,14 +89,31 @@
 		preset = g_get_real_name();
 		balsa_init_add_table_entry( table, 0, _("Name:"), preset, &( self->_priv->ed0 ), GTK_WIDGET( self ), &( self->_priv->name ) );
 		
+		/* Email address can be determined in four ways */
+		
+		/* 1. Using the environment variable 'EMAIL' */
+		if(g_getenv("EMAIL") != NULL){
+			preset = g_strdup(g_getenv("EMAIL"));
+
+		/* 2. The file '/etc/mailname' should contain the external host address for the host. Prepend the username (`username`@`cat /etc/mailname`) */
+		}else if(access(MAILNAME_FILE, F_OK) == 0){
+			FILE *mailname_in = fopen(MAILNAME_FILE, "r");
+			fgets(hostbuf, 511, mailname_in);
+			hostbuf[strlen(hostbuf)-1] = '\0';
+			fclose(mailname_in);
+			preset = g_strconcat( g_get_user_name(), "@", hostbuf, NULL );
+		
+		/* 3. Append the domainname to the username */
+		}else if((domain = libbalsa_get_domainname())){
+			preset = g_strconcat( g_get_user_name(), "@", domain, NULL );
+			g_free(domain);
 			
-		gethostname( hostbuf, 511 );
-		domain = libbalsa_get_domainname();
-		if( domain ) {
-		   preset = g_strconcat( g_get_user_name(), "@", domain, NULL );	
-		   g_free(domain);
-		} else 
-		preset = g_strconcat( g_get_user_name(), "@", hostbuf, NULL );
+		/* 4. Append the hostname to the username */
+		} else {
+			gethostname( hostbuf, 511 );
+			preset = g_strconcat( g_get_user_name(), "@", hostbuf, NULL );
+		}
+		
 		balsa_init_add_table_entry( table, 1, _("Email address:"), preset, &( self->_priv->ed1 ), GTK_WIDGET( self ), &( self->_priv->email ) );
 		g_free( preset );
 
Index: src/filter-edit-callbacks.c
===================================================================
RCS file: /cvs/gnome/balsa/src/filter-edit-callbacks.c,v
retrieving revision 1.26
diff -u -r1.26 filter-edit-callbacks.c
--- src/filter-edit-callbacks.c	2001/11/27 22:48:18	1.26
+++ src/filter-edit-callbacks.c	2001/12/12 19:18:02
@@ -1283,14 +1283,14 @@
 fe_new_pressed(GtkWidget * widget, gpointer data)
 {
     gint new_row;
+	gint filter_number;
     LibBalsaFilter* fil;
-    gchar * new_item[] = { N_("New filter") };
-
-    if (!unique_filter_name(new_item[0],-1)) {
-        balsa_information(LIBBALSA_INFORMATION_ERROR,
-                          _("There is yet a ""New Filter"" in the list, "
-                            "rename it first"));
-        return;
+	/* Put a number behind 'New filter' */
+	gchar * new_item [] = { g_malloc(strlen(N_("New filter"))+4) };
+	for(filter_number = 0; filter_number < 1000; filter_number++){
+		if(filter_number == 0)strcpy(new_item[0], N_("New filter"));
+		else g_snprintf(new_item[0], strlen(N_("New filter"))+4, "%s%d", N_("New filter"), filter_number);
+    	if (unique_filter_name(new_item[0],-1)) break;
     }
 
     fil = libbalsa_filter_new();


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