2005-11-23 [colin] 1.9.100cvs30
authorColin Leroy <colin@colino.net>
Wed, 23 Nov 2005 18:26:57 +0000 (18:26 +0000)
committerColin Leroy <colin@colino.net>
Wed, 23 Nov 2005 18:26:57 +0000 (18:26 +0000)
* src/addressbook.c
Rename menu item, fix possible crash after
deletion of books
* src/addrindex.c
Allow searching for '*' in ldap
* src/browseldap.c
Fix "Browse Entry" (did anyone use it?)
* src/wizard.c
Add guards for mandatory information

ChangeLog
PATCHSETS
configure.ac
src/addressbook.c
src/addrindex.c
src/browseldap.c
src/wizard.c

index cda25ad..e55cae1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-11-23 [colin]     1.9.100cvs30
+
+       * src/addressbook.c
+               Rename menu item, fix possible crash after
+               deletion of books
+       * src/addrindex.c
+               Allow searching for '*' in ldap
+       * src/browseldap.c
+               Fix "Browse Entry" (did anyone use it?)
+       * src/wizard.c
+               Add guards for mandatory information
+
 2005-11-23 [paul]      1.9.100cvs29
 
        * manual/advanced.xml
index 1230676..619f695 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.195 -r 1.382.2.196 src/compose.c;  cvs diff -u -r 1.9.2.31 -r 1.9.2.32 src/gtk/gtkaspell.c;  ) > 1.9.100cvs27.patchset
 ( cvs diff -u -r 1.83.2.51 -r 1.83.2.52 src/mimeview.c;  ) > 1.9.100cvs28.patchset
 ( cvs diff -u -r 1.1.2.4 -r 1.1.2.5 manual/advanced.xml;  ) > 1.9.100cvs29.patchset
+( cvs diff -u -r 1.60.2.39 -r 1.60.2.40 src/addressbook.c;  cvs diff -u -r 1.28.2.12 -r 1.28.2.13 src/addrindex.c;  cvs diff -u -r 1.2.4.9 -r 1.2.4.10 src/browseldap.c;  cvs diff -u -r 1.1.2.24 -r 1.1.2.25 src/wizard.c;  ) > 1.9.100cvs30.patchset
index 4e4a69a..f32db35 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=100
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=29
+EXTRA_VERSION=30
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 6753c81..e4e789f 100644 (file)
@@ -409,7 +409,7 @@ static GtkItemFactoryEntry addressbook_entries[] =
        {N_("/_Book/New _JPilot"),      "<control>J",   addressbook_new_jpilot_cb,      0, NULL},
 #endif
 #ifdef USE_LDAP
-       {N_("/_Book/New _Server"),      "<control><shift>S",    addressbook_new_ldap_cb,        0, NULL},
+       {N_("/_Book/New LDAP _Server"), "<control><shift>S",    addressbook_new_ldap_cb,        0, NULL},
 #endif
        {N_("/_Book/---"),              NULL,           NULL, 0, "<Separator>"},
        {N_("/_Book/_Edit book"),       NULL,           addressbook_treenode_edit_cb,   0, NULL},
