mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
deactivate save_as action for file browser tabs
This commit is contained in:
parent
fb9ef36893
commit
4c0200799b
4 changed files with 14 additions and 0 deletions
|
|
@ -463,6 +463,10 @@ fn update_actions(
|
||||||
.history_forward
|
.history_forward
|
||||||
.simple_action
|
.simple_action
|
||||||
.set_enabled(item.action.history.forward.is_enabled());
|
.set_enabled(item.action.history.forward.is_enabled());
|
||||||
|
window_action
|
||||||
|
.save_as
|
||||||
|
.simple_action
|
||||||
|
.set_enabled(!item.page.navigation.is_file());
|
||||||
|
|
||||||
window_action.change_state(Some(tab_view.page_position(tab_page)));
|
window_action.change_state(Some(tab_view.page_position(tab_page)));
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -33,5 +33,6 @@ impl Directory {
|
||||||
);
|
);
|
||||||
page.set_title(&self.file.parse_name());
|
page.set_title(&self.file.parse_name());
|
||||||
page.window_action.find.simple_action.set_enabled(false);
|
page.window_action.find.simple_action.set_enabled(false);
|
||||||
|
page.window_action.save_as.simple_action.set_enabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,10 @@ impl Navigation {
|
||||||
pub fn home(&self) -> Option<Uri> {
|
pub fn home(&self) -> Option<Uri> {
|
||||||
self.request.home()
|
self.request.home()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_file(&self) -> bool {
|
||||||
|
self.request.is_file()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tools
|
// Tools
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ pub trait Request {
|
||||||
fn source(&self) -> GString;
|
fn source(&self) -> GString;
|
||||||
fn uri(&self) -> Option<Uri>;
|
fn uri(&self) -> Option<Uri>;
|
||||||
fn home(&self) -> Option<Uri>;
|
fn home(&self) -> Option<Uri>;
|
||||||
|
fn is_file(&self) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request for Entry {
|
impl Request for Entry {
|
||||||
|
|
@ -360,6 +361,10 @@ impl Request for Entry {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn is_file(&self) -> bool {
|
||||||
|
self.text().starts_with("file://")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tools
|
// Tools
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue