Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
138
Issues
138
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
53622593
Commit
53622593
authored
Sep 12, 2011
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addressbook : simplify
parent
af66eb76
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
101 additions
and
218 deletions
+101
-218
gnome/src/actions.c
gnome/src/actions.c
+1
-1
gnome/src/config/addressbook-config.c
gnome/src/config/addressbook-config.c
+25
-43
gnome/src/config/addressbook-config.h
gnome/src/config/addressbook-config.h
+2
-5
gnome/src/config/preferencesdialog.c
gnome/src/config/preferencesdialog.c
+3
-3
gnome/src/contacts/addrbookfactory.c
gnome/src/contacts/addrbookfactory.c
+35
-95
gnome/src/contacts/addrbookfactory.h
gnome/src/contacts/addrbookfactory.h
+2
-16
gnome/src/contacts/searchbar.c
gnome/src/contacts/searchbar.c
+22
-39
gnome/src/dbus/dbus.c
gnome/src/dbus/dbus.c
+0
-3
gnome/src/uimanager.c
gnome/src/uimanager.c
+11
-13
No files found.
gnome/src/actions.c
View file @
53622593
...
...
@@ -333,7 +333,7 @@ gboolean sflphone_init (GError **error)
if
(
!
dbus_connect
(
error
)
||
!
dbus_register
(
getpid
(),
"Gtk+ Client"
,
error
))
return
FALSE
;
abook
factory_init_factory
();
abook
_init
();
// Init icons factory
init_icon_factory
();
...
...
gnome/src/config/addressbook-config.c
View file @
53622593
...
...
@@ -31,7 +31,6 @@
#include "addressbook-config.h"
#include "searchbar.h"
#include "contacts/addrbookfactory.h"
// #include "contacts/addressbook/eds.h"
#include <string.h>
#include <stdlib.h>
...
...
@@ -44,44 +43,33 @@ enum {
COLUMN_BOOK_ACTIVE
,
COLUMN_BOOK_NAME
,
COLUMN_BOOK_UID
};
void
addressbook_config_load_parameters
(
AddressBook_Config
**
settings
)
AddressBook_Config
*
addressbook_config_load_parameters
()
{
GHashTable
*
_params
=
NULL
;
AddressBook_Config
*
_settings
;
// Allocate a struct
_settings
=
g_new0
(
AddressBook_Config
,
1
);
// Fetch the settings from D-Bus
_params
=
(
GHashTable
*
)
dbus_get_addressbook_settings
();
if
(
_params
==
NULL
)
{
DEBUG
(
"Addressbook: No parameters received, use default"
);
_settings
->
enable
=
1
;
_settings
->
max_results
=
30
;
_settings
->
display_contact_photo
=
0
;
_settings
->
search_phone_business
=
1
;
_settings
->
search_phone_home
=
1
;
_settings
->
search_phone_mobile
=
1
;
AddressBook_Config
*
config
=
g_new0
(
AddressBook_Config
,
1
);
GHashTable
*
params
=
dbus_get_addressbook_settings
();
if
(
params
==
NULL
)
{
config
->
enable
=
1
;
config
->
max_results
=
30
;
config
->
display_contact_photo
=
0
;
config
->
search_phone_business
=
1
;
config
->
search_phone_home
=
1
;
config
->
search_phone_mobile
=
1
;
}
else
{
_settings
->
enable
=
(
size_t
)
(
g_hash_table_lookup
(
_
params
,
ADDRESSBOOK_ENABLE
));
_settings
->
max_results
=
(
size_t
)
(
g_hash_table_lookup
(
_
params
,
ADDRESSBOOK_MAX_RESULTS
));
_settings
->
display_contact_photo
=
(
size_t
)
(
g_hash_table_lookup
(
_
params
,
ADDRESSBOOK_DISPLAY_CONTACT_PHOTO
));
_settings
->
search_phone_business
=
(
size_t
)
(
g_hash_table_lookup
(
_
params
,
ADDRESSBOOK_DISPLAY_PHONE_BUSINESS
));
_settings
->
search_phone_home
=
(
size_t
)
(
g_hash_table_lookup
(
_
params
,
ADDRESSBOOK_DISPLAY_PHONE_HOME
));
_settings
->
search_phone_mobile
=
(
size_t
)
(
g_hash_table_lookup
(
_
params
,
ADDRESSBOOK_DISPLAY_PHONE_MOBILE
));
config
->
enable
=
(
size_t
)
(
g_hash_table_lookup
(
params
,
ADDRESSBOOK_ENABLE
));
config
->
max_results
=
(
size_t
)
(
g_hash_table_lookup
(
params
,
ADDRESSBOOK_MAX_RESULTS
));
config
->
display_contact_photo
=
(
size_t
)
(
g_hash_table_lookup
(
params
,
ADDRESSBOOK_DISPLAY_CONTACT_PHOTO
));
config
->
search_phone_business
=
(
size_t
)
(
g_hash_table_lookup
(
params
,
ADDRESSBOOK_DISPLAY_PHONE_BUSINESS
));
config
->
search_phone_home
=
(
size_t
)
(
g_hash_table_lookup
(
params
,
ADDRESSBOOK_DISPLAY_PHONE_HOME
));
config
->
search_phone_mobile
=
(
size_t
)
(
g_hash_table_lookup
(
params
,
ADDRESSBOOK_DISPLAY_PHONE_MOBILE
));
}
DEBUG
(
"Addressbook: Settings: enabled %d, max_result %d, photo %d, business %d, home %d, mobile %d"
,
_settings
->
enable
,
_settings
->
max_results
,
_settings
->
display_contact_photo
,
_settings
->
search_phone_business
,
_settings
->
search_phone_home
,
_settings
->
search_phone_mobile
);
config
->
enable
,
config
->
max_results
,
config
->
display_contact_photo
,
config
->
search_phone_business
,
config
->
search_phone_home
,
config
->
search_phone_mobile
);
*
settings
=
_settings
;
return
config
;
}
void
...
...
@@ -211,9 +199,8 @@ addressbook_config_book_active_toggled (
gchar
*
name
;
gchar
*
uid
;
if
(
!
a
bookfactory_is_addressbook_loaded
())
{
if
(
!
a
ddrbook
)
return
;
}
// Get path of clicked book active toggle box
treePath
=
gtk_tree_path_new_from_string
(
path
);
...
...
@@ -223,8 +210,6 @@ addressbook_config_book_active_toggled (
return
;
}
AddrBookFactory
*
factory
=
abookfactory_get_factory
();
gtk_tree_model_get_iter
(
model
,
&
iter
,
treePath
);
// Get active value at iteration
...
...
@@ -240,7 +225,7 @@ addressbook_config_book_active_toggled (
gtk_tree_path_free
(
treePath
);
// Update current memory stored books data
book_data
=
factory
->
addrbook
->
get_book_data_by_uid
(
uid
);
book_data
=
addrbook
->
get_book_data_by_uid
(
uid
);
if
(
book_data
==
NULL
)
{
ERROR
(
"Addressbook: Error: Could not find addressbook %s"
,
uid
);
}
...
...
@@ -292,14 +277,11 @@ addressbook_config_fill_book_list()
book_data_t
*
book_data
;
gchar
**
book_list
;
if
(
!
a
bookfactory_is_addressbook_loaded
())
{
if
(
!
a
ddrbook
)
return
;
}
AddrBookFactory
*
factory
=
abookfactory_get_factory
();
book_list
=
dbus_get_addressbook_list
();
GSList
*
books_data
=
factory
->
addrbook
->
get_books_data
(
book_list
);
GSList
*
books_data
=
addrbook
->
get_books_data
(
book_list
);
if
(
!
books_data
)
{
DEBUG
(
"Addressbook: No valid books data (%s:%d)"
,
__FILE__
,
__LINE__
);
...
...
@@ -338,7 +320,7 @@ create_addressbook_settings()
GtkTreeViewColumn
*
tree_view_column
;
// Load the user value
addressbook_config
_load_parameters
(
&
addressbook_config
);
addressbook_config
=
addressbook_config_load_parameters
(
);
ret
=
gtk_vbox_new
(
FALSE
,
10
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
ret
),
10
);
...
...
gnome/src/config/addressbook-config.h
View file @
53622593
...
...
@@ -67,12 +67,9 @@ void
addressbook_config_save_parameters
(
void
);
/**
* Initialize the address book structure, and retrieve the saved parameters through D-Bus
*
* @param settings The addressbook structure
* Return the saved parameters through D-Bus
*/
void
addressbook_config_load_parameters
(
AddressBook_Config
**
settings
);
AddressBook_Config
*
addressbook_config_load_parameters
();
gboolean
addressbook_display
(
AddressBook_Config
*
settings
,
const
gchar
*
field
);
...
...
gnome/src/config/preferencesdialog.c
View file @
53622593
...
...
@@ -285,7 +285,7 @@ create_general_settings ()
void
save_configuration_parameters
(
void
)
{
if
(
abookfactory_is_addressbook_loaded
()
)
{
if
(
addrbook
)
{
// Address book config
addressbook_config_save_parameters
();
}
...
...
@@ -410,7 +410,7 @@ show_preferences_dialog ()
gtk_notebook_append_page
(
GTK_NOTEBOOK
(
notebook
),
tab
,
gtk_label_new
(
_
(
"Shortcuts"
)));
gtk_notebook_page_num
(
GTK_NOTEBOOK
(
notebook
),
tab
);
if
(
a
bookfactory_is_addressbook_loaded
()
)
{
if
(
a
ddrbook
)
{
// Addressbook tab
tab
=
create_addressbook_settings
();
gtk_notebook_append_page
(
GTK_NOTEBOOK
(
notebook
),
tab
,
gtk_label_new
(
_
(
"Address Book"
)));
...
...
@@ -451,7 +451,7 @@ GtkTreeModel* createModel()
GError
*
error
=
NULL
;
gint
i
,
nb_entries
;
nb_entries
=
a
bookfactory_is_addressbook_loaded
()
?
5
:
4
;
nb_entries
=
a
ddrbook
?
5
:
4
;
store
=
gtk_list_store_new
(
3
,
GDK_TYPE_PIXBUF
,
G_TYPE_STRING
,
G_TYPE_INT
);
GtkIconTheme
*
theme
=
gtk_icon_theme_get_default
();
...
...
gnome/src/contacts/addrbookfactory.c
View file @
53622593
...
...
@@ -37,89 +37,8 @@
#include <glib.h>
#include <dlfcn.h>
static
void
handler_async_search
(
GList
*
hits
,
gpointer
user_data
)
;
AddrBookHandle
*
addrbook
=
NULL
;
AddrBookFactory
addressbookFactory
=
{
.
addrbook
=
NULL
};
AddrBookFactory
*
abookfactory_get_factory
(
void
)
{
return
&
addressbookFactory
;
}
gboolean
abookfactory_is_addressbook_loaded
(
void
)
{
return
(
addressbookFactory
.
addrbook
!=
NULL
)
?
TRUE
:
FALSE
;
}
void
abookfactory_init_factory
()
{
abookfactory_load_module
(
&
addressbookFactory
);
}
void
abookfactory_scan_directory
(
AddrBookFactory
*
factory
UNUSED
)
{
}
void
abookfactory_load_module
(
AddrBookFactory
*
factory
)
{
gchar
*
plugindir
=
PLUGINS_DIR
;
gchar
*
pluginpath
=
g_strdup_printf
(
"%s/libevladdrbook.so"
,
plugindir
);
DEBUG
(
"AddressbookFactory: Loading addressbook: %s"
,
pluginpath
);
void
*
handle
=
dlopen
(
pluginpath
,
RTLD_LAZY
);
g_free
(
pluginpath
);
if
(
handle
==
NULL
)
{
ERROR
(
"AddressbookFactory: Error: Could not load addressbook"
);
return
;
}
AddrBookHandle
*
ab
=
g_malloc
(
sizeof
(
AddrBookHandle
));
ab
->
init
=
dlsym
(
handle
,
"addressbook_init"
);
if
(
ab
->
init
==
NULL
)
ERROR
(
"AddressbookFactory: Error: Could not load addressbook_init function"
);
ab
->
is_ready
=
dlsym
(
handle
,
"addressbook_is_ready"
);
if
(
ab
->
is_ready
==
NULL
)
ERROR
(
"AddressbookFactory: Error: Could not load addressbook addressbook_is_ready function"
);
ab
->
is_active
=
dlsym
(
handle
,
"addressbook_is_active"
);
if
(
ab
->
is_active
==
NULL
)
ERROR
(
"AddressbookFactory: Error: Could not load addressbook addressbook_is_active function"
);
ab
->
search
=
dlsym
(
handle
,
"addressbook_search"
);
if
(
ab
->
search
==
NULL
)
ERROR
(
"AddressbookFactory: Error: Could not load addressbook addressbook_search function"
);
ab
->
get_books_data
=
dlsym
(
handle
,
"addressbook_get_books_data"
);
if
(
ab
->
get_books_data
==
NULL
)
ERROR
(
"AddressbookFactory: Error: Could not load addressbook addressbook_get_books_data function"
);
ab
->
get_book_data_by_uid
=
dlsym
(
handle
,
"addressbook_get_book_data_by_uid"
);
if
(
ab
->
get_book_data_by_uid
==
NULL
)
ERROR
(
"AddressbookFactory: Error: Could not load addressbook addressbook_get_books_data_by_uid function"
);
ab
->
set_current_book
=
dlsym
(
handle
,
"addressbook_set_current_book"
);
if
(
ab
->
set_current_book
==
NULL
)
ERROR
(
"AddressbookFactory: Error: Could not load addressbook addressbook_ser_current_book"
);
ab
->
set_search_type
=
dlsym
(
handle
,
"addressbook_set_search_type"
);
if
(
ab
->
set_search_type
==
NULL
)
ERROR
(
"AddressbookFactory: Error: Could not load addressbook addressbook_set_search_type"
);
ab
->
search_cb
=
handler_async_search
;
DEBUG
(
"AddressbookFactory: Loading done"
);
factory
->
addrbook
=
ab
;
}
void
free_hit
(
Hit
*
h
)
{
g_free
(
h
->
name
);
g_free
(
h
->
phone_business
);
g_free
(
h
->
phone_home
);
g_free
(
h
->
phone_mobile
);
g_free
(
h
);
}
/**
* Callback called after all book have been processed
...
...
@@ -127,52 +46,73 @@ free_hit (Hit *h)
static
void
handler_async_search
(
GList
*
hits
,
gpointer
user_data
)
{
GList
*
i
;
// Retrieve the address book parameters
AddressBook_Config
*
addressbook_config
=
user_data
;
// reset previous results
calltree_reset
(
contacts
);
calllist_reset
(
contacts
);
for
(
i
=
hits
;
i
!=
NULL
;
i
=
i
->
next
)
{
for
(
GList
*
i
=
hits
;
i
!=
NULL
;
i
=
i
->
next
)
{
GdkPixbuf
*
photo
=
NULL
;
Hit
*
entry
=
i
->
data
;
if
(
!
entry
)
continue
;
// Get the photo
if
(
addressbook_display
(
addressbook_config
,
ADDRESSBOOK_DISPLAY_CONTACT_PHOTO
))
photo
=
entry
->
photo
;
// Create entry for business phone information
if
(
addressbook_display
(
addressbook_config
,
ADDRESSBOOK_DISPLAY_PHONE_BUSINESS
))
calllist_add_contact
(
entry
->
name
,
entry
->
phone_business
,
CONTACT_PHONE_BUSINESS
,
photo
);
// Create entry for home phone information
if
(
addressbook_display
(
addressbook_config
,
ADDRESSBOOK_DISPLAY_PHONE_HOME
))
calllist_add_contact
(
entry
->
name
,
entry
->
phone_home
,
CONTACT_PHONE_HOME
,
photo
);
// Create entry for mobile phone iddnformation
if
(
addressbook_display
(
addressbook_config
,
ADDRESSBOOK_DISPLAY_PHONE_MOBILE
))
calllist_add_contact
(
entry
->
name
,
entry
->
phone_mobile
,
CONTACT_PHONE_MOBILE
,
photo
);
free_hit
(
entry
);
g_free
(
entry
->
name
);
g_free
(
entry
->
phone_business
);
g_free
(
entry
->
phone_home
);
g_free
(
entry
->
phone_mobile
);
g_free
(
entry
);
}
g_list_free
(
hits
);
gtk_widget_grab_focus
(
GTK_WIDGET
(
contacts
->
view
));
}
void
abook_init
()
{
void
*
handle
=
dlopen
(
PLUGINS_DIR
"/libevladdrbook.so"
,
RTLD_LAZY
);
if
(
handle
==
NULL
)
{
ERROR
(
"Addressbook: Error: Could not load addressbook"
);
return
;
}
addrbook
=
g_malloc
(
sizeof
(
AddrBookHandle
));
#define LOAD(func) do { \
addrbook-> func = dlsym(handle, "addressbook_" #func); \
if (addrbook-> func == NULL) \
ERROR("Addressbook: Couldn't load " # func); \
} while(0)
// Deactivate waiting image
// deactivateWaitingLayer();
LOAD
(
init
);
LOAD
(
is_ready
);
LOAD
(
is_active
);
LOAD
(
search
);
LOAD
(
get_books_data
);
LOAD
(
get_book_data_by_uid
);
LOAD
(
set_current_book
);
LOAD
(
set_search_type
);
gtk_widget_grab_focus
(
GTK_WIDGET
(
contacts
->
view
))
;
addrbook
->
search_cb
=
handler_async_search
;
}
gnome/src/contacts/addrbookfactory.h
View file @
53622593
...
...
@@ -32,24 +32,10 @@
#ifndef __ADDRBOOKFACTORY_H__
#define __ADDRBOOKFACTORY_H__
#include <dlfcn.h>
#include <gtk/gtk.h>
#include "addressbook.h"
typedef
struct
_addrbookfactory
{
gboolean
is_loaded
;
AddrBookHandle
*
addrbook
;
}
AddrBookFactory
;
void
abook_init
();
void
abookfactory_init_factory
();
extern
AddrBookHandle
*
addrbook
;
AddrBookFactory
*
abookfactory_get_factory
(
void
);
gboolean
abookfactory_is_addressbook_loaded
(
void
);
void
abookfactory_scan_directory
(
AddrBookFactory
*
);
void
abookfactory_load_module
(
AddrBookFactory
*
);
void
free_hit
(
Hit
*
);
#endif
gnome/src/contacts/searchbar.c
View file @
53622593
...
...
@@ -58,14 +58,8 @@ GdkPixbuf *missed_pixbuf = NULL;
void
searchbar_addressbook_activated
(
GtkEntry
*
entry
,
gchar
*
arg1
UNUSED
,
gpointer
data
UNUSED
)
{
DEBUG
(
"Searchbar: Entry activated"
);
if
(
abookfactory_is_addressbook_loaded
())
{
AddrBookFactory
*
factory
=
abookfactory_get_factory
();
AddressBook_Config
*
addressbook_config
;
addressbook_config_load_parameters
(
&
addressbook_config
);
factory
->
addrbook
->
search
(
factory
->
addrbook
->
search_cb
,
entry
,
addressbook_config
);
}
if
(
addrbook
)
addrbook
->
search
(
addrbook
->
search_cb
,
entry
,
addressbook_config_load_parameters
());
}
void
searchbar_entry_changed
(
GtkEntry
*
entry
UNUSED
,
gchar
*
arg1
UNUSED
,
gpointer
data
UNUSED
)
...
...
@@ -82,14 +76,12 @@ void searchbar_entry_changed (GtkEntry* entry UNUSED, gchar* arg1 UNUSED, gpoint
static
void
cbox_changed_cb
(
GtkWidget
*
widget
,
gpointer
user_data
UNUSED
)
{
if
(
abookfactory_is_addressbook_loaded
())
{
DEBUG
(
"Searchbar: Set new addressbook"
);
AddrBookFactory
*
factory
=
abookfactory_get_factory
();
factory
->
addrbook
->
set_current_book
(
gtk_combo_box_get_active_text
(
GTK_COMBO_BOX
(
widget
)));
AddressBook_Config
*
addressbook_config
;
addressbook_config_load_parameters
(
&
addressbook_config
);
factory
->
addrbook
->
search
(
factory
->
addrbook
->
search_cb
,
GTK_ENTRY
(
addressbookentry
),
addressbook_config
);
}
if
(
!
addrbook
)
return
;
addrbook
->
set_current_book
(
gtk_combo_box_get_active_text
(
GTK_COMBO_BOX
(
widget
)));
AddressBook_Config
*
addressbook_config
=
addressbook_config_load_parameters
();
addrbook
->
search
(
addrbook
->
search_cb
,
GTK_ENTRY
(
addressbookentry
),
addressbook_config
);
}
void
set_focus_on_addressbook_searchbar
()
...
...
@@ -105,10 +97,8 @@ void update_searchbar_addressbook_list()
book_data_t
*
book_data
;
GSList
*
books_data
=
NULL
;
if
(
abookfactory_is_addressbook_loaded
())
{
AddrBookFactory
*
factory
=
abookfactory_get_factory
();
books_data
=
factory
->
addrbook
->
get_books_data
(
dbus_get_addressbook_list
());
}
if
(
addrbook
)
books_data
=
addrbook
->
get_books_data
(
dbus_get_addressbook_list
());
if
(
books_data
==
NULL
)
{
ERROR
(
"Searchbar: No books data found"
);
...
...
@@ -148,16 +138,15 @@ void update_searchbar_addressbook_list()
}
}
if
(
abookfactory_is_addressbook_loaded
())
{
AddrBookFactory
*
factory
=
abookfactory_get_factory
();
if
(
addrbook
)
{
if
(
activeIsSet
)
{
gtk_combo_box_set_active_iter
(
GTK_COMBO_BOX
(
cbox
),
&
activeIter
);
factory
->
addrbook
->
set_current_book
(
activeText
);
addrbook
->
set_current_book
(
activeText
);
}
else
{
gtk_combo_box_set_active
(
GTK_COMBO_BOX
(
cbox
),
0
);
gtk_combo_box_get_active_text
(
GTK_COMBO_BOX
(
cbox
));
factory
->
addrbook
->
set_current_book
(
gtk_combo_box_get_active_text
(
GTK_COMBO_BOX
(
cbox
)));
addrbook
->
set_current_book
(
gtk_combo_box_get_active_text
(
GTK_COMBO_BOX
(
cbox
)));
}
}
...
...
@@ -169,9 +158,7 @@ void update_searchbar_addressbook_list()
static
void
select_search_type
(
GtkWidget
*
item
,
GtkEntry
*
entry
UNUSED
)
{
if
(
abookfactory_is_addressbook_loaded
())
{
AddrBookFactory
*
factory
=
abookfactory_get_factory
();
if
(
addrbook
)
{
DEBUG
(
"Searchbar: %s"
,
gtk_menu_item_get_label
(
GTK_MENU_ITEM
(
item
)));
gtk_entry_set_icon_tooltip_text
(
GTK_ENTRY
(
addressbookentry
),
GTK_ENTRY_ICON_PRIMARY
,
...
...
@@ -179,18 +166,17 @@ static void select_search_type (GtkWidget *item, GtkEntry *entry UNUSED)
if
(
g_strcmp0
(
"Search is"
,
gtk_menu_item_get_label
(
GTK_MENU_ITEM
(
item
)))
==
0
)
{
factory
->
addrbook
->
set_search_type
(
ABOOK_QUERY_IS
);
addrbook
->
set_search_type
(
ABOOK_QUERY_IS
);
}
else
if
(
g_strcmp0
(
"Search begins with"
,
gtk_menu_item_get_label
(
GTK_MENU_ITEM
(
item
)))
==
0
)
{
factory
->
addrbook
->
set_search_type
(
ABOOK_QUERY_BEGINS_WITH
);
addrbook
->
set_search_type
(
ABOOK_QUERY_BEGINS_WITH
);
}
else
if
(
g_strcmp0
(
"Search contains"
,
gtk_menu_item_get_label
(
GTK_MENU_ITEM
(
item
)))
==
0
)
{
factory
->
addrbook
->
set_search_type
(
ABOOK_QUERY_CONTAINS
);
addrbook
->
set_search_type
(
ABOOK_QUERY_CONTAINS
);
}
AddressBook_Config
*
addressbook_config
;
addressbook_config_load_parameters
(
&
addressbook_config
);
factory
->
addrbook
->
search
(
factory
->
addrbook
->
search_cb
,
GTK_ENTRY
(
addressbookentry
),
addressbook_config
);
AddressBook_Config
*
addressbook_config
=
addressbook_config_load_parameters
();
addrbook
->
search
(
addrbook
->
search_cb
,
GTK_ENTRY
(
addressbookentry
),
addressbook_config
);
}
}
...
...
@@ -388,19 +374,16 @@ GtkWidget* contacts_searchbar_new ()
liststore
=
gtk_list_store_new
(
1
,
G_TYPE_STRING
);
// Create combo box to select current addressbook
if
(
!
a
bookfactory_is_addressbook_loaded
())
{
if
(
!
a
ddrbook
)
return
NULL
;
}
book_list
=
dbus_get_addressbook_list
();
AddrBookFactory
*
factory
=
abookfactory_get_factory
();
factory
->
addrbook
->
init
(
book_list
);
addrbook
->
init
(
book_list
);
GSList
*
book_list_iterator
;
book_data_t
*
book_data
;
GSList
*
books_data
=
factory
->
addrbook
->
get_books_data
(
book_list
);
GSList
*
books_data
=
addrbook
->
get_books_data
(
book_list
);
// Populate menu
count
=
0
;
...
...
gnome/src/dbus/dbus.c
View file @
53622593
...
...
@@ -1762,12 +1762,9 @@ dbus_get_audio_manager (void)
GHashTable
*
dbus_get_addressbook_settings
(
void
)
{
GError
*
error
=
NULL
;
GHashTable
*
results
=
NULL
;
//DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings");
org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings
(
configurationManagerProxy
,
&
results
,
&
error
);
...
...
gnome/src/uimanager.c
View file @
53622593
...
...
@@ -114,7 +114,7 @@ update_actions()
g_object_ref
(
recordWidget_
);
g_object_ref
(
holdToolbar_
);
g_object_ref
(
offHoldToolbar_
);
if
(
a
bookfactory_is_addressbook_loaded
()
)
if
(
a
ddrbook
)
g_object_ref
(
contactButton_
);
g_object_ref
(
historyButton_
);
...
...
@@ -127,7 +127,7 @@ update_actions()
remove_from_toolbar
(
transferToolbar_
);
remove_from_toolbar
(
historyButton_
);
if
(
a
bookfactory_is_addressbook_loaded
()
)
if
(
a
ddrbook
)
remove_from_toolbar
(
contactButton_
);
remove_from_toolbar
(
voicemailToolbar_
);
...
...
@@ -140,11 +140,11 @@ update_actions()
gtk_widget_set_sensitive
(
recordWidget_
,
FALSE
);
gtk_action_set_sensitive
(
copyAction_
,
FALSE
);
if
(
a
bookfactory_is_addressbook_loaded
()
)
if
(
a
ddrbook
)
gtk_widget_set_sensitive
(
contactButton_
,
FALSE
);
gtk_widget_set_sensitive
(
historyButton_
,
FALSE
);
if
(
a
bookfactory_is_addressbook_loaded
()
)
if
(
a
ddrbook
)
gtk_widget_set_tooltip_text
(
contactButton_
,
_
(
"No address book selected"
));
remove_from_toolbar
(
holdToolbar_
);
...
...
@@ -163,16 +163,14 @@ update_actions()
}
// If addressbook support has been enabled and all addressbooks are loaded, display the icon
if
(
abookfactory_is_addressbook_loaded
())
{
AddrBookFactory
*
bookFactory
=
abookfactory_get_factory
();
AddressBook_Config
*
addressbook_config
;
addressbook_config_load_parameters
(
&
addressbook_config
);
if
(
addrbook
)
{
AddressBook_Config
*
addressbook_config
=
addressbook_config_load_parameters
();
if
(
addressbook_config
->
enable
&&
bookFactory
->
addrbook
->
is_ready
())
{
if
(
addressbook_config
->
enable
&&
addrbook
->
is_ready
())
{
gtk_toolbar_insert
(
GTK_TOOLBAR
(
toolbar_
),
GTK_TOOL_ITEM
(
contactButton_
),
-
1
);
// Make the icon clickable only if at least one address book is active
if
(
bookFactory
->
addrbook
->
is_active
())
{
if
(
addrbook
->
is_active
())
{
gtk_widget_set_sensitive
(
contactButton_
,
TRUE
);
gtk_widget_set_tooltip_text
(
contactButton_
,
_
(
"Address book"
));
}
...
...
@@ -1041,7 +1039,7 @@ static const GtkToggleActionEntry toggle_menu_entries[] = {
GtkUIManager
*
uimanager_new
(
void
)
{
gint
nb_entries
=
a
bookfactory_is_addressbook_loaded
()
?
7
:
6
;
gint
nb_entries
=
a
ddrbook
?
7
:
6
;
GtkWidget
*
window
=
get_main_window
();
GtkUIManager
*
ui_manager
=
gtk_ui_manager_new
();
...
...
@@ -1065,7 +1063,7 @@ GtkUIManager *uimanager_new(void)
g_free
(
path
);
if
(
a
bookfactory_is_addressbook_loaded
()
)
{
if
(
a
ddrbook
)
{
// These actions must be loaded dynamically and is not specified in the xml description
gtk_ui_manager_add_ui
(
ui_manager
,
manager_id
,
"/ViewMenu"
,
"Addressbook"
,
...
...
@@ -1581,7 +1579,7 @@ create_toolbar_actions(GtkUIManager *ui_manager)
"/ToolbarActions/StartPlaybackRecordToolbar"
);
stopRecordWidget_
=
gtk_ui_manager_get_widget
(
ui_manager
,
"/ToolbarActions/StopPlaybackRecordToolbar"
);
if
(
a
bookfactory_is_addressbook_loaded
()
)
if
(
a
ddrbook
)
contactButton_
=
gtk_ui_manager_get_widget
(
ui_manager
,
"/ToolbarActions/AddressbookToolbar"
);
// Set the handler ID for the transfer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment