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
f7c8a107
Commit
f7c8a107
authored
15 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
[#2315] Enable user to display password in clear text
parent
0a931f99
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-client-gnome/src/config/accountconfigdialog.c
+28
-15
28 additions, 15 deletions
sflphone-client-gnome/src/config/accountconfigdialog.c
sflphone-client-gnome/src/config/assistant.c
+23
-7
23 additions, 7 deletions
sflphone-client-gnome/src/config/assistant.c
with
51 additions
and
22 deletions
sflphone-client-gnome/src/config/accountconfigdialog.c
+
28
−
15
View file @
f7c8a107
...
...
@@ -32,6 +32,8 @@
#include
<libsexy/sexy-icon-entry.h>
#endif
#define PW_HIDDEN "*****"
#include
<string.h>
#include
<dbus/dbus.h>
#include
<config.h>
...
...
@@ -44,7 +46,6 @@
* in a private structure.
* Local variables
*/
GtkDialog
*
dialog
;
GtkWidget
*
hbox
;
GtkWidget
*
label
;
...
...
@@ -95,6 +96,14 @@ enum {
COLUMN_CREDENTIAL_COUNT
};
/*
* Display / Hide the password
*/
static
void
show_password_cb
(
GtkWidget
*
widget
,
gpointer
data
)
{
gtk_entry_set_visibility
(
GTK_ENTRY
(
data
),
!
gtk_entry_get_visibility
(
GTK_ENTRY
(
data
)));
}
/* Signal to protocolComboBox 'changed' */
void
change_protocol_cb
(
account_t
*
currentAccount
UNUSED
)
...
...
@@ -133,6 +142,7 @@ static GtkWidget * create_basic_tab(account_t **a)
GtkWidget
*
frame
;
GtkWidget
*
table
;
account_t
*
currentAccount
;
GtkWidget
*
clearTextCheckbox
;
#if GTK_CHECK_VERSION(2,16,0)
#else
GtkWidget
*
image
;
...
...
@@ -172,7 +182,7 @@ static GtkWidget * create_basic_tab(account_t **a)
gnome_main_section_new
(
_
(
"Account Parameters"
),
&
frame
);
gtk_widget_show
(
frame
);
table
=
gtk_table_new
(
9
,
2
,
FALSE
/* homogeneous */
);
table
=
gtk_table_new
(
7
,
2
,
FALSE
/* homogeneous */
);
gtk_table_set_row_spacings
(
GTK_TABLE
(
table
),
10
);
gtk_table_set_col_spacings
(
GTK_TABLE
(
table
),
10
);
gtk_widget_show
(
table
);
...
...
@@ -245,7 +255,7 @@ static GtkWidget * create_basic_tab(account_t **a)
#if GTK_CHECK_VERSION(2,16,0)
entryPassword
=
gtk_entry_new
();
GtkSettings
*
settings
=
gtk_settings_get_default
();
g_object_set
(
G_OBJECT
(
settings
),
"gtk-entry-password-hint-timeout"
,
600
,
NULL
);
//
g_object_set (G_OBJECT (settings), "gtk-entry-password-hint-timeout", 600, NULL);
gtk_entry_set_icon_from_stock
(
GTK_ENTRY
(
entryPassword
),
GTK_ENTRY_ICON_PRIMARY
,
GTK_STOCK_DIALOG_AUTHENTICATION
);
#else
entryPassword
=
sexy_icon_entry_new
();
...
...
@@ -256,16 +266,20 @@ static GtkWidget * create_basic_tab(account_t **a)
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
label
),
entryPassword
);
gtk_entry_set_text
(
GTK_ENTRY
(
entryPassword
),
curPassword
);
gtk_table_attach
(
GTK_TABLE
(
table
),
entryPassword
,
1
,
2
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
g_signal_connect
(
G_OBJECT
(
entryPassword
),
"changed"
,
G_CALLBACK
(
update_credential_cb
),
NULL
);
g_signal_connect
(
G_OBJECT
(
entryPassword
),
"changed"
,
G_CALLBACK
(
update_credential_cb
),
NULL
);
g_object_set_data
(
G_OBJECT
(
entryPassword
),
"column"
,
GINT_TO_POINTER
(
COLUMN_CREDENTIAL_PASSWORD
));
clearTextCheckbox
=
gtk_check_button_new_with_mnemonic
(
_
(
"Show password"
));
g_signal_connect
(
clearTextCheckbox
,
"toggled"
,
G_CALLBACK
(
show_password_cb
),
entryPassword
);
gtk_table_attach
(
GTK_TABLE
(
table
),
clearTextCheckbox
,
1
,
2
,
5
,
6
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
label
=
gtk_label_new_with_mnemonic
(
_
(
"_Voicemail number"
));
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
5
,
6
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
6
,
7
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
entryMailbox
=
gtk_entry_new
();
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
label
),
entryMailbox
);
gtk_entry_set_text
(
GTK_ENTRY
(
entryMailbox
),
curMailbox
);
gtk_table_attach
(
GTK_TABLE
(
table
),
entryMailbox
,
1
,
2
,
5
,
6
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_table_attach
(
GTK_TABLE
(
table
),
entryMailbox
,
1
,
2
,
6
,
7
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_widget_show_all
(
table
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
table
),
10
);
...
...
@@ -274,7 +288,7 @@ static GtkWidget * create_basic_tab(account_t **a)
return
frame
;
}
static
void
fill_treeview_with_credential
(
GtkListStore
*
credentialStore
,
account_t
*
account
)
static
void
fill_treeview_with_credential
(
GtkListStore
*
credentialStore
,
account_t
*
account
)
{
GtkTreeIter
iter
;
gtk_list_store_clear
(
credentialStore
);
...
...
@@ -377,7 +391,7 @@ static void cell_edited_cb(GtkCellRendererText *renderer, gchar *path_desc, gcha
gint
column
=
GPOINTER_TO_INT
(
g_object_get_data
(
G_OBJECT
(
renderer
),
"column"
));
if
(
g_strcasecmp
(
path_desc
,
"0"
)
==
0
)
{
if
(
g_strcasecmp
(
text
,
gtk_entry_get_text
(
GTK_ENTRY
(
entryUsername
)))
!=
0
)
{
if
(
g_strcasecmp
(
text
,
gtk_entry_get_text
(
GTK_ENTRY
(
entryUsername
)))
!=
0
)
{
g_signal_handlers_disconnect_by_func
(
G_OBJECT
(
entryUsername
),
G_CALLBACK
(
update_credential_cb
),
NULL
);
}
}
...
...
@@ -391,7 +405,7 @@ static void cell_edited_cb(GtkCellRendererText *renderer, gchar *path_desc, gcha
static
void
editing_started_cb
(
GtkCellRenderer
*
cell
,
GtkCellEditable
*
editable
,
const
gchar
*
path
,
gpointer
data
)
{
DEBUG
(
"Editing started"
);
gtk_entry_set_
visibility
(
GTK_ENTRY
(
editable
),
FALSE
);
//
gtk_entry_set_
text
(GTK_ENTRY
(editable),
gtk_entry_get_text (GTK_ENTRY(entryPassword))
);
}
static
void
show_advanced_zrtp_options_cb
(
GtkWidget
*
widget
UNUSED
,
gpointer
data
)
...
...
@@ -463,7 +477,6 @@ static void use_sip_tls_cb(GtkWidget *widget, gpointer data)
}
}
static
set_published_addr_manually_cb
(
GtkWidget
*
widget
,
gpointer
data
UNUSED
)
{
DEBUG
(
"set_published_addr_manually_cb"
);
...
...
@@ -534,6 +547,7 @@ GtkWidget * create_security_tab(account_t **a)
GtkWidget
*
hbox
;
GtkWidget
*
editButton
;
GtkWidget
*
addButton
;
GtkWidget
*
clearTextCheckbox
;
GtkCellRenderer
*
renderer
;
GtkTreeViewColumn
*
treeViewColumn
;
GtkTreeSelection
*
treeSelection
;
...
...
@@ -609,7 +623,7 @@ GtkWidget * create_security_tab(account_t **a)
renderer
=
gtk_cell_renderer_text_new
();
g_object_set
(
renderer
,
"editable"
,
TRUE
,
"editable-set"
,
TRUE
,
NULL
);
g_signal_connect
(
G_OBJECT
(
renderer
),
"edited"
,
G_CALLBACK
(
cell_edited_cb
),
credentialStore
);
g_signal_connect
(
G_OBJECT
(
renderer
),
"edited"
,
G_CALLBACK
(
cell_edited_cb
),
credentialStore
);
g_object_set_data
(
G_OBJECT
(
renderer
),
"column"
,
GINT_TO_POINTER
(
COLUMN_CREDENTIAL_USERNAME
));
treeViewColumn
=
gtk_tree_view_column_new_with_attributes
(
_
(
"Authentication name"
),
renderer
,
...
...
@@ -619,7 +633,7 @@ GtkWidget * create_security_tab(account_t **a)
renderer
=
gtk_cell_renderer_text_new
();
g_object_set
(
renderer
,
"editable"
,
TRUE
,
"editable-set"
,
TRUE
,
NULL
);
g_signal_connect
(
G_OBJECT
(
renderer
),
"edited"
,
G_CALLBACK
(
cell_edited_cb
),
credentialStore
);
g_signal_connect
(
G_OBJECT
(
renderer
),
"edited"
,
G_CALLBACK
(
cell_edited_cb
),
credentialStore
);
g_signal_connect
(
renderer
,
"editing-started"
,
G_CALLBACK
(
editing_started_cb
),
NULL
);
g_object_set_data
(
G_OBJECT
(
renderer
),
"column"
,
GINT_TO_POINTER
(
COLUMN_CREDENTIAL_PASSWORD
));
treeViewColumn
=
gtk_tree_view_column_new_with_attributes
(
_
(
"Password"
),
...
...
@@ -634,7 +648,7 @@ GtkWidget * create_security_tab(account_t **a)
/* Credential Buttons */
hbox
=
gtk_hbox_new
(
FALSE
,
10
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
hbox
,
0
,
2
,
1
,
2
);
gtk_table_attach_defaults
(
GTK_TABLE
(
table
),
hbox
,
0
,
3
,
1
,
2
);
addButton
=
gtk_button_new_from_stock
(
GTK_STOCK_ADD
);
g_signal_connect
(
addButton
,
"clicked"
,
G_CALLBACK
(
add_credential_cb
),
credentialStore
);
...
...
@@ -643,7 +657,6 @@ GtkWidget * create_security_tab(account_t **a)
deleteCredButton
=
gtk_button_new_from_stock
(
GTK_STOCK_REMOVE
);
g_signal_connect
(
deleteCredButton
,
"clicked"
,
G_CALLBACK
(
delete_credential_cb
),
treeViewCredential
);
gtk_box_pack_start
(
GTK_BOX
(
hbox
),
deleteCredButton
,
FALSE
,
FALSE
,
0
);
/* Security Section */
gnome_main_section_new_with_table
(
_
(
"Security"
),
&
frame
,
&
table
,
2
,
3
);
...
...
This diff is collapsed.
Click to expand it.
sflphone-client-gnome/src/config/assistant.c
+
23
−
7
View file @
f7c8a107
...
...
@@ -59,6 +59,12 @@ void set_account_type( GtkWidget* widget , gpointer data UNUSED ) {
}
}
static
void
show_password_cb
(
GtkWidget
*
widget
,
gpointer
data
)
{
gtk_entry_set_visibility
(
GTK_ENTRY
(
data
),
!
gtk_entry_get_visibility
(
GTK_ENTRY
(
data
)));
}
/**
* Fills string message with the final message of account registration
* with alias, server and username specified.
...
...
@@ -295,10 +301,11 @@ GtkWidget* build_sip_account_configuration( void ) {
GtkWidget
*
table
;
GtkWidget
*
label
;
GtkWidget
*
image
;
GtkWidget
*
clearTextCheckbox
;
wiz
->
sip_account
=
create_vbox
(
GTK_ASSISTANT_PAGE_CONTENT
,
_
(
"SIP account settings"
)
,
_
(
"Please fill the following information"
));
// table
table
=
gtk_table_new
(
5
,
2
,
FALSE
/* homogeneous */
);
table
=
gtk_table_new
(
7
,
2
,
FALSE
/* homogeneous */
);
gtk_table_set_row_spacings
(
GTK_TABLE
(
table
),
10
);
gtk_table_set_col_spacings
(
GTK_TABLE
(
table
),
10
);
gtk_box_pack_start
(
GTK_BOX
(
wiz
->
sip_account
)
,
table
,
TRUE
,
TRUE
,
0
);
...
...
@@ -352,19 +359,23 @@ GtkWidget* build_sip_account_configuration( void ) {
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
label
),
wiz
->
sip_password
);
gtk_entry_set_visibility
(
GTK_ENTRY
(
wiz
->
sip_password
),
FALSE
);
gtk_table_attach
(
GTK_TABLE
(
table
),
wiz
->
sip_password
,
1
,
2
,
3
,
4
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
clearTextCheckbox
=
gtk_check_button_new_with_mnemonic
(
_
(
"Show password"
));
g_signal_connect
(
clearTextCheckbox
,
"toggled"
,
G_CALLBACK
(
show_password_cb
),
wiz
->
sip_password
);
gtk_table_attach
(
GTK_TABLE
(
table
),
clearTextCheckbox
,
1
,
2
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
// voicemail number field
label
=
gtk_label_new_with_mnemonic
(
_
(
"_Voicemail number"
));
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
5
,
6
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
wiz
->
sip_voicemail
=
gtk_entry_new
();
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
label
),
wiz
->
sip_voicemail
);
gtk_table_attach
(
GTK_TABLE
(
table
),
wiz
->
sip_voicemail
,
1
,
2
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_table_attach
(
GTK_TABLE
(
table
),
wiz
->
sip_voicemail
,
1
,
2
,
5
,
6
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
// Security options
wiz
->
zrtp_enable
=
gtk_check_button_new_with_mnemonic
(
_
(
"Secure communications with _ZRTP"
));
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
wiz
->
zrtp_enable
),
FALSE
);
gtk_table_attach
(
GTK_TABLE
(
table
),
wiz
->
zrtp_enable
,
0
,
1
,
5
,
6
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_table_attach
(
GTK_TABLE
(
table
),
wiz
->
zrtp_enable
,
0
,
1
,
6
,
7
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_widget_set_sensitive
(
GTK_WIDGET
(
wiz
->
zrtp_enable
)
,
TRUE
);
//gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), wiz->sip_account, TRUE);
...
...
@@ -403,10 +414,11 @@ GtkWidget* build_iax_account_configuration( void ) {
GtkWidget
*
label
;
GtkWidget
*
table
;
GtkWidget
*
image
;
GtkWidget
*
clearTextCheckbox
;
wiz
->
iax_account
=
create_vbox
(
GTK_ASSISTANT_PAGE_CONFIRM
,
_
(
"IAX2 account settings"
)
,
_
(
"Please fill the following information"
));
table
=
gtk_table_new
(
5
,
2
,
FALSE
/* homogeneous */
);
table
=
gtk_table_new
(
6
,
2
,
FALSE
/* homogeneous */
);
gtk_table_set_row_spacings
(
GTK_TABLE
(
table
),
10
);
gtk_table_set_col_spacings
(
GTK_TABLE
(
table
),
10
);
gtk_box_pack_start
(
GTK_BOX
(
wiz
->
iax_account
)
,
table
,
TRUE
,
TRUE
,
0
);
...
...
@@ -458,13 +470,17 @@ GtkWidget* build_iax_account_configuration( void ) {
gtk_entry_set_visibility
(
GTK_ENTRY
(
wiz
->
iax_password
),
FALSE
);
gtk_table_attach
(
GTK_TABLE
(
table
),
wiz
->
iax_password
,
1
,
2
,
3
,
4
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
clearTextCheckbox
=
gtk_check_button_new_with_mnemonic
(
_
(
"Show password"
));
g_signal_connect
(
clearTextCheckbox
,
"toggled"
,
G_CALLBACK
(
show_password_cb
),
wiz
->
iax_password
);
gtk_table_attach
(
GTK_TABLE
(
table
),
clearTextCheckbox
,
1
,
2
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
// voicemail number field
label
=
gtk_label_new_with_mnemonic
(
_
(
"_Voicemail number"
));
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
5
,
6
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
wiz
->
iax_voicemail
=
gtk_entry_new
();
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
label
),
wiz
->
iax_voicemail
);
gtk_table_attach
(
GTK_TABLE
(
table
),
wiz
->
iax_voicemail
,
1
,
2
,
4
,
5
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_table_attach
(
GTK_TABLE
(
table
),
wiz
->
iax_voicemail
,
1
,
2
,
5
,
6
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
current
->
state
=
ACCOUNT_STATE_UNREGISTERED
;
...
...
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