rename action

This commit is contained in:
yggverse 2024-12-07 08:42:04 +02:00
parent 7319a0260f
commit 574f9ad55a
4 changed files with 14 additions and 14 deletions

View File

@ -18,7 +18,7 @@ use gtk::{prelude::BoxExt, Box, Orientation};
use std::rc::Rc;
pub struct Form {
// pub widget_action: Rc<Action>,
// pub action_widget: Rc<Action>,
pub drop: Rc<Drop>,
pub exit: Rc<Exit>,
pub file: Rc<File>,
@ -32,11 +32,11 @@ impl Form {
// Constructors
/// 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
let list = Rc::new(List::new(widget_action.clone(), profile.clone(), auth_url));
let file = Rc::new(File::new(widget_action.clone()));
let name = Rc::new(Name::new(widget_action.clone()));
let list = Rc::new(List::new(action_widget.clone(), profile.clone(), auth_url));
let file = Rc::new(File::new(action_widget.clone()));
let name = Rc::new(Name::new(action_widget.clone()));
let save = Rc::new(Save::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()));
@ -53,7 +53,7 @@ impl Form {
// Return activated `Self`
Self {
// widget_action,
// action_widget,
drop,
exit,
file,

View File

@ -21,7 +21,7 @@ impl File {
// Constructors
/// Create new `Self`
pub fn new(widget_action: Rc<Action>) -> Self {
pub fn new(action_widget: Rc<Action>) -> Self {
// Init PEM
let pem = Rc::new(RefCell::new(None));
@ -35,9 +35,9 @@ impl File {
// Init events
button.connect_clicked({
let action_widget = action_widget.clone();
let button = button.clone();
let pem = pem.clone();
let widget_action = widget_action.clone();
move |_| {
// Lock open button (prevent double click)
button.set_sensitive(false);
@ -61,9 +61,9 @@ impl File {
.default_filter(&filter_pem)
.build()
.open(None::<&Window>, None::<&Cancellable>, {
let action_widget = action_widget.clone();
let button = button.clone();
let pem = pem.clone();
let widget_action = widget_action.clone();
move |result| {
match result {
Ok(file) => match file.path() {
@ -89,7 +89,7 @@ impl File {
}
}
button.set_sensitive(true); // unlock
widget_action.update.activate()
action_widget.update.activate()
}
});
}

View File

@ -25,7 +25,7 @@ impl List {
// Constructors
/// 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
let list_store = ListStore::new::<Item>();
@ -134,7 +134,7 @@ impl List {
.build();
// Connect events
dropdown.connect_selected_notify(move |_| widget_action.update.activate());
dropdown.connect_selected_notify(move |_| action_widget.update.activate());
// Return activated `Self`
Self {

View File

@ -19,7 +19,7 @@ impl Name {
// Constructors
/// Create new `Self`
pub fn new(widget_action: Rc<Action>) -> Self {
pub fn new(action_widget: Rc<Action>) -> Self {
// Init main gobject
let entry = Entry::builder()
.margin_top(MARGIN)
@ -29,7 +29,7 @@ impl Name {
.build();
// Init events
entry.connect_changed(move |_| widget_action.update.activate());
entry.connect_changed(move |_| action_widget.update.activate());
// Return activated `Self`
Self { entry }