This commit is contained in:
2026-04-15 07:55:03 +03:00
parent ed02be0e77
commit 7cbb974d3b
6 changed files with 7 additions and 26 deletions
+1 -4
View File
@@ -1,8 +1,5 @@
use std::collections::HashMap;
use iced::time::now;
use rusqlite::Connection;
use crate::lang::{CardSet, DictionaryElement};
use crate::repetitions::CardSetSettings;
use rusqlite::Connection;
pub fn load_sets(connection: &Connection) -> Vec<CardSetSettings> {
let mut stmt = connection.prepare("SELECT id, name, forward, backward, filter FROM card_set").unwrap();
-3
View File
@@ -2,6 +2,3 @@ pub(crate) mod words;
pub(crate) mod card_sets;
pub(crate) mod card_stats;
use crate::lang;
use crate::dictionary;
+4 -6
View File
@@ -142,10 +142,8 @@ fn create_card_set_table(conn: &Connection) {
)",
(),
)
.unwrap_or_else(|e| {
println!("{}", e);
0
});
.unwrap_or_else(|e| {
println!("{}", e);
0
});
}
pub struct Qwerty {}
-10
View File
@@ -355,16 +355,6 @@ pub fn split_with_coma(ts: String) -> Vec<String> {
.collect::<Vec<String>>()
}
pub fn dict_file() -> PathBuf {
let mut dir = dirs::data_dir().unwrap();
dir.push("jap_learn");
if !dir.exists() {
fs::create_dir(dir.clone()).unwrap();
}
dir.push("dict.json");
dir
}
pub fn app_data_dir() -> PathBuf {
let mut dir = dirs::data_dir().unwrap();
dir.push("jap_learn");
+1 -1
View File
@@ -24,7 +24,7 @@ use crate::Page::{
Dictionary, DictionaryQuiz, Quiz, Randomizer, Repetition, Repetitions, Selector, Writing,
};
use iced::widget::text;
use iced::{keyboard, Element, Program, Subscription};
use iced::{keyboard, Element, Subscription};
use iced::{Font, Task};
use rusqlite::Connection;
use std::sync::{Arc, Mutex};
-1
View File
@@ -8,7 +8,6 @@ use iced::widget::container::rounded_box;
use iced::widget::space::vertical;
use iced::widget::{button, column, container, row, space, text};
use iced::{alignment, keyboard, Element, Fill, Left, Task};
use rusqlite::fallible_iterator::FallibleIterator;
use std::sync::{Arc, Mutex};
pub struct RepetitionState {