todos and its requiriements
This commit is contained in:
31
src/main.rs
31
src/main.rs
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
TODOS:
|
||||
1. remake db scheme for https://raw.githubusercontent.com/schneems/united-dictionary/master/public/languages/japanese/japanese-english.txt
|
||||
2. parse it
|
||||
3. add support for it
|
||||
4. With incorrect answerd card, it shows hieroglyp, reading ant its translation
|
||||
*/
|
||||
|
||||
mod db;
|
||||
mod game;
|
||||
mod ui;
|
||||
@@ -6,8 +14,8 @@ mod widgets;
|
||||
use crate::ui::menu::MenuScene;
|
||||
|
||||
use gtk::glib::closure_local;
|
||||
use gtk::{prelude::*, Window};
|
||||
use gtk::{gio, glib, Application, Button};
|
||||
use gtk::{prelude::*, Window};
|
||||
use ui::cards::edit::MemoryCardsEditScene;
|
||||
use ui::cards::game::MemoryCardsGameScene;
|
||||
use ui::cards::setup::MemoryCardsSetupScene;
|
||||
@@ -77,7 +85,7 @@ fn build_ui(app: &Application) {
|
||||
}
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
guessing_setup.get_start_button().connect_closure(
|
||||
"clicked",
|
||||
false,
|
||||
@@ -99,7 +107,7 @@ fn build_ui(app: &Application) {
|
||||
}
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
guessing_scene.get_back_button().connect_closure(
|
||||
"clicked",
|
||||
false,
|
||||
@@ -109,7 +117,7 @@ fn build_ui(app: &Application) {
|
||||
}
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
memory_cards_setup.get_edit_button().connect_closure(
|
||||
"clicked",
|
||||
false,
|
||||
@@ -161,7 +169,6 @@ fn build_ui(app: &Application) {
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
connect_close_requrest(app, menu.upcast_ref::<Window>());
|
||||
connect_close_requrest(app, guessing_setup.upcast_ref::<Window>());
|
||||
connect_close_requrest(app, guessing_scene.upcast_ref::<Window>());
|
||||
@@ -173,8 +180,12 @@ fn build_ui(app: &Application) {
|
||||
}
|
||||
|
||||
fn connect_close_requrest<W: IsA<Window>>(app: &Application, w: &W) {
|
||||
w.connect_closure("close-request", false, closure_local!(@strong app => move |_w: &Window| {
|
||||
app.quit();
|
||||
true
|
||||
}));
|
||||
}
|
||||
w.connect_closure(
|
||||
"close-request",
|
||||
false,
|
||||
closure_local!(@strong app => move |_w: &Window| {
|
||||
app.quit();
|
||||
true
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user