Three bugs fixed: - No tokio reactor: glib::spawn_future_local does not provide a tokio context, so reqwest/hyper panicked at runtime. Introduce src/runtime.rs with a multi-thread tokio Runtime (init() called from main before the GTK app starts). runtime::spawn() posts the async result back to GTK via a tokio oneshot channel awaited by glib::spawn_future_local, which only polls a flag (no I/O). runtime::spawn_bg() is used for fire-and-forget background calls. - Enter key didn't submit login: connect_apply on AdwEntryRow only fires when show-apply-button is true. Switch to connect_entry_activated which fires on Return in all three login rows. - Wrong API URL: the app constructed /accounts/ClientLogin directly off the server host, yielding a 404. Add normalize_base_url() in api.rs that appends /api/greader.php when the URL doesn't already contain it, so users can enter just https://rss.example.com.
42 lines
878 B
Text
42 lines
878 B
Text
using Gtk 4.0;
|
|
using Adw 1;
|
|
|
|
template $LoginDialog : Adw.Dialog {
|
|
title: _("Log In");
|
|
content-width: 360;
|
|
|
|
Adw.ToolbarView {
|
|
[top]
|
|
Adw.HeaderBar {}
|
|
|
|
Adw.Clamp {
|
|
margin-top: 12;
|
|
margin-bottom: 24;
|
|
margin-start: 12;
|
|
margin-end: 12;
|
|
|
|
Adw.PreferencesGroup {
|
|
Adw.EntryRow server_url_row {
|
|
title: _("Server URL");
|
|
input-hints: no_spellcheck;
|
|
input-purpose: url;
|
|
// e.g. https://rss.example.com — /api/greader.php is added automatically
|
|
}
|
|
|
|
Adw.EntryRow username_row {
|
|
title: _("Username");
|
|
input-hints: no_spellcheck;
|
|
}
|
|
|
|
Adw.PasswordEntryRow password_row {
|
|
title: _("Password");
|
|
}
|
|
|
|
Adw.ButtonRow login_button {
|
|
title: _("Log In");
|
|
styles ["suggested-action"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|