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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
aa65f7c5
Commit
aa65f7c5
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#2383] Separate network interface and published address in account config
parent
191e6ca0
No related branches found
No related tags found
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
+50
-30
50 additions, 30 deletions
sflphone-client-gnome/src/config/accountconfigdialog.c
with
50 additions
and
30 deletions
sflphone-client-gnome/src/config/accountconfigdialog.c
+
50
−
30
View file @
aa65f7c5
...
@@ -67,9 +67,11 @@ GtkWidget * useSipTlsCheckBox;
...
@@ -67,9 +67,11 @@ GtkWidget * useSipTlsCheckBox;
GtkWidget
*
publishedAddressEntry
;
GtkWidget
*
publishedAddressEntry
;
GtkWidget
*
localAddressCombo
;
GtkWidget
*
localAddressCombo
;
GtkWidget
*
useStun
RadioButton
;
GtkWidget
*
useStun
CheckBox
;
GtkWidget
*
sameAsLocalRadioButton
;
GtkWidget
*
sameAsLocalRadioButton
;
GtkWidget
*
publishedAddrRadioButton
;
GtkWidget
*
publishedAddrRadioButton
;
GtkWidget
*
sameAsLocalLabel
;
GtkWidget
*
publishedAddrLabel
;
GtkWidget
*
publishedPortSpinBox
;
GtkWidget
*
publishedPortSpinBox
;
GtkWidget
*
localPortSpinBox
;
GtkWidget
*
localPortSpinBox
;
GtkWidget
*
publishedAddressLabel
;
GtkWidget
*
publishedAddressLabel
;
...
@@ -599,9 +601,14 @@ static use_stun_cb(GtkWidget * widget, gpointer data UNUSED)
...
@@ -599,9 +601,14 @@ static use_stun_cb(GtkWidget * widget, gpointer data UNUSED)
DEBUG
(
"Showing stun options"
);
DEBUG
(
"Showing stun options"
);
gtk_widget_show
(
stunServerLabel
);
gtk_widget_show
(
stunServerLabel
);
gtk_widget_show
(
stunServerEntry
);
gtk_widget_show
(
stunServerEntry
);
gtk_widget_set_sensitive
(
sameAsLocalRadioButton
,
FALSE
);
gtk_widget_set_sensitive
(
publishedAddrRadioButton
,
FALSE
);
}
else
{
}
else
{
gtk_widget_hide
(
stunServerLabel
);
gtk_widget_hide
(
stunServerLabel
);
gtk_widget_hide
(
stunServerEntry
);
gtk_widget_hide
(
stunServerEntry
);
gtk_widget_set_sensitive
(
sameAsLocalRadioButton
,
TRUE
);
gtk_widget_set_sensitive
(
publishedAddrRadioButton
,
TRUE
);
// sameAsLocalLabel
}
}
}
}
...
@@ -693,7 +700,7 @@ GtkWidget * create_advanced_tab(account_t **a)
...
@@ -693,7 +700,7 @@ GtkWidget * create_advanced_tab(account_t **a)
gtk_widget_set_sensitive
(
GTK_WIDGET
(
entryResolveNameOnlyOnce
)
,
TRUE
);
gtk_widget_set_sensitive
(
GTK_WIDGET
(
entryResolveNameOnlyOnce
)
,
TRUE
);
gnome_main_section_new_with_table
(
_
(
"Network"
),
&
frame
,
&
table
,
2
,
3
);
gnome_main_section_new_with_table
(
_
(
"Network
Interface
"
),
&
frame
,
&
table
,
2
,
2
);
gtk_box_pack_start
(
GTK_BOX
(
ret
),
frame
,
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
ret
),
frame
,
FALSE
,
FALSE
,
0
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
table
),
10
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
table
),
10
);
gtk_table_set_row_spacings
(
GTK_TABLE
(
table
),
5
);
gtk_table_set_row_spacings
(
GTK_TABLE
(
table
),
5
);
...
@@ -753,56 +760,62 @@ GtkWidget * create_advanced_tab(account_t **a)
...
@@ -753,56 +760,62 @@ GtkWidget * create_advanced_tab(account_t **a)
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
localPortSpinBox
,
1
,
2
,
1
,
2
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
localPortSpinBox
,
1
,
2
,
1
,
2
);
label
=
gtk_label_new_with_mnemonic
(
_
(
"Set published address and port:"
));
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
label
,
0
,
2
,
2
,
3
);
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
useStunRadioButton
=
gtk_radio_button_new_with_mnemonic
(
NULL
,
_
(
"Using STUN "
));
gnome_main_section_new_with_table
(
_
(
"Published address"
),
&
frame
,
&
table
,
2
,
3
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
useStunRadioButton
,
0
,
2
,
3
,
4
);
gtk_box_pack_start
(
GTK_BOX
(
ret
),
frame
,
FALSE
,
FALSE
,
0
);
gtk_widget_set_sensitive
(
GTK_WIDGET
(
useStunRadioButton
),
gtk_container_set_border_width
(
GTK_CONTAINER
(
table
),
10
);
gtk_table_set_row_spacings
(
GTK_TABLE
(
table
),
5
);
useStunCheckBox
=
gtk_check_button_new_with_mnemonic
(
_
(
"Using STUN"
));
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
useStunCheckBox
,
0
,
1
,
0
,
1
);
gtk_widget_set_sensitive
(
GTK_WIDGET
(
useStunCheckBox
),
g_strcasecmp
(
use_tls
,
"true"
)
==
0
?
FALSE
:
TRUE
);
g_strcasecmp
(
use_tls
,
"true"
)
==
0
?
FALSE
:
TRUE
);
sameAsLocalRadioButton
=
gtk_radio_button_new_with_mnemonic_from_widget
(
GTK_RADIO_BUTTON
(
useStunRadioButton
),
_
(
"Same as local parameters"
));
stunServerLabel
=
gtk_label_new_with_mnemonic
(
_
(
"STUN server URL"
));
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
sameAsLocalRadioButton
,
0
,
2
,
4
,
5
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
stunServerLabel
,
0
,
1
,
1
,
2
);
gtk_misc_set_alignment
(
GTK_MISC
(
stunServerLabel
),
0
,
0
.
5
);
stunServerEntry
=
gtk_entry_new
();
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
stunServerLabel
),
stunServerEntry
);
gtk_entry_set_text
(
GTK_ENTRY
(
stunServerEntry
),
stun_server
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
stunServerEntry
,
1
,
2
,
1
,
2
);
// label = gtk_label_new_with_mnemonic (_("Set published address and port:"));
// gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 2, 2, 3);
// gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5);
sameAsLocalRadioButton
=
gtk_radio_button_new_with_mnemonic_from_widget
(
NULL
,
_
(
"Same as local parameters"
));
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
sameAsLocalRadioButton
,
0
,
2
,
3
,
4
);
publishedAddrRadioButton
=
gtk_radio_button_new_with_mnemonic_from_widget
(
GTK_RADIO_BUTTON
(
useStun
RadioButton
),
_
(
"
Manually
"
));
publishedAddrRadioButton
=
gtk_radio_button_new_with_mnemonic_from_widget
(
GTK_RADIO_BUTTON
(
sameAsLocal
RadioButton
),
_
(
"
Set published address and port:
"
));
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedAddrRadioButton
,
0
,
2
,
5
,
6
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedAddrRadioButton
,
0
,
2
,
4
,
5
);
gtk_widget_show_all
(
ret
);
gtk_widget_show_all
(
ret
);
publishedAddressLabel
=
gtk_label_new_with_mnemonic
(
_
(
"Published address"
));
publishedAddressLabel
=
gtk_label_new_with_mnemonic
(
_
(
"Published address"
));
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedAddressLabel
,
0
,
1
,
6
,
7
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedAddressLabel
,
0
,
1
,
5
,
6
);
gtk_misc_set_alignment
(
GTK_MISC
(
publishedAddressLabel
),
0
,
0
.
5
);
gtk_misc_set_alignment
(
GTK_MISC
(
publishedAddressLabel
),
0
,
0
.
5
);
publishedAddressEntry
=
gtk_entry_new
();
publishedAddressEntry
=
gtk_entry_new
();
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
publishedAddressLabel
),
publishedAddressEntry
);
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
publishedAddressLabel
),
publishedAddressEntry
);
gtk_entry_set_text
(
GTK_ENTRY
(
publishedAddressEntry
),
published_address
);
gtk_entry_set_text
(
GTK_ENTRY
(
publishedAddressEntry
),
published_address
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedAddressEntry
,
1
,
2
,
6
,
7
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedAddressEntry
,
1
,
2
,
5
,
6
);
publishedPortLabel
=
gtk_label_new_with_mnemonic
(
_
(
"Published port"
));
publishedPortLabel
=
gtk_label_new_with_mnemonic
(
_
(
"Published port"
));
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedPortLabel
,
0
,
1
,
7
,
8
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedPortLabel
,
0
,
1
,
6
,
7
);
gtk_misc_set_alignment
(
GTK_MISC
(
publishedPortLabel
),
0
,
0
.
5
);
gtk_misc_set_alignment
(
GTK_MISC
(
publishedPortLabel
),
0
,
0
.
5
);
publishedPortSpinBox
=
gtk_spin_button_new_with_range
(
1
,
65535
,
1
);
publishedPortSpinBox
=
gtk_spin_button_new_with_range
(
1
,
65535
,
1
);
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
publishedPortLabel
),
publishedPortSpinBox
);
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
publishedPortLabel
),
publishedPortSpinBox
);
gtk_spin_button_set_value
(
GTK_SPIN_BUTTON
(
publishedPortSpinBox
),
g_ascii_strtod
(
published_port
,
NULL
));
gtk_spin_button_set_value
(
GTK_SPIN_BUTTON
(
publishedPortSpinBox
),
g_ascii_strtod
(
published_port
,
NULL
));
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedPortSpinBox
,
1
,
2
,
7
,
8
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
publishedPortSpinBox
,
1
,
2
,
6
,
7
);
stunServerLabel
=
gtk_label_new_with_mnemonic
(
_
(
"STUN server URL"
));
use_stun_cb
(
GTK_WIDGET
(
useStunCheckBox
),
NULL
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
stunServerLabel
,
0
,
1
,
8
,
9
);
gtk_misc_set_alignment
(
GTK_MISC
(
stunServerLabel
),
0
,
0
.
5
);
stunServerEntry
=
gtk_entry_new
();
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
stunServerLabel
),
stunServerEntry
);
gtk_entry_set_text
(
GTK_ENTRY
(
stunServerEntry
),
stun_server
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
stunServerEntry
,
1
,
2
,
8
,
9
);
use_stun_cb
(
GTK_WIDGET
(
useStunRadioButton
),
NULL
);
// This will trigger a signal, and the above two
// This will trigger a signal, and the above two
// widgets need to be instanciated before that.
// widgets need to be instanciated before that.
g_signal_connect
(
useStun
RadioButton
,
"toggled"
,
G_CALLBACK
(
use_stun_cb
),
useStun
RadioButton
);
g_signal_connect
(
useStun
CheckBox
,
"toggled"
,
G_CALLBACK
(
use_stun_cb
),
useStun
CheckBox
);
g_signal_connect
(
sameAsLocalRadioButton
,
"toggled"
,
G_CALLBACK
(
same_as_local_cb
),
sameAsLocalRadioButton
);
g_signal_connect
(
sameAsLocalRadioButton
,
"toggled"
,
G_CALLBACK
(
same_as_local_cb
),
sameAsLocalRadioButton
);
g_signal_connect
(
publishedAddrRadioButton
,
"toggled"
,
G_CALLBACK
(
set_published_addr_manually_cb
),
publishedAddrRadioButton
);
g_signal_connect
(
publishedAddrRadioButton
,
"toggled"
,
G_CALLBACK
(
set_published_addr_manually_cb
),
publishedAddrRadioButton
);
/*
if (g_strcasecmp(stun_enable,"true") == 0) {
if (g_strcasecmp(stun_enable,"true") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useStunRadioButton), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useStunRadioButton), TRUE);
} else if ((g_strcasecmp(published_address, local_address) == 0)
} else if ((g_strcasecmp(published_address, local_address) == 0)
...
@@ -811,7 +824,14 @@ GtkWidget * create_advanced_tab(account_t **a)
...
@@ -811,7 +824,14 @@ GtkWidget * create_advanced_tab(account_t **a)
} else {
} else {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(publishedAddrRadioButton), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(publishedAddrRadioButton), TRUE);
}
}
*/
if
((
g_strcasecmp
(
published_address
,
local_address
)
==
0
)
&&
(
g_strcasecmp
(
published_port
,
local_port
)
==
0
))
{
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
sameAsLocalRadioButton
),
TRUE
);
}
else
{
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
publishedAddrRadioButton
),
TRUE
);
}
return
ret
;
return
ret
;
}
}
...
@@ -955,7 +975,7 @@ show_account_window (account_t * a)
...
@@ -955,7 +975,7 @@ show_account_window (account_t * a)
if
(
strcmp
(
proto
,
"SIP"
)
==
0
)
{
if
(
strcmp
(
proto
,
"SIP"
)
==
0
)
{
g_hash_table_replace
(
currentAccount
->
properties
,
g_strdup
(
ACCOUNT_SIP_STUN_ENABLED
),
g_hash_table_replace
(
currentAccount
->
properties
,
g_strdup
(
ACCOUNT_SIP_STUN_ENABLED
),
g_strdup
(
gtk_toggle_button_get_active
(
GTK_TOGGLE_BUTTON
(
useStun
RadioButton
))
?
"true"
:
"false"
));
g_strdup
(
gtk_toggle_button_get_active
(
GTK_TOGGLE_BUTTON
(
useStun
CheckBox
))
?
"true"
:
"false"
));
g_hash_table_replace
(
currentAccount
->
properties
,
g_strdup
(
ACCOUNT_SIP_STUN_SERVER
),
g_hash_table_replace
(
currentAccount
->
properties
,
g_strdup
(
ACCOUNT_SIP_STUN_SERVER
),
g_strdup
(
gtk_entry_get_text
(
GTK_ENTRY
(
stunServerEntry
))));
g_strdup
(
gtk_entry_get_text
(
GTK_ENTRY
(
stunServerEntry
))));
...
...
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