mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
implement new profile init
This commit is contained in:
parent
f558940574
commit
091b7da7b8
3 changed files with 58 additions and 13 deletions
|
|
@ -1,4 +1,5 @@
|
|||
mod widget;
|
||||
use gtk::glib::DateTime;
|
||||
use widget::Widget;
|
||||
|
||||
use crate::profile::Profile;
|
||||
|
|
@ -19,13 +20,19 @@ impl Welcome {
|
|||
let widget = Rc::new(Widget::new(parent));
|
||||
|
||||
// Init events
|
||||
widget.connect_response(|value| {
|
||||
match value {
|
||||
Some(id) => {
|
||||
// Select profile by record ID @TODO
|
||||
}
|
||||
None => {
|
||||
// Create new profile @TODO
|
||||
widget.connect_response({
|
||||
let profile = profile.clone();
|
||||
move |value| {
|
||||
match value {
|
||||
Some(id) => {
|
||||
// Select profile by record ID @TODO
|
||||
}
|
||||
None => {
|
||||
// Create and select new profile
|
||||
let _ = profile
|
||||
.database
|
||||
.add(true, &DateTime::now_local().unwrap(), None);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue