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
6c8e8710
Commit
6c8e8710
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#2623] Added text entry to display local IP address in configurationmanager
parent
a5da339b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-client-gnome/src/config/accountconfigdialog.c
+130
-107
130 additions, 107 deletions
sflphone-client-gnome/src/config/accountconfigdialog.c
with
130 additions
and
107 deletions
sflphone-client-gnome/src/config/accountconfigdialog.c
+
130
−
107
View file @
6c8e8710
...
...
@@ -67,6 +67,7 @@ GtkWidget * advancedZrtpButton;
GtkWidget
*
keyExchangeCombo
;
GtkWidget
*
useSipTlsCheckBox
;
GtkWidget
*
localAddressEntry
;
GtkWidget
*
publishedAddressEntry
;
GtkWidget
*
localAddressLabel
;
GtkWidget
*
localAddressCombo
;
...
...
@@ -562,17 +563,20 @@ static local_interface_changed_cb(GtkWidget * widget, gpointer data UNUSED) {
if
(
gtk_toggle_button_get_active
(
GTK_TOGGLE_BUTTON
(
sameAsLocalRadioButton
)))
{
gchar
*
local_interface
;
gchar
*
local_address
;
gchar
*
local_iface_name
;
gchar
*
local_iface_addr
;
local_iface_addr
=
g_malloc
(
36
);
local_i
nterfac
e
=
(
gchar
*
)
gtk_combo_box_get_active_text
(
GTK_COMBO_BOX
(
localAddressCombo
));
local_i
face_nam
e
=
(
gchar
*
)
gtk_combo_box_get_active_text
(
GTK_COMBO_BOX
(
localAddressCombo
));
// sflphone_get_interface_addr_from_name((char *)local_interface);
local_address
=
dbus_get
_addr
ess
_from_
inter
face_name
(
local_i
nter
face
);
sflphone_get_interface
_addr_from_
name
(
local_i
face_name
,
&
local_iface
_addr
);
gtk_entry_set_text
(
GTK_ENTRY
(
publishedAddressEntry
),
local_address
);
gtk_entry_set_text
(
GTK_ENTRY
(
localAddressEntry
),
local_iface_addr
);
gtk_entry_set_text
(
GTK_ENTRY
(
publishedAddressEntry
),
local_iface_addr
);
// gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox));
// gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL));
g_free
(
local_iface_addr
);
}
}
...
...
@@ -901,7 +905,7 @@ GtkWidget* create_network (account_t **a) {
local_port
=
g_hash_table_lookup
((
*
a
)
->
properties
,
LOCAL_PORT
);
}
gnome_main_section_new_with_table
(
_
(
"Network Interface"
),
&
frame
,
&
table
,
2
,
2
);
gnome_main_section_new_with_table
(
_
(
"Network Interface"
),
&
frame
,
&
table
,
2
,
3
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
table
),
10
);
gtk_table_set_row_spacings
(
GTK_TABLE
(
table
),
5
);
...
...
@@ -918,7 +922,7 @@ GtkWidget* create_network (account_t **a) {
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
0
,
1
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
GtkTreeIter
current_local_
address
_iter
=
iter
;
GtkTreeIter
current_local_
iface
_iter
=
iter
;
gchar
**
iface_list
=
NULL
;
// iface_list = (gchar**) dbus_get_all_ip_interface();
iface_list
=
(
gchar
**
)
dbus_get_all_ip_interface_by_name
();
...
...
@@ -927,6 +931,11 @@ GtkWidget* create_network (account_t **a) {
// flag to determine if local_address is found
gboolean
iface_found
=
FALSE
;
gchar
*
local_iface_addr
;
gchar
*
local_iface_name
;
local_iface_addr
=
g_malloc
(
18
);
if
(
iface_list
!=
NULL
)
{
// fill the iterface combo box
...
...
@@ -938,28 +947,42 @@ GtkWidget* create_network (account_t **a) {
// set the current local address
if
(
!
iface_found
&&
(
g_strcmp0
(
*
iface
,
local_interface
)
==
0
))
{
DEBUG
(
"Setting active local address combo box"
);
current_local_
address
_iter
=
iter
;
current_local_
iface
_iter
=
iter
;
iface_found
=
TRUE
;
}
}
if
(
!
iface_found
)
{
DEBUG
(
"Did not find local ip address, take fisrt in the list"
);
gtk_tree_model_get_iter_first
(
GTK_TREE_MODEL
(
ipInterfaceListStore
),
&
current_local_
address
_iter
);
gtk_tree_model_get_iter_first
(
GTK_TREE_MODEL
(
ipInterfaceListStore
),
&
current_local_
iface
_iter
);
}
}
localAddressCombo
=
gtk_combo_box_new_with_model
(
GTK_TREE_MODEL
(
ipInterfaceListStore
));
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
label
),
localAddressCombo
);
gtk_table_attach
(
GTK_TABLE
(
table
),
localAddressCombo
,
1
,
2
,
0
,
1
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
g_object_unref
(
G_OBJECT
(
ipInterfaceListStore
));
GtkCellRenderer
*
ipInterfaceCellRenderer
;
ipInterfaceCellRenderer
=
gtk_cell_renderer_text_new
();
gtk_cell_layout_pack_start
(
GTK_CELL_LAYOUT
(
localAddressCombo
),
ipInterfaceCellRenderer
,
TRUE
);
gtk_cell_layout_set_attributes
(
GTK_CELL_LAYOUT
(
localAddressCombo
),
ipInterfaceCellRenderer
,
"text"
,
0
,
NULL
);
gtk_combo_box_set_active_iter
(
GTK_COMBO_BOX
(
localAddressCombo
),
&
current_local_address_iter
);
gtk_combo_box_set_active_iter
(
GTK_COMBO_BOX
(
localAddressCombo
),
&
current_local_iface_iter
);
// Fill the text entry with the ip address of local interface selected
localAddressEntry
=
gtk_entry_new
();
local_iface_name
=
(
gchar
*
)
gtk_combo_box_get_active_text
(
GTK_COMBO_BOX
(
localAddressCombo
));
sflphone_get_interface_addr_from_name
(
local_iface_name
,
&
local_iface_addr
);
gtk_entry_set_text
(
GTK_ENTRY
(
localAddressEntry
),
local_iface_addr
);
gtk_widget_set_sensitive
(
localAddressEntry
,
FALSE
);
gtk_table_attach
(
GTK_TABLE
(
table
),
localAddressEntry
,
2
,
3
,
0
,
1
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
g_free
(
local_iface_addr
);
// Local port widget
label
=
gtk_label_new_with_mnemonic
(
_
(
"Local port"
));
...
...
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