mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
implement save as.. menu item
This commit is contained in:
parent
6f038539d6
commit
17985d9a7b
8 changed files with 142 additions and 34 deletions
|
|
@ -5,7 +5,7 @@ use widget::Widget;
|
|||
|
||||
use crate::app::browser::{window::tab::item::Action as TabAction, Action as BrowserAction};
|
||||
use gtk::{
|
||||
glib::{GString, Uri, UriFlags},
|
||||
glib::{gformat, GString, Uri, UriFlags},
|
||||
prelude::EditableExt,
|
||||
};
|
||||
use sqlite::Transaction;
|
||||
|
|
@ -88,6 +88,12 @@ impl Request {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// Setters
|
||||
|
||||
pub fn to_download(&self) {
|
||||
self.widget.entry.set_text(&self.download());
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
pub fn uri(&self) -> Option<Uri> {
|
||||
|
|
@ -110,6 +116,10 @@ impl Request {
|
|||
|
||||
text
|
||||
}
|
||||
|
||||
pub fn download(&self) -> GString {
|
||||
gformat!("download:{}", self.strip_prefix())
|
||||
}
|
||||
}
|
||||
|
||||
// Tools
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue