Skip to content
Snippets Groups Projects
Commit 1a3cdf1a authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#6065: Fix addressbook action runtime warning in uimanager

parent 3935e463
Branches
Tags
No related merge requests found
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
<menuitem action="Toolbar"/> <menuitem action="Toolbar"/>
<separator/> <separator/>
<menuitem action="Dialpad"/> <menuitem action="Dialpad"/>
<!--menuitem name="VolumeControlsToggle" action="VolumeControls"/-->
<menuitem action="VolumeControls"/> <menuitem action="VolumeControls"/>
<separator/> <separator/>
<menuitem action="History"/> <menuitem action="History"/>
...@@ -56,7 +55,7 @@ ...@@ -56,7 +55,7 @@
<separator/> <separator/>
<toolitem name="VoicemailToolbar" action="Voicemail"/> <toolitem name="VoicemailToolbar" action="Voicemail"/>
<toolitem name="HistoryToolbar" action="History"/> <toolitem name="HistoryToolbar" action="History"/>
<toolitem name="AddressbookToolbar" action="Addressbook"/> <!-- <toolitem name="AddressbookToolbar" action="Addressbook"/> -->
</toolbar> </toolbar>
<popup name="PopupMenu"> <popup name="PopupMenu">
......
...@@ -982,6 +982,7 @@ uimanager_new (GtkUIManager **_ui_manager) ...@@ -982,6 +982,7 @@ uimanager_new (GtkUIManager **_ui_manager)
GtkActionGroup *action_group; GtkActionGroup *action_group;
GtkWidget *window; GtkWidget *window;
gchar *path; gchar *path;
guint manager_id = 0;
GError *error = NULL; GError *error = NULL;
gint nb_entries; gint nb_entries;
...@@ -994,7 +995,7 @@ uimanager_new (GtkUIManager **_ui_manager) ...@@ -994,7 +995,7 @@ uimanager_new (GtkUIManager **_ui_manager)
path = g_build_filename (SFLPHONE_UIDIR_UNINSTALLED, "./ui.xml", NULL); path = g_build_filename (SFLPHONE_UIDIR_UNINSTALLED, "./ui.xml", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS)) { if (g_file_test (path, G_FILE_TEST_EXISTS)) {
gtk_ui_manager_add_ui_from_file (ui_manager, path, &error); manager_id = gtk_ui_manager_add_ui_from_file (ui_manager, path, &error);
if (error != NULL) { if (error != NULL) {
g_error_free (error); g_error_free (error);
...@@ -1006,7 +1007,7 @@ uimanager_new (GtkUIManager **_ui_manager) ...@@ -1006,7 +1007,7 @@ uimanager_new (GtkUIManager **_ui_manager)
path = g_build_filename (SFLPHONE_UIDIR, "./ui.xml", NULL); path = g_build_filename (SFLPHONE_UIDIR, "./ui.xml", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS)) { if (g_file_test (path, G_FILE_TEST_EXISTS)) {
gtk_ui_manager_add_ui_from_file (ui_manager, path, &error); manager_id = gtk_ui_manager_add_ui_from_file (ui_manager, path, &error);
if (error != NULL) { if (error != NULL) {
g_error_free (error); g_error_free (error);
...@@ -1018,6 +1019,13 @@ uimanager_new (GtkUIManager **_ui_manager) ...@@ -1018,6 +1019,13 @@ uimanager_new (GtkUIManager **_ui_manager)
return FALSE; return FALSE;
} }
if(abookfactory_is_addressbook_loaded()) {
gtk_ui_manager_add_ui(ui_manager, manager_id, "/ToolbarActions",
"AddressbookToolbar",
"Addressbook",
GTK_UI_MANAGER_TOOLITEM, FALSE);
}
action_group = gtk_action_group_new ("SFLphoneWindowActions"); action_group = gtk_action_group_new ("SFLphoneWindowActions");
// To translate label and tooltip entries // To translate label and tooltip entries
gtk_action_group_set_translation_domain (action_group, "sflphone-client-gnome"); gtk_action_group_set_translation_domain (action_group, "sflphone-client-gnome");
...@@ -1672,8 +1680,7 @@ create_toolbar_actions (GtkUIManager *ui_manager, GtkWidget **widget) ...@@ -1672,8 +1680,7 @@ create_toolbar_actions (GtkUIManager *ui_manager, GtkWidget **widget)
historyButton = gtk_ui_manager_get_widget (ui_manager, historyButton = gtk_ui_manager_get_widget (ui_manager,
"/ToolbarActions/HistoryToolbar"); "/ToolbarActions/HistoryToolbar");
if(abookfactory_is_addressbook_loaded()) { if(abookfactory_is_addressbook_loaded()) {
contactButton = gtk_ui_manager_get_widget (ui_manager, contactButton = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/AddressbookToolbar");
"/ToolbarActions/AddressbookToolbar");
} }
// Set the handler ID for the transfer // Set the handler ID for the transfer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment