begin identity dialog implementation

This commit is contained in:
yggverse 2024-11-17 16:28:45 +02:00
parent 12b4d441ca
commit 14c31734fd
18 changed files with 439 additions and 72 deletions

View file

@ -2,8 +2,9 @@ mod failure;
mod identity;
mod loading;
use crate::app::browser::window::tab::item::Action;
use adw::StatusPage;
use std::time::Duration;
use std::{rc::Rc, time::Duration};
pub struct Status {
gobject: StatusPage,
@ -25,9 +26,9 @@ impl Status {
///
/// Useful as placeholder for 60 status code
/// https://geminiprotocol.net/docs/protocol-specification.gmi#status-60
pub fn new_identity() -> Self {
pub fn new_identity(action: Rc<Action>) -> Self {
Self {
gobject: identity::new_gobject(),
gobject: identity::new_gobject(action),
}
}

View file

@ -1,3 +1,6 @@
use std::rc::Rc;
use crate::app::browser::window::tab::item::Action;
use adw::StatusPage;
use gtk::{prelude::ButtonExt, Align, Button};
@ -11,7 +14,7 @@ const DEFAULT_BUTTON_CLASS: &str = "suggested-action";
/// Create new default preset for `Identity`
/// [StatusPage](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.StatusPage.html)
pub fn new_gobject() -> StatusPage {
pub fn new_gobject(action: Rc<Action>) -> StatusPage {
// Init certificate selection
let button = &Button::builder()
.css_classes([DEFAULT_BUTTON_CLASS])
@ -21,7 +24,7 @@ pub fn new_gobject() -> StatusPage {
.build();
// Init events
button.connect_activate(|_| {}); // @TODO
button.connect_clicked(move |_| action.ident().activate());
// Init status page
StatusPage::builder()