mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 07:54:14 +00:00
implement restore action
This commit is contained in:
parent
4fee1c06a3
commit
ff82804e5b
@ -248,7 +248,18 @@ impl Browser {
|
||||
}
|
||||
|
||||
pub fn restore(&self, app_id: &i64) {
|
||||
// @TODO
|
||||
match self.database.records(app_id) {
|
||||
Ok(records) => {
|
||||
for record in records {
|
||||
// Delegate restore action to childs
|
||||
// @TODO
|
||||
// self.header.restore(record.id);
|
||||
// self.main.restore(record.id);
|
||||
self.widget.restore(&record.id);
|
||||
}
|
||||
}
|
||||
Err(error) => panic!("{error}"), // @TODO
|
||||
}
|
||||
}
|
||||
|
||||
pub fn save(&self, app_id: &i64) {
|
||||
|
@ -62,8 +62,21 @@ impl Widget {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn restore(&self) {
|
||||
// @TODO
|
||||
pub fn restore(&self, app_browser_id: &i64) {
|
||||
match self.database.records(app_browser_id) {
|
||||
Ok(records) => {
|
||||
for record in records {
|
||||
// Restore widget
|
||||
self.application_window.set_maximized(record.is_maximized);
|
||||
self.application_window
|
||||
.set_default_size(record.default_width, record.default_height);
|
||||
|
||||
// Delegate restore action to childs
|
||||
// nothing yet..
|
||||
}
|
||||
}
|
||||
Err(error) => panic!("{error}"), // @TODO
|
||||
}
|
||||
}
|
||||
|
||||
pub fn save(&self, app_browser_id: &i64) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user