Skip to content

Commit

Permalink
fix #52
Browse files Browse the repository at this point in the history
  • Loading branch information
olback committed Jul 5, 2020
1 parent da4cb24 commit 90e4720
Show file tree
Hide file tree
Showing 10 changed files with 421 additions and 213 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 0.2.1
# 0.2.2
* Update download url (fixes 401 errors)

## 0.2.1
* Updated 'Update Instructions'
* Added Docker build instructions(thanks @4c0n)
* Fixed typo (thanks @4c0n)
Expand Down
596 changes: 403 additions & 193 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ll-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "library-loader-cli"
version = "0.2.0"
version = "0.2.1"
authors = ["Edwin Svensson <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion ll-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ crossbeam-channel = "0.3"
notify = "=5.0.0-pre.1"
clap = { version = "2.33", features = ["yaml"], optional = true }
rpassword = { version = "4.0", optional = true }
glib = { version = "0.9", optional = true }
glib = { version = "0.10", optional = true }
2 changes: 1 addition & 1 deletion ll-core/src/consts.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Component Search Enginge Url
pub const COMPONENT_SEARCH_ENGINE_URL: &str = "http://componentsearchengine.com/ga/model.php?partID=";
pub const COMPONENT_SEARCH_ENGINE_URL: &str = "https://componentsearchengine.com/ga/model.php?partID=";

// Url to use to validate credentials
pub const TRY_AUTH_URL: &str = "https://componentsearchengine.com/ga";
Expand Down
4 changes: 3 additions & 1 deletion ll-core/src/cse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ impl CSE {
let url = format!("{base}{id}", base = COMPONENT_SEARCH_ENGINE_URL, id = id);

let client = reqwest::Client::new();
let req = client.get(&url).header(header::AUTHORIZATION, format!("Basic {auth}", auth = &self.auth));
let req = client.get(&url)
.header(header::AUTHORIZATION, format!("Basic {auth}", auth = &self.auth))
.header(header::USER_AGENT, format!("Library Loader {} github.com/olback/library-loader", env!("CARGO_PKG_VERSION")));
let mut res = req.send()?;

let res_header = match res.headers().get("content-type") {
Expand Down
8 changes: 4 additions & 4 deletions ll-gui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "library-loader-gui"
version = "0.2.1"
version = "0.2.2"
authors = ["Edwin Svensson <[email protected]>"]
edition = "2018"
build = "build/build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
gtk = "0.8"
gio = "0.8"
glib = "0.9"
gtk = "0.9"
gio = "0.9"
glib = "0.10"
toml = "0.5"
serde = { version = "1.0", features = ["derive"] }
library-loader-core = { path = "../ll-core", features = ["gui"], default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion ll-gui/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl Ui {

pub fn build(app: &gtk::Application, state: &AMState) -> Self {

let builder = gtk::Builder::new_from_string(consts::GLADE_STRING);
let builder = gtk::Builder::from_string(consts::GLADE_STRING);

let main = main::build(&builder, &app);
let notebook = notebook::Notebook::build(&builder, &main, &state);
Expand Down
11 changes: 2 additions & 9 deletions ll-gui/src/ui/notebook/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,8 @@ impl Account {

} else {

let email = match email_clone.get_text() {
Some(v) => v.to_string(),
None => String::new()
};

let password = match password_clone.get_text() {
Some(v) => v.to_string(),
None => String::new()
};
let email = email_clone.get_text().to_string();
let password = password_clone.get_text().to_string();

let save_info = save_info_switch.get_active();

Expand Down
2 changes: 1 addition & 1 deletion ll-gui/src/utils/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::consts::RESOURCES_BYTES;
pub fn load_resources() {

let glib_resource_bytes = glib::Bytes::from_static(RESOURCES_BYTES);
let resources = gio::Resource::new_from_data(&glib_resource_bytes).expect("Failed to load resources");
let resources = gio::Resource::from_data(&glib_resource_bytes).expect("Failed to load resources");
gio::resources_register(&resources);

}

0 comments on commit 90e4720

Please sign in to comment.