mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-30 13:04:13 +00:00
rename action
This commit is contained in:
parent
7319a0260f
commit
574f9ad55a
@ -18,7 +18,7 @@ use gtk::{prelude::BoxExt, Box, Orientation};
|
|||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
pub struct Form {
|
pub struct Form {
|
||||||
// pub widget_action: Rc<Action>,
|
// pub action_widget: Rc<Action>,
|
||||||
pub drop: Rc<Drop>,
|
pub drop: Rc<Drop>,
|
||||||
pub exit: Rc<Exit>,
|
pub exit: Rc<Exit>,
|
||||||
pub file: Rc<File>,
|
pub file: Rc<File>,
|
||||||
@ -32,11 +32,11 @@ impl Form {
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
/// Create new `Self`
|
/// Create new `Self`
|
||||||
pub fn new(profile: Rc<Profile>, widget_action: Rc<Action>, auth_url: &str) -> Self {
|
pub fn new(profile: Rc<Profile>, action_widget: Rc<Action>, auth_url: &str) -> Self {
|
||||||
// Init components
|
// Init components
|
||||||
let list = Rc::new(List::new(widget_action.clone(), profile.clone(), auth_url));
|
let list = Rc::new(List::new(action_widget.clone(), profile.clone(), auth_url));
|
||||||
let file = Rc::new(File::new(widget_action.clone()));
|
let file = Rc::new(File::new(action_widget.clone()));
|
||||||
let name = Rc::new(Name::new(widget_action.clone()));
|
let name = Rc::new(Name::new(action_widget.clone()));
|
||||||
let save = Rc::new(Save::new(profile.clone(), list.clone()));
|
let save = Rc::new(Save::new(profile.clone(), list.clone()));
|
||||||
let drop = Rc::new(Drop::new(profile.clone(), list.clone()));
|
let drop = Rc::new(Drop::new(profile.clone(), list.clone()));
|
||||||
let exit = Rc::new(Exit::new(profile.clone(), list.clone()));
|
let exit = Rc::new(Exit::new(profile.clone(), list.clone()));
|
||||||
@ -53,7 +53,7 @@ impl Form {
|
|||||||
|
|
||||||
// Return activated `Self`
|
// Return activated `Self`
|
||||||
Self {
|
Self {
|
||||||
// widget_action,
|
// action_widget,
|
||||||
drop,
|
drop,
|
||||||
exit,
|
exit,
|
||||||
file,
|
file,
|
||||||
|
@ -21,7 +21,7 @@ impl File {
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
/// Create new `Self`
|
/// Create new `Self`
|
||||||
pub fn new(widget_action: Rc<Action>) -> Self {
|
pub fn new(action_widget: Rc<Action>) -> Self {
|
||||||
// Init PEM
|
// Init PEM
|
||||||
let pem = Rc::new(RefCell::new(None));
|
let pem = Rc::new(RefCell::new(None));
|
||||||
|
|
||||||
@ -35,9 +35,9 @@ impl File {
|
|||||||
|
|
||||||
// Init events
|
// Init events
|
||||||
button.connect_clicked({
|
button.connect_clicked({
|
||||||
|
let action_widget = action_widget.clone();
|
||||||
let button = button.clone();
|
let button = button.clone();
|
||||||
let pem = pem.clone();
|
let pem = pem.clone();
|
||||||
let widget_action = widget_action.clone();
|
|
||||||
move |_| {
|
move |_| {
|
||||||
// Lock open button (prevent double click)
|
// Lock open button (prevent double click)
|
||||||
button.set_sensitive(false);
|
button.set_sensitive(false);
|
||||||
@ -61,9 +61,9 @@ impl File {
|
|||||||
.default_filter(&filter_pem)
|
.default_filter(&filter_pem)
|
||||||
.build()
|
.build()
|
||||||
.open(None::<&Window>, None::<&Cancellable>, {
|
.open(None::<&Window>, None::<&Cancellable>, {
|
||||||
|
let action_widget = action_widget.clone();
|
||||||
let button = button.clone();
|
let button = button.clone();
|
||||||
let pem = pem.clone();
|
let pem = pem.clone();
|
||||||
let widget_action = widget_action.clone();
|
|
||||||
move |result| {
|
move |result| {
|
||||||
match result {
|
match result {
|
||||||
Ok(file) => match file.path() {
|
Ok(file) => match file.path() {
|
||||||
@ -89,7 +89,7 @@ impl File {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
button.set_sensitive(true); // unlock
|
button.set_sensitive(true); // unlock
|
||||||
widget_action.update.activate()
|
action_widget.update.activate()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ impl List {
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
/// Create new `Self`
|
/// Create new `Self`
|
||||||
pub fn new(widget_action: Rc<Action>, profile: Rc<Profile>, auth_url: &str) -> Self {
|
pub fn new(action_widget: Rc<Action>, profile: Rc<Profile>, auth_url: &str) -> Self {
|
||||||
// Init model
|
// Init model
|
||||||
let list_store = ListStore::new::<Item>();
|
let list_store = ListStore::new::<Item>();
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ impl List {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Connect events
|
// Connect events
|
||||||
dropdown.connect_selected_notify(move |_| widget_action.update.activate());
|
dropdown.connect_selected_notify(move |_| action_widget.update.activate());
|
||||||
|
|
||||||
// Return activated `Self`
|
// Return activated `Self`
|
||||||
Self {
|
Self {
|
||||||
|
@ -19,7 +19,7 @@ impl Name {
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
/// Create new `Self`
|
/// Create new `Self`
|
||||||
pub fn new(widget_action: Rc<Action>) -> Self {
|
pub fn new(action_widget: Rc<Action>) -> Self {
|
||||||
// Init main gobject
|
// Init main gobject
|
||||||
let entry = Entry::builder()
|
let entry = Entry::builder()
|
||||||
.margin_top(MARGIN)
|
.margin_top(MARGIN)
|
||||||
@ -29,7 +29,7 @@ impl Name {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Init events
|
// Init events
|
||||||
entry.connect_changed(move |_| widget_action.update.activate());
|
entry.connect_changed(move |_| action_widget.update.activate());
|
||||||
|
|
||||||
// Return activated `Self`
|
// Return activated `Self`
|
||||||
Self { entry }
|
Self { entry }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user