mod about;
mod close;
mod debug;
mod profile;
mod update;
use about::About;
use close::Close;
use debug::Debug;
use profile::Profile;
use update::Update;
use gtk::{
gio::SimpleActionGroup,
glib::{uuid_string_random, GString},
prelude::ActionMapExt,
};
use std::rc::Rc;
pub struct Action {
about: Rc<About>,
close: Rc<Close>,
debug: Rc<Debug>,
profile: Rc<Profile>,
update: Rc<Update>,
id: GString,
gobject: 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 profile = Rc::new(Profile::new());
let update = Rc::new(Update::new());
let id = uuid_string_random();
let gobject = SimpleActionGroup::new();
gobject.add_action(about.gobject());
gobject.add_action(close.gobject());
gobject.add_action(debug.gobject());
gobject.add_action(profile.gobject());
gobject.add_action(update.gobject());
Self {
about,
close,
debug,
profile,
update,
id,
gobject,
}
}
pub fn about(&self) -> &Rc<About> {
&self.about
}
pub fn close(&self) -> &Rc<Close> {
&self.close
}
pub fn debug(&self) -> &Rc<Debug> {
&self.debug
}
pub fn profile(&self) -> &Rc<Profile> {
&self.profile
}
pub fn update(&self) -> &Rc<Update> {
&self.update
}
pub fn id(&self) -> &GString {
&self.id
}
pub fn gobject(&self) -> &SimpleActionGroup {
&self.gobject
}
}