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
9ae4cfbf
Commit
9ae4cfbf
authored
13 years ago
by
Rafaël Carré
Browse files
Options
Downloads
Patches
Plain Diff
tlsadvanceddialog: simplify
parent
c1e63da3
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
gnome/src/config/tlsadvanceddialog.c
+16
-40
16 additions, 40 deletions
gnome/src/config/tlsadvanceddialog.c
with
16 additions
and
40 deletions
gnome/src/config/tlsadvanceddialog.c
+
16
−
40
View file @
9ae4cfbf
...
...
@@ -43,10 +43,7 @@
void
show_advanced_tls_options
(
GHashTable
*
properties
)
{
GtkDialog
*
tlsDialog
;
GtkWidget
*
ret
;
tlsDialog
=
GTK_DIALOG
(
gtk_dialog_new_with_buttons
(
_
(
"Advanced options for TLS"
),
GtkDialog
*
tlsDialog
=
GTK_DIALOG
(
gtk_dialog_new_with_buttons
(
_
(
"Advanced options for TLS"
),
GTK_WINDOW
(
get_main_window
()),
GTK_DIALOG_MODAL
|
GTK_DIALOG_DESTROY_WITH_PARENT
,
GTK_STOCK_CANCEL
,
...
...
@@ -58,7 +55,7 @@ void show_advanced_tls_options (GHashTable * properties)
gtk_window_set_resizable
(
GTK_WINDOW
(
tlsDialog
),
FALSE
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
tlsDialog
),
0
);
ret
=
gtk_vbox_new
(
FALSE
,
10
);
GtkWidget
*
ret
=
gtk_vbox_new
(
FALSE
,
10
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
ret
),
10
);
gtk_box_pack_start
(
GTK_BOX
(
gtk_dialog_get_content_area
(
tlsDialog
)),
ret
,
FALSE
,
FALSE
,
0
);
...
...
@@ -71,8 +68,8 @@ void show_advanced_tls_options (GHashTable * properties)
"require secure sip transactions (aka SIPS). You can configure a different
\n
"
\
"TLS transport for each account. However, each of them will run on a dedicated
\n
"
\
"port, different one from each other
\n
"
));
GtkWidget
*
label
;
label
=
gtk_label_new
(
NULL
);
GtkWidget
*
label
=
gtk_label_new
(
NULL
);
gtk_widget_set_size_request
(
label
,
600
,
70
);
gtk_label_set_line_wrap
(
GTK_LABEL
(
label
),
TRUE
);
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
...
...
@@ -117,10 +114,9 @@ void show_advanced_tls_options (GHashTable * properties)
label
=
gtk_label_new
(
_
(
"Global TLS listener (all accounts)"
));
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
2
,
3
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
GtkWidget
*
tlsListenerPort
;
GtkWidget
*
hbox
=
gtk_hbox_new
(
FALSE
,
10
);
gtk_table_attach
(
GTK_TABLE
(
table
),
hbox
,
1
,
2
,
2
,
3
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
tlsListenerPort
=
gtk_spin_button_new_with_range
(
0
,
65535
,
1
);
GtkWidget
*
tlsListenerPort
=
gtk_spin_button_new_with_range
(
0
,
65535
,
1
);
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
label
),
tlsListenerPort
);
gtk_spin_button_set_value
(
GTK_SPIN_BUTTON
(
tlsListenerPort
),
g_ascii_strtod
(
tls_listener_port
,
NULL
));
gtk_box_pack_start
(
GTK_BOX
(
hbox
),
tlsListenerPort
,
TRUE
,
TRUE
,
0
);
...
...
@@ -132,42 +128,30 @@ void show_advanced_tls_options (GHashTable * properties)
label
=
gtk_label_new
(
_
(
"Certificate of Authority list"
));
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
3
,
4
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
GtkWidget
*
caListFileChooser
;
caListFileChooser
=
gtk_file_chooser_button_new
(
_
(
"Choose a CA list file (optional)"
),
GTK_FILE_CHOOSER_ACTION_OPEN
);
GtkWidget
*
caListFileChooser
=
gtk_file_chooser_button_new
(
_
(
"Choose a CA list file (optional)"
),
GTK_FILE_CHOOSER_ACTION_OPEN
);
gtk_table_attach
(
GTK_TABLE
(
table
),
caListFileChooser
,
1
,
2
,
3
,
4
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
if
(
tls_ca_list_file
==
NULL
)
{
gtk_file_chooser_unselect_all
(
GTK_FILE_CHOOSER
(
caListFileChooser
));
}
else
{
if
(
g_strcmp0
(
tls_ca_list_file
,
""
)
==
0
)
{
if
(
!
tls_ca_list_file
||
!*
tls_ca_list_file
)
{
gtk_file_chooser_unselect_all
(
GTK_FILE_CHOOSER
(
caListFileChooser
));
}
else
{
GFile
*
file
=
g_file_new_for_path
(
tls_ca_list_file
);
gtk_file_chooser_set_file
(
GTK_FILE_CHOOSER
(
caListFileChooser
),
file
,
NULL
);
g_object_unref
(
file
);
}
}
label
=
gtk_label_new
(
_
(
"Public endpoint certificate file"
));
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
GtkWidget
*
certificateFileChooser
;
certificateFileChooser
=
gtk_file_chooser_button_new
(
_
(
"Choose a public endpoint certificate (optional)"
),
GTK_FILE_CHOOSER_ACTION_OPEN
);
GtkWidget
*
certificateFileChooser
=
gtk_file_chooser_button_new
(
_
(
"Choose a public endpoint certificate (optional)"
),
GTK_FILE_CHOOSER_ACTION_OPEN
);
gtk_table_attach
(
GTK_TABLE
(
table
),
certificateFileChooser
,
1
,
2
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
if
(
tls_certificate_file
==
NULL
)
{
// gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(caListFileChooser), g_get_home_dir());
if
(
!
tls_certificate_file
)
{
gtk_file_chooser_unselect_all
(
GTK_FILE_CHOOSER
(
caListFileChooser
));
}
else
{
if
(
g_strcmp0
(
tls_certificate_file
,
""
)
==
0
)
{
if
(
!*
tls_certificate_file
)
{
gtk_file_chooser_unselect_all
(
GTK_FILE_CHOOSER
(
certificateFileChooser
));
}
else
{
GFile
*
file
=
g_file_new_for_path
(
tls_certificate_file
);
gtk_file_chooser_set_file
(
GTK_FILE_CHOOSER
(
certificateFileChooser
),
file
,
NULL
);
g_object_unref
(
file
);
...
...
@@ -181,21 +165,16 @@ void show_advanced_tls_options (GHashTable * properties)
privateKeyFileChooser
=
gtk_file_chooser_button_new
(
_
(
"Choose a private key file (optional)"
),
GTK_FILE_CHOOSER_ACTION_OPEN
);
gtk_table_attach
(
GTK_TABLE
(
table
),
privateKeyFileChooser
,
1
,
2
,
5
,
6
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
if
(
tls_private_key_file
==
NULL
)
{
if
(
!
tls_private_key_file
==
NULL
)
{
gtk_file_chooser_unselect_all
(
GTK_FILE_CHOOSER
(
caListFileChooser
));
}
else
{
if
(
g_strcmp0
(
tls_private_key_file
,
""
)
==
0
)
{
if
(
!*
tls_private_key_file
)
{
gtk_file_chooser_unselect_all
(
GTK_FILE_CHOOSER
(
privateKeyFileChooser
));
}
else
{
GFile
*
file
=
g_file_new_for_path
(
tls_private_key_file
);
gtk_file_chooser_set_file
(
GTK_FILE_CHOOSER
(
privateKeyFileChooser
),
file
,
NULL
);
g_object_unref
(
file
);
}
}
label
=
gtk_label_new_with_mnemonic
(
_
(
"Password for the private key"
));
...
...
@@ -227,15 +206,12 @@ void show_advanced_tls_options (GHashTable * properties)
GtkTreeIter
supported_tls_method_iter
=
iter
;
for
(
char
**
supported_tls_method_ptr
=
supported_tls_method
;
supported_tls_method_ptr
&&
*
supported_tls_method_ptr
;
supported_tls_method_ptr
++
)
{
DEBUG
(
"Supported Method %s"
,
*
supported_tls_method_ptr
);
gtk_list_store_append
(
tlsProtocolMethodListStore
,
&
iter
);
gtk_list_store_set
(
tlsProtocolMethodListStore
,
&
iter
,
0
,
*
supported_tls_method_ptr
,
-
1
);
if
(
g_strcmp0
(
*
supported_tls_method_ptr
,
tls_method
)
==
0
)
{
DEBUG
(
"Setting active element in TLS protocol combo box"
);
if
(
g_strcmp0
(
*
supported_tls_method_ptr
,
tls_method
)
==
0
)
supported_tls_method_iter
=
iter
;
}
}
GtkWidget
*
tlsProtocolMethodCombo
=
gtk_combo_box_new_with_model
(
GTK_TREE_MODEL
(
tlsProtocolMethodListStore
));
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
label
),
tlsProtocolMethodCombo
);
...
...
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