mod about;
mod close;
mod debug;
mod escape;
mod profile;
mod update;
use about::About;
use close::Close;
use debug::Debug;
use escape::Escape;
use profile::Profile;
use update::Update;
use gtk::{
gio::SimpleActionGroup,
glib::{uuid_string_random, GString},
prelude::ActionMapExt,
};
use std::rc::Rc;
pub struct Action {
pub about: Rc<About>,
pub close: Rc<Close>,
pub debug: Rc<Debug>,
pub escape: Rc<Escape>,
pub profile: Rc<Profile>,
pub update: Rc<Update>,
pub id: GString,
pub simple_action_group: SimpleActionGroup,
}
impl Action {
pub fn new() -> Self {
let about = Rc::new(About::new());
let close = Rc::new(Close::new());
let debug = Rc::new(Debug::new());
let escape = Rc::new(Escape::new());
let profile = Rc::new(Profile::new());
let update = Rc::new(Update::new());
let id = uuid_string_random();
let simple_action_group = SimpleActionGroup::new();
simple_action_group.add_action(&about.simple_action);
simple_action_group.add_action(&close.simple_action);
simple_action_group.add_action(&debug.simple_action);
simple_action_group.add_action(&escape.simple_action);
simple_action_group.add_action(&profile.simple_action);
simple_action_group.add_action(&update.simple_action);
Self {
about,
close,
debug,
escape,
profile,
update,
id,
simple_action_group,
}
}
}