@@ -2163,7 +2163,11 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
        if (obj->type == ADDR_DATASOURCE) {
                ads = ADAPTER_DSOURCE(obj);
                ds = ads->dataSource;
+               if (!ds)
+                       goto just_set_sens;
                iface = ds->interface;
+               if (!iface)
+                       goto just_set_sens;
                canEdit = TRUE;
                canDelete = TRUE;
                if( iface->readOnly ) {
@@ -2178,7 +2182,11 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
        }
        else if (obj->type == ADDR_ITEM_FOLDER) {
                ds = addressbook_find_datasource( addrbook.treeSelected );
+               if (!ds)
+                       goto just_set_sens;
                iface = ds->interface;
+               if (!iface)
+                       goto just_set_sens;
                if( iface->readOnly ) {
                        canTreePaste = FALSE;
                }
@@ -2190,7 +2198,7 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
                        gtk_widget_set_sensitive( addrbook.reg_btn, TRUE );
                }
                canTreeCopy = TRUE;
-               iface = ds->interface;
+
                if( iface->externalQuery ) {
                        /* Enable deletion of LDAP folder */
                        canLookup = TRUE;
@@ -2199,7 +2207,11 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
        }
        else if (obj->type == ADDR_ITEM_GROUP) {
                ds = addressbook_find_datasource( addrbook.treeSelected );
+               if (!ds)
+                       goto just_set_sens;
                iface = ds->interface;
+               if (!iface)
+                       goto just_set_sens;
                if( ! iface->readOnly ) {
                        canEdit = TRUE;
                        canDelete = TRUE;
@@ -2217,6 +2229,7 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
        if( ! addrselect_test_empty( _addressSelect_ ) ) canCopy = TRUE;
        if( ! addrclip_is_empty( _clipBoard_ ) ) canPaste = TRUE;
 
+just_set_sens:
        /* Enable edit */
        menu_set_sensitive( addrbook.tree_factory, "/Edit",   canEdit );
        menu_set_sensitive( addrbook.tree_factory, "/Delete", canDelete );
@@ -4243,7 +4256,7 @@ void addrbookctl_build_map( GtkWidget *window ) {
        atci->maskXpm = ldapxpmmask;
        atci->iconXpmOpen = ldapxpm;
        atci->maskXpmOpen = ldapxpmmask;
-       atci->menuCommand = "/Book/New Server";
+       atci->menuCommand = "/Book/New LDAP Server";
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
 
index 2a8f468..65f2dfe 100644 (file)
@@ -116,8 +116,8 @@ N_("Common address")
 N_("Personal address")
 #endif
 
-#define DISP_NEW_COMMON       _("Common address")
-#define DISP_NEW_PERSONAL     _("Personal address")
+#define DISP_NEW_COMMON       _("Common addresses")
+#define DISP_NEW_PERSONAL     _("Personal addresses")
 
 /* Old address book */
 #define TAG_IF_OLD_COMMON     "common_address"
@@ -2655,12 +2655,21 @@ gint addrindex_setup_explicit_search(
        QueryRequest *req;
        gint queryID;
        gchar *name;
+       gchar *mySearch;
 
        /* Name the query */
        name = g_strdup_printf( "Search '%s'", searchTerm );
 
        /* Set up query request */
-       req = qrymgr_add_request( searchTerm, callBackEnd, callBackEntry );
+       if (!strcmp(searchTerm, "*"))
+               mySearch = g_strdup("*@");
+       else
+               mySearch = g_strdup(searchTerm);
+       
+       req = qrymgr_add_request( mySearch, callBackEnd, callBackEntry );
+
+       g_free(mySearch);
+
        qryreq_set_search_type( req, ADDRSEARCH_EXPLICIT );
        queryID = req->queryID;
 
index 47c62f2..70d578a 100644 (file)
@@ -71,8 +71,6 @@ static struct _LDAPEntry_dlg {
        GtkWidget *label_address;
        GtkWidget *list_entry;
        GtkWidget *close_btn;
-       GtkWidget *statusbar;
-       gint status_cid;
 } browseldap_dlg;
 
 /**
@@ -162,22 +160,6 @@ static void browse_clear_queue( void ) {
        pthread_mutex_unlock( & _browseMutex_ );
 }
 
-/**
- * Clear message in status bar.
- * \param msg Message.
- */
-static void browse_status_show( gchar *msg ) {
-       if( browseldap_dlg.statusbar != NULL ) {
-               gtk_statusbar_pop( GTK_STATUSBAR(browseldap_dlg.statusbar),
-                       browseldap_dlg.status_cid );
-               if( msg ) {
-                       gtk_statusbar_push(
-                               GTK_STATUSBAR(browseldap_dlg.statusbar),
-                               browseldap_dlg.status_cid, msg );
-               }
-       }
-}
-
 /**
  * Close window callback.
  * \param widget    Widget.
@@ -230,7 +212,6 @@ static void browse_create( void ) {
        GtkWidget *hbbox;
        GtkWidget *close_btn;
        GtkWidget *hsbox;
-       GtkWidget *statusbar;
        gint top;
 
        window = gtk_dialog_new();
@@ -245,7 +226,7 @@ static void browse_create( void ) {
                         G_CALLBACK(browse_key_pressed), NULL);
 
        vbox = gtk_vbox_new(FALSE, 8);
-       gtk_container_add(GTK_CONTAINER(window), vbox);
+       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox), vbox, TRUE, TRUE, 0);
        gtk_container_set_border_width( GTK_CONTAINER(vbox), 8 );
 
        table = gtk_table_new(2, 2, FALSE);
@@ -298,12 +279,6 @@ static void browse_create( void ) {
                COL_NAME, COL_WIDTH_NAME );
        gtk_clist_set_auto_sort( GTK_CLIST(list_entry), TRUE );
 
-       /* Status line */
-       hsbox = gtk_hbox_new(FALSE, 0);
-       gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
-       statusbar = gtk_statusbar_new();
-       gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
-
        /* Button panel */
        gtkut_stock_button_set_create(&hbbox, &close_btn, GTK_STOCK_CLOSE,
                                      NULL, NULL, NULL, NULL);
@@ -321,10 +296,6 @@ static void browse_create( void ) {
        browseldap_dlg.label_address = label_addr;
        browseldap_dlg.list_entry    = list_entry;
        browseldap_dlg.close_btn     = close_btn;
-       browseldap_dlg.statusbar     = statusbar;
-       browseldap_dlg.status_cid    =
-               gtk_statusbar_get_context_id(
-                       GTK_STATUSBAR(statusbar), "Browse LDAP" );
 
        gtk_widget_show_all( window );
 
@@ -397,7 +368,6 @@ gboolean browseldap_entry( AddressDataSource *ds, const gchar *dn ) {
        gtk_widget_show(browseldap_dlg.window);
        manage_window_set_transient(GTK_WINDOW(browseldap_dlg.window));
 
-       browse_status_show( "" );
        gtk_clist_select_row( GTK_CLIST( browseldap_dlg.list_entry ), 0, 0 );
        gtk_widget_show(browseldap_dlg.window);
 
index 7973642..89d1198 100644 (file)
@@ -228,7 +228,7 @@ static void write_welcome_email(WizardWindow *wizard)
 
 static gboolean wizard_write_config(WizardWindow *wizard)
 {
-       gboolean mailbox_ok = FALSE;
+       static gboolean mailbox_ok = FALSE;
        PrefsAccount *prefs_account = prefs_account_new();
        GList *account_list = NULL;
        GtkWidget *menu, *menuitem;
@@ -238,19 +238,67 @@ static gboolean wizard_write_config(WizardWindow *wizard)
        prefs_account->protocol = GPOINTER_TO_INT
                        (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
        
-       if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4) {
-               mailbox_ok = setup_write_mailbox_path(wizard->mainwin, 
-                               gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)));
-       } else
-               mailbox_ok = TRUE;
+       
+       if (!mailbox_ok) {
+               if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4) {
+                       mailbox_ok = setup_write_mailbox_path(wizard->mainwin, 
+                                       gtk_entry_get_text(
+                                               GTK_ENTRY(wizard->mailbox_name)));
+               } else
+                       mailbox_ok = TRUE;
+       }
 
        if (!mailbox_ok) {
+               /* alertpanel done by setup_write_mailbox_path */
+               g_free(prefs_account);
                gtk_notebook_set_current_page (
                        GTK_NOTEBOOK(wizard->notebook), 
                        4);
                return FALSE;
        }
        
+       if (!strlen(gtk_entry_get_text(GTK_ENTRY(wizard->full_name)))
+       ||  !strlen(gtk_entry_get_text(GTK_ENTRY(wizard->email)))) {
+               alertpanel_error(_("Please fill in your name and email address."));
+               g_free(prefs_account);
+               gtk_notebook_set_current_page (
+                       GTK_NOTEBOOK(wizard->notebook), 
+                       1);
+               return FALSE;
+       }
+       
+       if (prefs_account->protocol != A_LOCAL) {
+               if (!strlen(gtk_entry_get_text(GTK_ENTRY(wizard->recv_username)))
+               ||  !strlen(gtk_entry_get_text(GTK_ENTRY(wizard->recv_server)))) {
+                       alertpanel_error(_("Please fill in your reception server "
+                                          "and username."));
+                       g_free(prefs_account);
+                       gtk_notebook_set_current_page (
+                               GTK_NOTEBOOK(wizard->notebook), 
+                               3);
+                       return FALSE;
+               }
+       } else {
+               if (!strlen(gtk_entry_get_text(GTK_ENTRY(wizard->recv_server)))) {
+                       alertpanel_error(_("Please fill in your username."));
+                       g_free(prefs_account);
+                       gtk_notebook_set_current_page (
+                               GTK_NOTEBOOK(wizard->notebook), 
+                               3);
+                       return FALSE;
+               }
+       }
+
+       if (!strlen(gtk_entry_get_text(GTK_ENTRY(wizard->smtp_server)))) {
+               alertpanel_error(_("Please fill in your SMTP server."));
+               g_free(prefs_account);
+               gtk_notebook_set_current_page (
+                       GTK_NOTEBOOK(wizard->notebook), 
+                       2);
+               return FALSE;
+
+       }
+
        if (prefs_account->protocol != A_LOCAL)
                prefs_account->account_name = g_strdup_printf("%s@%s",
                                gtk_entry_get_text(GTK_ENTRY(wizard->recv_username)),