Skip to content

Commit

Permalink
final bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dinaraparanid committed Mar 3, 2021
1 parent 06587b7 commit 1726198
Show file tree
Hide file tree
Showing 16 changed files with 391 additions and 258 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "booklibrs"
version = "1.0.13"
version = "1.0.14"
authors = ["Paranid5 <dinaraparanid@gmail.com>"]
edition = "2018"
license = "MIT/Apache-2.0"
description = "Book libarary project including giveaway operations and gui interface."
homepage = "https://github.com/dinaraparanid/Library_rs"
documentation = "https://docs.rs/binartree/1.0.13/booklibrs/"
documentation = "https://docs.rs/binartree/1.0.14/booklibrs/"

[dependencies]
chrono = "0.4.19"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ crates.io: https://crates.io/crates/booklibrs
If you familiar with Rust, then you can write *cargo run (--release)* in your console.
If you aren't familiar with Rust and you can't stand using cmd, than click on run.bat and program will start.

*full version with all decompiled files: https://drive.google.com/drive/folders/1mOTWStFbS_NS7iYs0uxS6MlT9jv8qZRf*
*full version with all decompiled files: https://drive.google.com/drive/u/0/folders/1mOTWStFbS_NS7iYs0uxS6MlT9jv8qZRf*


20 changes: 11 additions & 9 deletions src/actions/book/add_rem/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,17 @@ pub fn add_books(
books.get_unchecked(1),
x,
) {
Some(i) => add_books_simple(
i,
book_system,
reader_base,
genres,
caretaker,
app,
lang,
),
Some(i) => {
add_books_simple(
i,
book_system,
reader_base,
genres,
caretaker,
app,
lang,
);
}
None => add_book_simple(book_system, &books, app, lang),
},

Expand Down
32 changes: 19 additions & 13 deletions src/actions/book/add_rem/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub(crate) fn add_books_simple(
caretaker: &mut Caretaker,
app: &App,
lang: Lang,
) {
) -> bool {
let (s3, r3) = app::channel();
let mut get_amount = Input1::<IntInput>::new(
match lang {
Expand All @@ -89,7 +89,7 @@ pub(crate) fn add_books_simple(
get_amount.hide();

if let Ok(amount) = get_amount.set_input() {
match amount.first().unwrap().trim().parse::<usize>() {
return match amount.first().unwrap().trim().parse::<usize>() {
Ok(x) => match book_system.add_books(ind, x, app, lang) {
Ok(_) => {
fltk::dialog::message(
Expand All @@ -101,6 +101,7 @@ pub(crate) fn add_books_simple(
},
);
book_system.save();
true
}

Err(_) => {
Expand All @@ -113,7 +114,7 @@ pub(crate) fn add_books_simple(
},
);
caretaker.pop();
return;
false
}
},

Expand All @@ -127,18 +128,20 @@ pub(crate) fn add_books_simple(
},
);
caretaker.pop();
return;
false
}
}
};
}
}

false => (),
}
} else if !get_amount.shown() {
return;
return false;
}
}

false
}

/// Removes one simple book from known the book
Expand All @@ -152,7 +155,7 @@ pub(crate) fn remove_book_simple(
caretaker: &mut Caretaker,
app: &App,
lang: Lang,
) {
) -> bool {
let (s3, r3) = app::channel();
let mut get_ind = Input1::<IntInput>::new(
match lang {
Expand All @@ -177,7 +180,7 @@ pub(crate) fn remove_book_simple(
get_ind.hide();

if let Ok(ind) = get_ind.set_input() {
match ind.first().unwrap().trim().parse::<usize>() {
return match ind.first().unwrap().trim().parse::<usize>() {
Ok(x) => {
if x == 0 {
alert(
Expand All @@ -189,7 +192,7 @@ pub(crate) fn remove_book_simple(
},
);
caretaker.pop();
return;
false
} else {
match book_system.remove_one_book(index, x - 1) {
Ok(_) => {
Expand All @@ -203,6 +206,7 @@ pub(crate) fn remove_book_simple(
);
book_system.save();
reader_base.save();
true
}

Err(_) => {
Expand All @@ -215,7 +219,7 @@ pub(crate) fn remove_book_simple(
},
);
caretaker.pop();
return;
false
}
}
}
Expand All @@ -231,18 +235,20 @@ pub(crate) fn remove_book_simple(
},
);
caretaker.pop();
return;
false
}
}
};
}
}

false => (),
}
} else if !get_ind.shown() {
return;
return false;
}
}

false
}

/// Removes one known simple book from known the book
Expand Down
2 changes: 2 additions & 0 deletions src/actions/book/change/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ pub fn change_location(
}
false => (),
}
} else if !inp2.shown() {
break;
}
}
}
Expand Down
Loading

0 comments on commit 1726198

Please sign in to comment.