Only enable "New Book" context menu entry for internal addressbook.
authorAndrej Kacian <ticho@claws-mail.org>
Thu, 28 Jul 2016 20:57:23 +0000 (22:57 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Thu, 28 Jul 2016 21:02:04 +0000 (23:02 +0200)
It was confusing to have it active on e.g. LDAP server interface,
when it really only adds a new XML addressbook.

Also, do not enable the "New" button when right-clicking the XML
addressbook interface line, as the button doesn't do anything
useful for interfaces.

src/addressbook.c

index 59cbce4..94579bd 100644 (file)
@@ -2538,9 +2538,8 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
                iface = adapter->interface;
                if( !iface )
                        goto just_set_sens;
-               if( !iface->readOnly ) {
+               if( !iface->readOnly && iface->type == ADDR_IF_BOOK) {
                        cm_menu_set_sensitive_full( addrbook.ui_manager, "Popups/ABTreePopup/NewBook", TRUE );
-                       gtk_widget_set_sensitive( addrbook.reg_btn, TRUE );
                }
                if( iface->externalQuery )
                        canLookup = TRUE;