network-agent: Remove "Show password" switch

While the ability to show the password can be useful at times,
the existing implementation is problematic:

  1) The use of a switch is wrong (as even noted in a code
     comment).

  2) It is inconsistent with any other password dialog (login screen,
     polkit).

In lack of a properly designed solution (for all password dialogs),
the designers agreed to remove the switch for now.

https://bugzilla.gnome.org/show_bug.cgi?id=658948
This commit is contained in:
Florian Müllner 2011-09-08 17:53:22 +02:00
parent 6bdf621d05
commit ba110f2d2e
2 changed files with 4 additions and 32 deletions

View File

@ -1925,14 +1925,6 @@ StTooltip StLabel {
padding-bottom: 8px;
}
.network-dialog-show-password-checkbox {
padding-top: 5px;
padding-bottom: 5px;
font-size: 10pt;
color: white;
spacing: 10px;
}
.network-dialog-secret-table {
spacing-rows: 15px;
}

View File

@ -127,34 +127,14 @@ NetworkSecretDialog.prototype = {
} else
secret.valid = true;
secretTable.add(label, { row: pos, col: 0, x_align: St.Align.START, y_align: St.Align.START });
secretTable.add(label, { row: pos, col: 0, x_expand: false, x_fill: true, x_align: St.Align.START, y_align: St.Align.START });
secretTable.add(secret.entry, { row: pos, col: 1, x_expand: true, x_fill: true, y_align: St.Align.END });
pos++;
if (secret.password) {
if (secret.password)
secret.entry.clutter_text.set_password_char('\u25cf');
// FIXME: need a real checkbox here
let button = new St.Button({ button_mask: St.ButtonMask.ONE,
can_focus: true });
let checkbox = new St.BoxLayout({ vertical: false,
style_class: 'network-dialog-show-password-checkbox'
});
let _switch = new PopupMenu.Switch(false);
checkbox.add(_switch.actor);
checkbox.add(new St.Label({ text: _("Show password") }), { expand: true });
button.connect('clicked', function() {
_switch.toggle();
if (_switch.state)
secret.entry.clutter_text.set_password_char('');
else
secret.entry.clutter_text.set_password_char('\u25cf');
});
button.child = checkbox;
secretTable.add(button, { row: pos, col: 1, x_expand: true, x_fill: true, y_fill: true })
pos++;
}
}
messageBox.add(secretTable);
this._okButton = { label: _("Connect"),
@ -404,4 +384,4 @@ NetworkAgent.prototype = {
this._dialogs[requestId].close(global.get_current_time());
this._dialogs[requestId].destroy();
}
};
};