now text properties of CardDisplay are selectable

This commit is contained in:
leca 2024-05-03 01:58:33 +03:00
parent 2398b3cfab
commit c308a34db7
2 changed files with 3 additions and 21 deletions

View File

@ -17,6 +17,7 @@
<property name="halign">GTK_ALIGN_START</property>
<property name="valign">GTK_ALIGN_CENTER</property>
<property name="margin-start">50</property>
<property name="selectable">true</property>
</object>
</child>
<child>
@ -24,6 +25,7 @@
<property name="halign">GTK_ALIGN_START</property>
<property name="valign">GTK_ALIGN_CENTER</property>
<property name="margin-start">50</property>
<property name="selectable">true</property>
</object>
</child>
<child>
@ -36,6 +38,7 @@
<property name="width-chars">16</property>
<property name="max-width-chars">16</property>
<property name="wrap">true</property>
<property name="selectable">true</property>
</object>
</child>
<child>

View File

@ -296,30 +296,9 @@ async fn new_card_setup<W: IsA<gtk::Window>>(window: Rc<W>) {
fs::copy(&path, stored_image_path).expect("Error copying image to store");
let hieroglyph = w.get_hieroglyph_input();
// let reading = w.get_reading_input();
// let translation = w.get_translation_input();
// println!("Input: {hieroglyph}, {reading}, {translation}");
let conn = Connection::open(get_db_path()).unwrap();
// conn.execute("INSERT OR REPLACE INTO cards ( id,
// imagename,
// hieroglyph,
// reading,
// translation,
// is_learning
// ) VALUES (
// (SELECT id FROM cards WHERE hieroglyph = ?2),
// ?1,
// ?2,
// ?3,
// ?4,
// (SELECT is_learning FROM cards WHERE hieroglyph = ?2
// )
// )", (&new_filename, &hieroglyph, &reading, &translation)).unwrap();
// println!("")
conn.execute("UPDATE cards SET imagename = ?1 WHERE hieroglyph = ?2", (&new_filename, &hieroglyph)).unwrap();
// conn.execute("INSERT OR REPLACE INTO cards (id, imagename) VALUES ((SELECT id FROM cards WHERE hieroglyph = ?1), ?2)", (&hieroglyph, &new_filename)).unwrap();
conn.execute("UPDATE cards SET is_learning = TRUE WHERE hieroglyph = ?1", [&hieroglyph]).unwrap();
}),
);