Improves the initial account creation dialog and fixes some missing mnemonics.
This commit is contained in:
parent
87506c2670
commit
5d8728a9bd
2 changed files with 66 additions and 83 deletions
|
|
@ -28,7 +28,6 @@ public class LoginDialog {
|
|||
private Gtk.Entry entry_imap_port;
|
||||
private Gtk.Entry entry_imap_username;
|
||||
private Gtk.Entry entry_imap_password;
|
||||
private Gtk.CheckButton check_imap_remember_password;
|
||||
private Gtk.ComboBox combo_imap_encryption;
|
||||
|
||||
// SMTP info widgets
|
||||
|
|
@ -36,7 +35,6 @@ public class LoginDialog {
|
|||
private Gtk.Entry entry_smtp_port;
|
||||
private Gtk.Entry entry_smtp_username;
|
||||
private Gtk.Entry entry_smtp_password;
|
||||
private Gtk.CheckButton check_smtp_remember_password;
|
||||
private Gtk.ComboBox combo_smtp_encryption;
|
||||
|
||||
private Gtk.Button ok_button;
|
||||
|
|
@ -53,10 +51,9 @@ public class LoginDialog {
|
|||
initial_account_information.email,
|
||||
initial_account_information.imap_credentials.user,
|
||||
initial_account_information.imap_credentials.pass,
|
||||
initial_account_information.imap_remember_password,
|
||||
initial_account_information.imap_remember_password && initial_account_information.smtp_remember_password,
|
||||
initial_account_information.smtp_credentials.user,
|
||||
initial_account_information.smtp_credentials.pass,
|
||||
initial_account_information.smtp_remember_password,
|
||||
initial_account_information.service_provider,
|
||||
initial_account_information.default_imap_server_host,
|
||||
initial_account_information.default_imap_server_port,
|
||||
|
|
@ -73,10 +70,9 @@ public class LoginDialog {
|
|||
string? initial_email = null,
|
||||
string? initial_imap_username = null,
|
||||
string? initial_imap_password = null,
|
||||
bool initial_imap_remember_password = true,
|
||||
bool initial_remember_password = true,
|
||||
string? initial_smtp_username = null,
|
||||
string? initial_smtp_password = null,
|
||||
bool initial_smtp_remember_password = true,
|
||||
int initial_service_provider = -1,
|
||||
string? initial_default_imap_host = null,
|
||||
uint16 initial_default_imap_port = Geary.Imap.ClientConnection.DEFAULT_PORT_SSL,
|
||||
|
|
@ -106,7 +102,6 @@ public class LoginDialog {
|
|||
entry_imap_port = builder.get_object("entry: imap port") as Gtk.Entry;
|
||||
entry_imap_username = builder.get_object("entry: imap username") as Gtk.Entry;
|
||||
entry_imap_password = builder.get_object("entry: imap password") as Gtk.Entry;
|
||||
check_imap_remember_password = builder.get_object("check: imap remember_password") as Gtk.CheckButton;
|
||||
combo_imap_encryption = builder.get_object("combo: imap encryption") as Gtk.ComboBox;
|
||||
|
||||
// SMTP info widgets.
|
||||
|
|
@ -114,7 +109,6 @@ public class LoginDialog {
|
|||
entry_smtp_port = builder.get_object("entry: smtp port") as Gtk.Entry;
|
||||
entry_smtp_username = builder.get_object("entry: smtp username") as Gtk.Entry;
|
||||
entry_smtp_password = builder.get_object("entry: smtp password") as Gtk.Entry;
|
||||
check_smtp_remember_password = builder.get_object("check: smtp remember_password") as Gtk.CheckButton;
|
||||
combo_smtp_encryption = builder.get_object("combo: smtp encryption") as Gtk.ComboBox;
|
||||
|
||||
combo_service.changed.connect(on_service_changed);
|
||||
|
|
@ -134,14 +128,13 @@ public class LoginDialog {
|
|||
bool use_imap_password = initial_imap_password == initial_smtp_password &&
|
||||
initial_imap_password != null;
|
||||
entry_password.set_text(use_imap_password ? initial_imap_password : "");
|
||||
check_remember_password.active = initial_imap_remember_password && initial_smtp_remember_password;
|
||||
check_remember_password.active = initial_remember_password;
|
||||
|
||||
// Set defaults for IMAP info
|
||||
entry_imap_host.set_text(initial_default_imap_host ?? "");
|
||||
entry_imap_port.set_text(initial_default_imap_port.to_string());
|
||||
entry_imap_username.set_text(initial_imap_username ?? "");
|
||||
entry_imap_password.set_text(initial_imap_password ?? "");
|
||||
check_imap_remember_password.active = initial_imap_remember_password;
|
||||
if (initial_default_imap_ssl)
|
||||
combo_imap_encryption.active = Encryption.SSL;
|
||||
else if (initial_default_imap_starttls)
|
||||
|
|
@ -154,7 +147,6 @@ public class LoginDialog {
|
|||
entry_smtp_port.set_text(initial_default_smtp_port.to_string());
|
||||
entry_smtp_username.set_text(initial_smtp_username ?? "");
|
||||
entry_smtp_password.set_text(initial_smtp_password ?? "");
|
||||
check_smtp_remember_password.active = initial_smtp_remember_password;
|
||||
if (initial_default_smtp_ssl)
|
||||
combo_smtp_encryption.active = Encryption.SSL;
|
||||
else if (initial_default_smtp_starttls)
|
||||
|
|
@ -183,7 +175,6 @@ public class LoginDialog {
|
|||
|
||||
entry_email.changed.connect(on_email_changed);
|
||||
entry_password.changed.connect(on_password_changed);
|
||||
check_remember_password.toggled.connect(on_remember_password_toggled);
|
||||
|
||||
combo_imap_encryption.changed.connect(on_imap_encryption_changed);
|
||||
combo_smtp_encryption.changed.connect(on_smtp_encryption_changed);
|
||||
|
|
@ -214,14 +205,12 @@ public class LoginDialog {
|
|||
string email = entry_email.text.strip();
|
||||
string imap_username = use_extra_info ? entry_imap_username.text.strip() : email;
|
||||
string imap_password = (use_extra_info ? entry_imap_password : entry_password).text.strip();
|
||||
bool imap_remember_password = use_extra_info ? check_imap_remember_password.active :
|
||||
check_remember_password.active;
|
||||
bool imap_remember_password = check_remember_password.active;
|
||||
Geary.Credentials imap_credentials = new Geary.Credentials(imap_username, imap_password);
|
||||
|
||||
string smtp_username = use_extra_info ? entry_smtp_username.text.strip() : email;
|
||||
string smtp_password = (use_extra_info ? entry_smtp_password : entry_password).text.strip();
|
||||
bool smtp_remember_password = use_extra_info ? check_smtp_remember_password.active :
|
||||
check_remember_password.active;
|
||||
bool smtp_remember_password = check_remember_password.active;
|
||||
Geary.Credentials smtp_credentials = new Geary.Credentials(smtp_username, smtp_password);
|
||||
|
||||
try {
|
||||
|
|
@ -265,22 +254,16 @@ public class LoginDialog {
|
|||
entry_smtp_password.text = entry_password.text;
|
||||
}
|
||||
|
||||
// TODO: Only reset if not manually set by user.
|
||||
private void on_remember_password_toggled() {
|
||||
check_imap_remember_password.active = check_remember_password.active;
|
||||
check_smtp_remember_password.active = check_remember_password.active;
|
||||
}
|
||||
|
||||
private void on_service_changed() {
|
||||
if (get_service_provider() == Geary.ServiceProvider.OTHER) {
|
||||
label_password.hide();
|
||||
entry_password.hide();
|
||||
check_remember_password.hide();
|
||||
check_remember_password.label = _("Re_member passwords");
|
||||
other_info.show();
|
||||
} else {
|
||||
label_password.show();
|
||||
entry_password.show();
|
||||
check_remember_password.show();
|
||||
check_remember_password.label = _("Re_member password");
|
||||
other_info.hide();
|
||||
dialog.resize(1, 1);
|
||||
}
|
||||
|
|
|
|||
118
ui/login.glade
118
ui/login.glade
|
|
@ -13,17 +13,44 @@
|
|||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="welcome">
|
||||
<object class="GtkBox" id="box1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xpad">12</property>
|
||||
<property name="ypad">12</property>
|
||||
<property name="label" translatable="yes">Welcome to Geary.</property>
|
||||
<property name="wrap">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="application-icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="pixel_size">64</property>
|
||||
<property name="icon_name">geary</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">8</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="welcome">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><span size="large"><b>Welcome to Geary.</b></span>
|
||||
Enter your account information to get started.</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">12</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
|
@ -44,7 +71,7 @@
|
|||
<property name="fill">False</property>
|
||||
<property name="padding">6</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
|
@ -64,6 +91,7 @@
|
|||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="placeholder_text">email@example.com</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
|
@ -83,6 +111,7 @@
|
|||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="placeholder_text">Password</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
|
@ -178,6 +207,7 @@
|
|||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="placeholder_text">First Last</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
|
@ -398,7 +428,9 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xpad">12</property>
|
||||
<property name="label" translatable="yes">Username:</property>
|
||||
<property name="label" translatable="yes">User_name:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">entry: smtp username</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
|
|
@ -413,7 +445,9 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xpad">12</property>
|
||||
<property name="label" translatable="yes">Password:</property>
|
||||
<property name="label" translatable="yes">Pass_word:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">entry: smtp password</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
|
|
@ -427,6 +461,7 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="placeholder_text">SMTP username</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
|
@ -441,6 +476,7 @@
|
|||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="placeholder_text">SMTP password</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
|
@ -449,31 +485,15 @@
|
|||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="check: smtp remember_password">
|
||||
<property name="label" translatable="yes">Remember password</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">12</property>
|
||||
<property name="width">3</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label: imap username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xpad">12</property>
|
||||
<property name="label" translatable="yes">Username:</property>
|
||||
<property name="label" translatable="yes">_Username:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">entry: imap username</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
|
|
@ -488,7 +508,9 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xpad">12</property>
|
||||
<property name="label" translatable="yes">Password:</property>
|
||||
<property name="label" translatable="yes">_Password:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">entry: imap password</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
|
|
@ -502,6 +524,7 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="placeholder_text">IMAP username</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
|
@ -516,6 +539,7 @@
|
|||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="placeholder_text">IMAP password</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
|
@ -524,24 +548,6 @@
|
|||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="check: imap remember_password">
|
||||
<property name="label" translatable="yes">Remember password</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="width">3</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label: imap encryption">
|
||||
<property name="visible">True</property>
|
||||
|
|
@ -588,9 +594,9 @@
|
|||
<property name="entry_text_column">0</property>
|
||||
<property name="id_column">1</property>
|
||||
<items>
|
||||
<item translatable="yes">No encryption</item>
|
||||
<item translatable="yes">SSL/TLS encryption</item>
|
||||
<item translatable="yes">STARTTLS authentication</item>
|
||||
<item translatable="yes">None</item>
|
||||
<item translatable="yes">SSL/TLS</item>
|
||||
<item translatable="yes">STARTTLS</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
@ -608,9 +614,9 @@
|
|||
<property name="entry_text_column">0</property>
|
||||
<property name="id_column">1</property>
|
||||
<items>
|
||||
<item translatable="yes">No encryption</item>
|
||||
<item translatable="yes">SSL/TLS encryption</item>
|
||||
<item translatable="yes">STARTTLS encryption</item>
|
||||
<item translatable="yes">None</item>
|
||||
<item translatable="yes">SSL/TLS</item>
|
||||
<item translatable="yes">STARTTLS</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
@ -677,12 +683,6 @@
|
|||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue