rename action

This commit is contained in:
yggverse 2025-02-15 12:12:31 +02:00
parent 12c1c80092
commit 330075164d
4 changed files with 14 additions and 14 deletions

View file

@ -119,7 +119,7 @@ impl Window {
} }
}); });
action.open.on_activate({ action.load.on_activate({
let tab = tab.clone(); let tab = tab.clone();
move |_, request| { move |_, request| {
tab.append(Position::End, Some(&request), false, true, false, true); tab.append(Position::End, Some(&request), false, true, false, true);

View file

@ -6,7 +6,7 @@ mod find;
mod history_back; mod history_back;
mod history_forward; mod history_forward;
mod home; mod home;
mod open; mod load;
mod pin; mod pin;
mod reload; mod reload;
mod save_as; mod save_as;
@ -20,7 +20,7 @@ use find::Find;
use history_back::HistoryBack; use history_back::HistoryBack;
use history_forward::HistoryForward; use history_forward::HistoryForward;
use home::Home; use home::Home;
use open::Open; use load::Load;
use pin::Pin; use pin::Pin;
use reload::Reload; use reload::Reload;
use save_as::SaveAs; use save_as::SaveAs;
@ -46,7 +46,7 @@ pub struct Action {
pub history_back: Rc<HistoryBack>, pub history_back: Rc<HistoryBack>,
pub history_forward: Rc<HistoryForward>, pub history_forward: Rc<HistoryForward>,
pub home: Rc<Home>, pub home: Rc<Home>,
pub open: Rc<Open>, pub load: Rc<Load>,
pub pin: Rc<Pin>, pub pin: Rc<Pin>,
pub reload: Rc<Reload>, pub reload: Rc<Reload>,
pub save_as: Rc<SaveAs>, pub save_as: Rc<SaveAs>,
@ -76,7 +76,7 @@ impl Action {
let history_back = Rc::new(HistoryBack::new()); let history_back = Rc::new(HistoryBack::new());
let history_forward = Rc::new(HistoryForward::new()); let history_forward = Rc::new(HistoryForward::new());
let home = Rc::new(Home::new()); let home = Rc::new(Home::new());
let open = Rc::new(Open::new()); let load = Rc::new(Load::new());
let pin = Rc::new(Pin::new()); let pin = Rc::new(Pin::new());
let reload = Rc::new(Reload::new()); let reload = Rc::new(Reload::new());
let save_as = Rc::new(SaveAs::new()); let save_as = Rc::new(SaveAs::new());
@ -97,7 +97,7 @@ impl Action {
simple_action_group.add_action(&history_back.simple_action); simple_action_group.add_action(&history_back.simple_action);
simple_action_group.add_action(&history_forward.simple_action); simple_action_group.add_action(&history_forward.simple_action);
simple_action_group.add_action(&home.simple_action); simple_action_group.add_action(&home.simple_action);
simple_action_group.add_action(&open.simple_action); simple_action_group.add_action(&load.simple_action);
simple_action_group.add_action(&pin.simple_action); simple_action_group.add_action(&pin.simple_action);
simple_action_group.add_action(&reload.simple_action); simple_action_group.add_action(&reload.simple_action);
simple_action_group.add_action(&save_as.simple_action); simple_action_group.add_action(&save_as.simple_action);
@ -113,7 +113,7 @@ impl Action {
history_back, history_back,
history_forward, history_forward,
home, home,
open, load,
pin, pin,
reload, reload,
save_as, save_as,

View file

@ -6,18 +6,18 @@ use gtk::{
prelude::StaticVariantType, prelude::StaticVariantType,
}; };
/// Open [SimpleAction](https://docs.gtk.org/gio/class.SimpleAction.html) /// Load [SimpleAction](https://docs.gtk.org/gio/class.SimpleAction.html)
pub struct Open { pub struct Load {
pub simple_action: SimpleAction, pub simple_action: SimpleAction,
} }
impl Default for Open { impl Default for Load {
fn default() -> Self { fn default() -> Self {
Self::new() Self::new()
} }
} }
impl Open { impl Load {
// Constructors // Constructors
/// Create new `Self` /// Create new `Self`

View file

@ -201,7 +201,7 @@ impl Menu for MenuButton {
menu_item.set_action_and_target_value(Some(&format!( menu_item.set_action_and_target_value(Some(&format!(
"{}.{}", "{}.{}",
window_action.id, window_action.id,
window_action.open.simple_action.name() window_action.load.simple_action.name()
)), Some(&request.to_variant())); )), Some(&request.to_variant()));
main_bookmarks.append_item(&menu_item); main_bookmarks.append_item(&menu_item);
@ -215,7 +215,7 @@ impl Menu for MenuButton {
menu_item.set_action_and_target_value(Some(&format!( menu_item.set_action_and_target_value(Some(&format!(
"{}.{}", "{}.{}",
window_action.id, window_action.id,
window_action.open.simple_action.name() window_action.load.simple_action.name()
)), Some(&item_request.to_variant())); )), Some(&item_request.to_variant()));
main_history_tab.append_item(&menu_item); main_history_tab.append_item(&menu_item);
@ -293,7 +293,7 @@ fn menu_item(action: &WindowAction, uri: &Uri, is_parent: bool) -> gio::MenuItem
Some(&format!( Some(&format!(
"{}.{}", "{}.{}",
action.id, action.id,
action.open.simple_action.name() action.load.simple_action.name()
)), )),
Some(&uri.to_string().to_variant()), Some(&uri.to_string().to_variant()),
); );