mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
move browser actions to destination submod level
This commit is contained in:
parent
33d8746ca3
commit
6030df6328
17 changed files with 83 additions and 81 deletions
45
src/app/browser/action.rs
Normal file
45
src/app/browser/action.rs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
use gtk::{gio::SimpleAction, glib::uuid_string_random, prelude::StaticVariantType};
|
||||
|
||||
pub struct Action {
|
||||
about: SimpleAction,
|
||||
debug: SimpleAction,
|
||||
profile: SimpleAction,
|
||||
quit: SimpleAction,
|
||||
update: SimpleAction,
|
||||
}
|
||||
|
||||
impl Action {
|
||||
// Constructors
|
||||
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
about: SimpleAction::new(&uuid_string_random(), None),
|
||||
debug: SimpleAction::new(&uuid_string_random(), None),
|
||||
profile: SimpleAction::new(&uuid_string_random(), None),
|
||||
quit: SimpleAction::new(&uuid_string_random(), None),
|
||||
update: SimpleAction::new(&uuid_string_random(), Some(&String::static_variant_type())),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
pub fn about(&self) -> &SimpleAction {
|
||||
&self.about
|
||||
}
|
||||
|
||||
pub fn debug(&self) -> &SimpleAction {
|
||||
&self.debug
|
||||
}
|
||||
|
||||
pub fn profile(&self) -> &SimpleAction {
|
||||
&self.profile
|
||||
}
|
||||
|
||||
pub fn quit(&self) -> &SimpleAction {
|
||||
&self.quit
|
||||
}
|
||||
|
||||
pub fn update(&self) -> &SimpleAction {
|
||||
&self.update
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ use sqlite::Transaction;
|
|||
use tab::Tab;
|
||||
use widget::Widget;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use gtk::{gio::SimpleAction, Box};
|
||||
use std::rc::Rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ mod widget;
|
|||
use bar::Bar;
|
||||
use widget::Widget;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use adw::{TabView, ToolbarView};
|
||||
use gtk::gio::SimpleAction;
|
||||
use std::rc::Rc;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use menu::Menu;
|
|||
use tab::Tab;
|
||||
use widget::Widget;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use adw::TabView;
|
||||
use gtk::{gio::SimpleAction, Box};
|
||||
use std::rc::Rc;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ mod widget;
|
|||
|
||||
use widget::Widget;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use gtk::{
|
||||
gio::{self, SimpleAction},
|
||||
glib::{gformat, GString},
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use item::Item;
|
|||
use menu::Menu;
|
||||
use widget::Widget;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use adw::TabView;
|
||||
use gtk::{
|
||||
gio::SimpleAction,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use database::Database;
|
|||
use page::Page;
|
||||
use widget::Widget;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use adw::{TabPage, TabView};
|
||||
use gtk::{
|
||||
gio::SimpleAction,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use meta::{Meta, Status};
|
|||
use navigation::Navigation;
|
||||
use widget::Widget;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use gtk::{
|
||||
gdk_pixbuf::Pixbuf,
|
||||
gio::{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use reload::Reload;
|
|||
use request::Request;
|
||||
use widget::Widget;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use gtk::{gio::SimpleAction, glib::GString, prelude::WidgetExt, Box};
|
||||
use sqlite::Transaction;
|
||||
use std::rc::Rc;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ mod widget;
|
|||
use database::Database;
|
||||
use widget::Widget;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use gtk::{
|
||||
gio::SimpleAction,
|
||||
glib::{GString, Uri, UriFlags},
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ mod database;
|
|||
|
||||
use database::Database;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::app::browser::action::Action as BrowserAction;
|
||||
use gtk::{
|
||||
gio::SimpleAction,
|
||||
glib::{timeout_add_local, ControlFlow, GString, SourceId},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue