static GdkBitmap *addressxpmmask;
static GdkPixmap *vcardxpm;
static GdkBitmap *vcardxpmmask;
-#ifdef USE_JPILOT
static GdkPixmap *jpilotxpm;
static GdkBitmap *jpilotxpmmask;
static GdkPixmap *categoryxpm;
static GdkBitmap *categoryxpmmask;
-#endif
-#ifdef USE_LDAP
static GdkPixmap *ldapxpm;
static GdkBitmap *ldapxpmmask;
-#endif
// Message buffer
static gchar addressbook_msgbuf[ ADDRESSBOOK_MSGBUF_SIZE ];
GList *nodeIf;
AdapterInterface *adapter;
AddressTypeControlItem *atci;
+ AddressInterface *iface;
gchar *titles[N_COLS] = {_("Name"), _("E-Mail address"), _("Remarks")};
gchar *text;
while( nodeIf ) {
adapter = nodeIf->data;
nodeIf = g_list_next( nodeIf );
- atci = adapter->atci;
- text = atci->displayName;
- adapter->treeNode =
- gtk_ctree_insert_node( GTK_CTREE(ctree),
- NULL, NULL, &text, FOLDER_SPACING,
- interfacexpm, interfacexpmmask,
- interfacexpm, interfacexpmmask,
- FALSE, FALSE );
- menu_set_sensitive( menu_factory, atci->menuCommand, adapter->haveLibrary );
- gtk_ctree_node_set_row_data( GTK_CTREE(ctree), adapter->treeNode, adapter );
+ iface = adapter->interface;
+ if( iface->useInterface ) {
+ atci = adapter->atci;
+ text = atci->displayName;
+ adapter->treeNode =
+ gtk_ctree_insert_node( GTK_CTREE(ctree),
+ NULL, NULL, &text, FOLDER_SPACING,
+ interfacexpm, interfacexpmmask,
+ interfacexpm, interfacexpmmask,
+ FALSE, FALSE );
+ menu_set_sensitive( menu_factory, atci->menuCommand, adapter->haveLibrary );
+ gtk_ctree_node_set_row_data( GTK_CTREE(ctree), adapter->treeNode, adapter );
+ }
}
// Popup menu
iface = adapter->interface;
atci = adapter->atci;
if( iface ) {
- // Load data sources below interface node
- nodeDS = iface->listSource;
- while( nodeDS ) {
- ds = nodeDS->data;
- newNode = NULL;
- name = addrindex_ds_get_name( ds );
- ads = addressbook_create_ds_adapter( ds, atci->objectType, name );
- newNode = addressbook_add_object( node, ADDRESS_OBJECT(ads) );
- nodeDS = g_list_next( nodeDS );
+ if( iface->useInterface ) {
+ // Load data sources below interface node
+ nodeDS = iface->listSource;
+ while( nodeDS ) {
+ ds = nodeDS->data;
+ newNode = NULL;
+ name = addrindex_ds_get_name( ds );
+ ads = addressbook_create_ds_adapter( ds, atci->objectType, name );
+ newNode = addressbook_add_object( node, ADDRESS_OBJECT(ads) );
+ nodeDS = g_list_next( nodeDS );
+ }
+ gtk_ctree_expand( ctree, node );
}
}
- gtk_ctree_expand( ctree, node );
nodeIf = g_list_next( nodeIf );
}
}
iface = addrindex_create_interface( ADDR_IF_JPILOT, "J-Pilot", TAG_IF_JPILOT, TAG_DS_JPILOT );
#ifdef USE_JPILOT
- iface->useInterface = TRUE;
iface->haveLibrary = jpilot_test_pilot_lib();
+ iface->useInterface = iface->haveLibrary;
iface->getModifyFlag = ( void * ) jpilot_get_modified;
iface->getAccessFlag = ( void * ) jpilot_get_accessed;
iface->getReadFlag = ( void * ) jpilot_get_read_flag;
iface = addrindex_create_interface( ADDR_IF_LDAP, "LDAP", TAG_IF_LDAP, TAG_DS_LDAP );
#ifdef USE_LDAP
iface->haveLibrary = syldap_test_ldap_lib();
+ iface->useInterface = iface->haveLibrary;
iface->getAccessFlag = ( void * ) syldap_get_accessed;
// iface->getModifyFlag = ( void * ) syldap_get_modified;
// iface->getReadFlag = ( void * ) syldap_get_read_flag;
static AddressDataSource *addrindex_parse_ldap( XMLFile *file ) {
AddressDataSource *ds = g_new0( AddressDataSource, 1 );
GList *list = addrindex_read_attributes( file );
- ds->data = list;
+ ds->rawDataSource = list;
return ds;
}