Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
cf0a4a89
Commit
cf0a4a89
authored
13 years ago
by
Rafaël Carré
Browse files
Options
Downloads
Patches
Plain Diff
uimanager_new() : simplify
parent
0d02b874
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
gnome/src/mainwindow.c
+2
-3
2 additions, 3 deletions
gnome/src/mainwindow.c
gnome/src/uimanager.c
+23
-37
23 additions, 37 deletions
gnome/src/uimanager.c
gnome/src/uimanager.h
+1
-1
1 addition, 1 deletion
gnome/src/uimanager.h
with
26 additions
and
41 deletions
gnome/src/mainwindow.c
+
2
−
3
View file @
cf0a4a89
...
@@ -184,7 +184,6 @@ create_main_window ()
...
@@ -184,7 +184,6 @@ create_main_window ()
{
{
GtkWidget
*
widget
;
GtkWidget
*
widget
;
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
gboolean
ret
;
const
char
*
window_title
=
"SFLphone VoIP Client"
;
const
char
*
window_title
=
"SFLphone VoIP Client"
;
int
width
,
height
,
position_x
,
position_y
;
int
width
,
height
,
position_x
,
position_y
;
...
@@ -226,9 +225,9 @@ create_main_window ()
...
@@ -226,9 +225,9 @@ create_main_window ()
gtk_widget_set_name
(
window
,
"mainwindow"
);
gtk_widget_set_name
(
window
,
"mainwindow"
);
ret
=
uimanager_new
(
&
ui_manager
);
ui_manager
=
uimanager_new
();
if
(
!
ret
)
{
if
(
!
ui_manager
)
{
ERROR
(
"Could not load xml GUI
\n
"
);
ERROR
(
"Could not load xml GUI
\n
"
);
g_error_free
(
error
);
g_error_free
(
error
);
exit
(
1
);
exit
(
1
);
...
...
This diff is collapsed.
Click to expand it.
gnome/src/uimanager.c
+
23
−
37
View file @
cf0a4a89
...
@@ -1108,52 +1108,32 @@ static const GtkToggleActionEntry toggle_menu_entries[] = {
...
@@ -1108,52 +1108,32 @@ static const GtkToggleActionEntry toggle_menu_entries[] = {
{
"Addressbook"
,
GTK_STOCK_ADDRESSBOOK
,
N_
(
"_Address book"
),
NULL
,
N_
(
"Address book"
),
G_CALLBACK
(
toggle_addressbook_cb
),
FALSE
}
{
"Addressbook"
,
GTK_STOCK_ADDRESSBOOK
,
N_
(
"_Address book"
),
NULL
,
N_
(
"Address book"
),
G_CALLBACK
(
toggle_addressbook_cb
),
FALSE
}
};
};
gboolean
GtkUIManager
*
uimanager_new
(
void
)
uimanager_new
(
GtkUIManager
**
_ui_manager
)
{
{
guint
manager_id
;
GtkUIManager
*
ui_manager
;
GtkActionGroup
*
action_group
;
GtkWidget
*
window
;
gchar
*
path
;
guint
manager_id
=
0
;
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
gint
nb_entries
,
nb_menu_entries
;
nb_entries
=
abookfactory_is_addressbook_loaded
()
?
7
:
6
;
nb_menu_entries
=
abookfactory_is_addressbook_loaded
()
?
7
:
6
;
gint
nb_entries
=
abookfactory_is_addressbook_loaded
()
?
7
:
6
;
window
=
get_main_window
();
GtkWidget
*
window
=
get_main_window
();
ui_manager
=
gtk_ui_manager_new
();
GtkUIManager
*
ui_manager
=
gtk_ui_manager_new
();
/* Create an accel group for window's shortcuts */
/* Create an accel group for window's shortcuts */
path
=
g_build_filename
(
SFLPHONE_UIDIR_UNINSTALLED
,
"./ui.xml"
,
NULL
);
gchar
*
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
))
{
manager_id
=
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
)
{
g_error_free
(
error
);
return
FALSE
;
}
g_free
(
path
);
}
else
{
}
else
{
g_free
(
path
);
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
))
{
goto
fail
;
manager_id
=
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
)
{
g_error_free
(
error
);
return
FALSE
;
}
}
if
(
error
)
goto
fail
;
g_free
(
path
);
g_free
(
path
);
}
else
return
FALSE
;
}
if
(
abookfactory_is_addressbook_loaded
())
{
if
(
abookfactory_is_addressbook_loaded
())
{
// These actions must be loaded dynamically and is not specified in the xml description
// These actions must be loaded dynamically and is not specified in the xml description
...
@@ -1167,7 +1147,7 @@ uimanager_new (GtkUIManager **_ui_manager)
...
@@ -1167,7 +1147,7 @@ uimanager_new (GtkUIManager **_ui_manager)
GTK_UI_MANAGER_TOOLITEM
,
FALSE
);
GTK_UI_MANAGER_TOOLITEM
,
FALSE
);
}
}
action_group
=
gtk_action_group_new
(
"SFLphoneWindowActions"
);
GtkActionGroup
*
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"
);
gtk_action_group_add_actions
(
action_group
,
menu_entries
,
G_N_ELEMENTS
(
menu_entries
),
window
);
gtk_action_group_add_actions
(
action_group
,
menu_entries
,
G_N_ELEMENTS
(
menu_entries
),
window
);
...
@@ -1175,9 +1155,15 @@ uimanager_new (GtkUIManager **_ui_manager)
...
@@ -1175,9 +1155,15 @@ uimanager_new (GtkUIManager **_ui_manager)
//gtk_action_group_add_radio_actions (action_group, radio_menu_entries, G_N_ELEMENTS (radio_menu_entries), CALLTREE_CALLS, G_CALLBACK (calltree_switch_cb), window);
//gtk_action_group_add_radio_actions (action_group, radio_menu_entries, G_N_ELEMENTS (radio_menu_entries), CALLTREE_CALLS, G_CALLBACK (calltree_switch_cb), window);
gtk_ui_manager_insert_action_group
(
ui_manager
,
action_group
,
0
);
gtk_ui_manager_insert_action_group
(
ui_manager
,
action_group
,
0
);
*
_ui_manager
=
ui_manager
;
return
ui_manager
;
return
TRUE
;
fail:
if
(
error
)
g_error_free
(
error
);
g_free
(
path
);
g_free
(
ui_manager
);
return
NULL
;
}
}
static
void
static
void
...
...
This diff is collapsed.
Click to expand it.
gnome/src/uimanager.h
+
1
−
1
View file @
cf0a4a89
...
@@ -42,7 +42,7 @@ GtkWidget *contactButton;
...
@@ -42,7 +42,7 @@ GtkWidget *contactButton;
GtkAction
*
volumeToggle
;
GtkAction
*
volumeToggle
;
gboolean
uimanager_new
(
GtkUIManager
**
);
GtkUIManager
*
uimanager_new
(
void
);
void
update_voicemail_status
(
void
);
void
update_voicemail_status
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment