mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
begin local actions implementation
This commit is contained in:
parent
9398a835cd
commit
9ff32a3419
19 changed files with 402 additions and 226 deletions
|
|
@ -61,21 +61,32 @@ impl Menu {
|
|||
// Main > Tool
|
||||
let main_tool = gio::Menu::new();
|
||||
|
||||
{ // Debug
|
||||
let (group, action, _, _) = crate::action::APP_BROWSER_WIDGET_DEBUG;
|
||||
main_tool.append(Some("Debug"), Some(&gformat!("{group}.{action}")));
|
||||
}
|
||||
// Debug
|
||||
main_tool.append(Some("Debug"), Some(&gformat!(
|
||||
"{}.{}",
|
||||
browser_action.id(),
|
||||
browser_action.debug().id()
|
||||
)));
|
||||
|
||||
main_tool.append(Some("Profile"), Some(&detailed_action_name(browser_action.profile())));
|
||||
main_tool.append(Some("About"), Some(&detailed_action_name(browser_action.about())));
|
||||
main_tool.append(Some("Profile"), Some(&gformat!(
|
||||
"{}.{}",
|
||||
browser_action.id(),
|
||||
browser_action.profile().id()
|
||||
)));
|
||||
|
||||
main.append_submenu(Some("Tool"), &main_tool);
|
||||
main_tool.append(Some("About"), Some(&gformat!(
|
||||
"{}.{}",
|
||||
browser_action.id(),
|
||||
browser_action.about().id()
|
||||
)));
|
||||
|
||||
{
|
||||
// Quit
|
||||
let (group, action, _, _) = crate::action::APP_BROWSER_WIDGET_CLOSE;
|
||||
main.append(Some("Quit"), Some(&gformat!("{group}.{action}")));
|
||||
}
|
||||
main.append_submenu(Some("Tool"), &main_tool);
|
||||
|
||||
main.append(Some("Quit"), Some(&gformat!(
|
||||
"{}.{}",
|
||||
browser_action.id(),
|
||||
browser_action.close().id()
|
||||
)));
|
||||
|
||||
// Result
|
||||
Rc::new(Self { widget:Widget::new_rc(&main) })
|
||||
|
|
|
|||
|
|
@ -274,8 +274,13 @@ impl Tab {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn update(&self, id: &str) {
|
||||
match self.index.borrow().get(id) {
|
||||
pub fn update(&self, item_id: Option<GString>) {
|
||||
let key = match item_id {
|
||||
Some(value) => value,
|
||||
None => GString::new(), // @TODO
|
||||
};
|
||||
|
||||
match self.index.borrow().get(&key) {
|
||||
Some(item) => {
|
||||
// Update item components
|
||||
item.update();
|
||||
|
|
@ -298,7 +303,7 @@ impl Tab {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // @TODO need optimization
|
||||
|
||||
pub fn clean(
|
||||
&self,
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ impl Page {
|
|||
self.cancellable.replace(Cancellable::new());
|
||||
|
||||
// Create shared variant value
|
||||
let id = self.id.to_variant();
|
||||
let id = self.id.clone();
|
||||
|
||||
// Try **take** request value from Redirect holder first
|
||||
let request = if let Some(redirect) = self.meta.take_redirect() {
|
||||
|
|
@ -446,7 +446,7 @@ impl Page {
|
|||
let action_page_load = self.action_page_load.clone();
|
||||
let action_page_open = self.action_page_open.clone();
|
||||
let content = self.content.clone();
|
||||
let id = self.id.to_variant();
|
||||
let id = self.id.clone();
|
||||
let input = self.input.clone();
|
||||
let meta = self.meta.clone();
|
||||
let url = uri.clone().to_str();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ impl Widget {
|
|||
|
||||
// Connect events
|
||||
gobject.connect_changed(move |_| {
|
||||
browser_action.update().activate(Some(&"".to_variant())); // @TODO
|
||||
browser_action.update().activate(None);
|
||||
});
|
||||
|
||||
gobject.connect_activate(move |this| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue