From 80b60a885e127861d63420d3b66e135b50970e92 Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm Date: Fri, 10 Sep 2021 19:31:26 +0200 Subject: [PATCH 1/5] fix: elvui on tbc --- README.md | 2 -- crates/core/src/parse.rs | 30 +++++++++++++---------- crates/core/src/repository/backend/git.rs | 10 ++++++-- src/gui/update.rs | 9 ------- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 0c173615..21e4a3c6 100644 --- a/README.md +++ b/README.md @@ -108,8 +108,6 @@ Windows: | s | Go to Settings | | r | Refresh | | u | Update | -| Tab | Go to next tab | -| Ctrl + Tab | Go to previous tab | ## Command Line diff --git a/crates/core/src/parse.rs b/crates/core/src/parse.rs index bfb9aa5c..53d610b3 100644 --- a/crates/core/src/parse.rs +++ b/crates/core/src/parse.rs @@ -272,24 +272,28 @@ async fn parse_addon_folders( let mut addon_folders: Vec<_> = all_dirs .par_iter() .filter_map(|id| { - // Generate .toc path. If `-BCC` or `-Mainline` exists for Tbc and Era, - // respectively, use that over the standard toc. + // Generate .toc path. let toc_path = { let multi_part = match flavor.base_flavor() { - Flavor::Retail => "-Mainline", - Flavor::ClassicEra => "-Classic", - Flavor::ClassicTbc => "-BCC", - _ => "", + Flavor::Retail => vec!["Mainline"], + Flavor::ClassicEra => vec!["Classic", "Vanilla"], + Flavor::ClassicTbc => vec!["BCC", "TBC"], + _ => vec![], }; - let standard_path = root_dir.join(&id).join(format!("{}.toc", id)); - let multi_path = root_dir.join(&id).join(format!("{}{}.toc", id, multi_part)); - - if multi_path.exists() { - multi_path - } else { - standard_path + for part in multi_part { + for separator in vec!["-", "_"] { + let multi_path = root_dir + .join(&id) + .join(format!("{}{}{}.toc", id, separator, part)); + if multi_part.exists() { + return multi_path; + } + } } + + // If we don't have flavor specific toc, we return a default one. + root_dir.join(&id).join(format!("{}.toc", id)) }; if !toc_path.exists() { diff --git a/crates/core/src/repository/backend/git.rs b/crates/core/src/repository/backend/git.rs index 39043dc3..52a7c2b5 100644 --- a/crates/core/src/repository/backend/git.rs +++ b/crates/core/src/repository/backend/git.rs @@ -266,17 +266,23 @@ mod github { Flavor::Retail => { a.name.ends_with("zip") && !a.name.to_lowercase().contains("classic") + && !a.name.to_lowercase().contains("vanilla") && !a.name.to_lowercase().contains("bcc") + && !a.name.to_lowercase().contains("tbc") } Flavor::ClassicEra => { a.name.ends_with("zip") - && a.name.to_lowercase().contains("classic") + && (a.name.to_lowercase().contains("classic") + || a.name.to_lowercase().contains("vanilla")) && !a.name.to_lowercase().contains("bcc") + && !a.name.to_lowercase().contains("tbc") } Flavor::ClassicTbc => { a.name.ends_with("zip") && !a.name.to_lowercase().contains("classic") - && a.name.to_lowercase().contains("bcc") + && !a.name.to_lowercase().contains("vanilla") + && (a.name.to_lowercase().contains("bcc") + || !a.name.to_lowercase().contains("tbc")) } _ => a.name.ends_with("zip"), }); diff --git a/src/gui/update.rs b/src/gui/update.rs index 3f3d9da2..14389fae 100644 --- a/src/gui/update.rs +++ b/src/gui/update.rs @@ -2458,15 +2458,6 @@ pub fn handle_message(ajour: &mut Ajour, message: Message) -> Result (), - }, - iced::keyboard::KeyCode::Tab if !modifiers.alt => { - let flavor = ajour.config.wow.flavor; - - if modifiers.control { - ajour.mode = ajour.mode.previous(flavor); - } else { - ajour.mode = ajour.mode.next(flavor); - } } _ => (), }, From 066ab05da5b8a4e8339a65bc98839b97180e06d1 Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm <2248455+casperstorm@users.noreply.github.com> Date: Fri, 10 Sep 2021 19:42:48 +0200 Subject: [PATCH 2/5] fix: clippy and fmt --- crates/core/src/parse.rs | 37 ++++++++++++++++++++----------------- src/gui/mod.rs | 2 ++ src/gui/update.rs | 4 ++-- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/crates/core/src/parse.rs b/crates/core/src/parse.rs index 53d610b3..3c9b9bcd 100644 --- a/crates/core/src/parse.rs +++ b/crates/core/src/parse.rs @@ -274,26 +274,29 @@ async fn parse_addon_folders( .filter_map(|id| { // Generate .toc path. let toc_path = { - let multi_part = match flavor.base_flavor() { - Flavor::Retail => vec!["Mainline"], - Flavor::ClassicEra => vec!["Classic", "Vanilla"], - Flavor::ClassicTbc => vec!["BCC", "TBC"], - _ => vec![], - }; - - for part in multi_part { - for separator in vec!["-", "_"] { - let multi_path = root_dir - .join(&id) - .join(format!("{}{}{}.toc", id, separator, part)); - if multi_part.exists() { - return multi_path; + let toc_with_flavor = || -> Option { + let multi_part = match flavor.base_flavor() { + Flavor::Retail => vec!["Mainline"], + Flavor::ClassicEra => vec!["Classic", "Vanilla"], + Flavor::ClassicTbc => vec!["BCC", "TBC"], + _ => vec![], + }; + + for part in multi_part { + for separator in &["-", "_"] { + let toc_with_flavor = root_dir + .join(&id) + .join(format!("{}{}{}.toc", id, separator, part)); + if toc_with_flavor.exists() { + return Some(toc_with_flavor); + } } } - } - // If we don't have flavor specific toc, we return a default one. - root_dir.join(&id).join(format!("{}.toc", id)) + None + }; + + toc_with_flavor().unwrap_or_else(|| root_dir.join(&id).join(format!("{}.toc", id))) }; if !toc_path.exists() { diff --git a/src/gui/mod.rs b/src/gui/mod.rs index 59e39486..a1b9ffe2 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -67,6 +67,7 @@ pub enum Mode { } impl Mode { + #[allow(dead_code)] fn next(&self, flavor: Flavor) -> Self { use Mode::*; match *self { @@ -79,6 +80,7 @@ impl Mode { } } + #[allow(dead_code)] fn previous(&self, flavor: Flavor) -> Self { use Mode::*; match *self { diff --git a/src/gui/update.rs b/src/gui/update.rs index 14389fae..d3c62fc3 100644 --- a/src/gui/update.rs +++ b/src/gui/update.rs @@ -2419,7 +2419,7 @@ pub fn handle_message(ajour: &mut Ajour, message: Message) -> Result match key_code { iced::keyboard::KeyCode::A => { @@ -2458,7 +2458,7 @@ pub fn handle_message(ajour: &mut Ajour, message: Message) -> Result (), - } + }, _ => (), }, Message::Interaction(Interaction::PickBackupCompressionFormat(format)) => { From a8dfec0e327f775f03731634a46b118a9469ac04 Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm <2248455+casperstorm@users.noreply.github.com> Date: Fri, 10 Sep 2021 19:44:56 +0200 Subject: [PATCH 3/5] updated changelog and version --- CHANGELOG.md | 5 +++++ Cargo.toml | 8 ++++---- crates/core/Cargo.toml | 2 +- crates/weak_auras/Cargo.toml | 4 ++-- crates/widgets/Cargo.toml | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a70882f9..38386ae6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,11 @@ and `Removed`. is down. This new button should make it easier to try fetching the data again instead of relaunching the application. +### Fixed + +- ElvUI (and a few other) addons should now properly show up in Ajour again. +- Fixed issue where alt + tabbing would change view in Ajour. + ## [1.3.0] - 2021-08-05 ### Packaging diff --git a/Cargo.toml b/Cargo.toml index 129b27d9..cf447f1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ajour" description = "A World of Warcraft addon manager" -version = "1.3.0" +version = "1.3.1-rc.1" authors = ["Casper Rogild Storm"] license = "GPL-3.0" homepage = "https://github.com/ajour/ajour" @@ -18,9 +18,9 @@ opengl = ["ajour-widgets/opengl", "iced/glow", "iced/glow_default_system_font"] no-self-update = ["ajour-core/no-self-update"] [dependencies] -ajour-core = { version = "1.3.0", path = "crates/core", features=['gui'] } -ajour-weak-auras = { version = "1.3.0", path = "crates/weak_auras" } -ajour-widgets = { version = "1.3.0", path = "crates/widgets" } +ajour-core = { version = "1.3.1-rc.1", path = "crates/core", features=['gui'] } +ajour-weak-auras = { version = "1.3.1-rc.1", path = "crates/weak_auras" } +ajour-widgets = { version = "1.3.1-rc.1", path = "crates/widgets" } iced = { version = "0.3.0", default-features = false, features = ["debug"] } iced_futures = { version = "0.3.0", features = ["async-std"] } diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 7abaa222..41ba34e2 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ajour-core" description = "Core library for Ajour" -version = "1.3.0" +version = "1.3.1-rc.1" authors = ["Casper Rogild Storm"] license = "GPL-3.0" homepage = "https://github.com/ajour/ajour" diff --git a/crates/weak_auras/Cargo.toml b/crates/weak_auras/Cargo.toml index a10e0ab5..3ae2576f 100644 --- a/crates/weak_auras/Cargo.toml +++ b/crates/weak_auras/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ajour-weak-auras" description = "Weak Auras library for Ajour" -version = "1.3.0" +version = "1.3.1-rc.1" authors = ["Casper Rogild Storm", "tarkah "] license = "GPL-3.0" homepage = "https://github.com/ajour/ajour" @@ -17,7 +17,7 @@ name = "cli" required-features = ["cli"] [dependencies] -ajour-core = { version = "1.3.0", path = "../core" } +ajour-core = { version = "1.3.1-rc.1", path = "../core" } async-std = { version = "1.6", features = ["unstable"] } futures = "0.3" diff --git a/crates/widgets/Cargo.toml b/crates/widgets/Cargo.toml index c9d6ff08..064b8408 100644 --- a/crates/widgets/Cargo.toml +++ b/crates/widgets/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ajour-widgets" description = "Widget library for Ajour" -version = "1.3.0" +version = "1.3.1-rc.1" authors = ["Casper Rogild Storm", "tarkah "] license = "GPL-3.0" homepage = "https://github.com/ajour/ajour" From b435d19e797f373c234a021632493fab2b292e0b Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm <2248455+casperstorm@users.noreply.github.com> Date: Fri, 10 Sep 2021 19:45:03 +0200 Subject: [PATCH 4/5] Update Cargo.lock --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 649256ae..e97c545a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,7 +50,7 @@ dependencies = [ [[package]] name = "ajour" -version = "1.3.0" +version = "1.3.1-rc.1" dependencies = [ "ajour-core", "ajour-weak-auras", @@ -88,7 +88,7 @@ dependencies = [ [[package]] name = "ajour-core" -version = "1.3.0" +version = "1.3.1-rc.1" dependencies = [ "async-std", "async-trait", @@ -124,7 +124,7 @@ dependencies = [ [[package]] name = "ajour-weak-auras" -version = "1.3.0" +version = "1.3.1-rc.1" dependencies = [ "ajour-core", "anyhow", @@ -141,7 +141,7 @@ dependencies = [ [[package]] name = "ajour-widgets" -version = "1.3.0" +version = "1.3.1-rc.1" dependencies = [ "iced_core", "iced_glow", From 95ae2627cf30fe4c9859883f4131f9da4666259c Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm <2248455+casperstorm@users.noreply.github.com> Date: Fri, 10 Sep 2021 19:49:00 +0200 Subject: [PATCH 5/5] Update git.rs --- crates/core/src/repository/backend/git.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/core/src/repository/backend/git.rs b/crates/core/src/repository/backend/git.rs index 52a7c2b5..9eca9fba 100644 --- a/crates/core/src/repository/backend/git.rs +++ b/crates/core/src/repository/backend/git.rs @@ -282,7 +282,7 @@ mod github { && !a.name.to_lowercase().contains("classic") && !a.name.to_lowercase().contains("vanilla") && (a.name.to_lowercase().contains("bcc") - || !a.name.to_lowercase().contains("tbc")) + || a.name.to_lowercase().contains("tbc")) } _ => a.name.ends_with("zip"), }); @@ -410,17 +410,23 @@ mod gitlab { Flavor::Retail => { a.name.ends_with("zip") && !a.name.to_lowercase().contains("classic") + && !a.name.to_lowercase().contains("vanilla") && !a.name.to_lowercase().contains("bcc") + && !a.name.to_lowercase().contains("tbc") } Flavor::ClassicEra => { a.name.ends_with("zip") - && a.name.to_lowercase().contains("classic") + && (a.name.to_lowercase().contains("classic") + || a.name.to_lowercase().contains("vanilla")) && !a.name.to_lowercase().contains("bcc") + && !a.name.to_lowercase().contains("tbc") } Flavor::ClassicTbc => { a.name.ends_with("zip") && !a.name.to_lowercase().contains("classic") - && a.name.to_lowercase().contains("bcc") + && !a.name.to_lowercase().contains("vanilla") + && (a.name.to_lowercase().contains("bcc") + || a.name.to_lowercase().contains("tbc")) } _ => a.name.ends_with("zip"), });