From 1e1da03c76da63d9a87dcac6c1c2f3d4650d98c2 Mon Sep 17 00:00:00 2001 From: Nefomemes Date: Fri, 22 Oct 2021 19:19:23 +0700 Subject: [PATCH] feat: implement app.report-issue and app.search-feature-requests actions --- Cargo.lock | 118 +++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 17 ++++--- src/app/menubar.rs | 16 +++++- 3 files changed, 142 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 22d9c21..d08c660 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,6 +20,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bumpalo" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" + [[package]] name = "cairo-rs" version = "0.14.7" @@ -62,6 +68,12 @@ dependencies = [ "smallvec", ] +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "echidna" version = "0.1.0" @@ -74,6 +86,7 @@ dependencies = [ "serde", "serde_json", "sourceview5", + "webbrowser", ] [[package]] @@ -424,12 +437,36 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +[[package]] +name = "js-sys" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + [[package]] name = "libc" version = "0.2.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103" +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + [[package]] name = "memoffset" version = "0.6.4" @@ -784,6 +821,87 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +[[package]] +name = "wasm-bindgen" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" + +[[package]] +name = "web-sys" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecad156490d6b620308ed411cfee90d280b3cbd13e189ea0d3fada8acc89158a" +dependencies = [ + "web-sys", + "widestring", + "winapi", +] + +[[package]] +name = "widestring" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 0516f82..1343bdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,12 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -gtk = { version = "0.3.0", package = "gtk4" } -gio = { version = "0.14.6", package = "gio" } -glib = "0.14.5" -serde_json = "1.0.68" -serde = { version = "1.0.130", features = ["derive"] } -relative-path = "1.5.0" -gdk = { version = "0.3.0", package = "gdk4"} -sourceview = { package = "sourceview5", version = "0.3.0"} \ No newline at end of file +gtk = { version = "^0.3.0", package = "gtk4" } +gio = { version = "^0.14.6", package = "gio" } +glib = "^0.14.5" +serde_json = "^1.0.68" +serde = { version = "^1.0.130", features = ["derive"] } +relative-path = "^1.5.0" +gdk = { version = "^0.3.0", package = "gdk4"} +sourceview = { package = "sourceview5", version = "^0.3.0"} +webbrowser = { version = "^0.5.5" } \ No newline at end of file diff --git a/src/app/menubar.rs b/src/app/menubar.rs index 98dc3a9..9682342 100644 --- a/src/app/menubar.rs +++ b/src/app/menubar.rs @@ -75,12 +75,26 @@ impl MenubarImplementedEditor for EchidnaEditor { about_dialog.set_visible(true); }); + let act_report_issue = SimpleAction::new("report-issue", None); + + app.add_action(&act_report_issue); + + act_report_issue.connect_activate(|_action, _variant| { + webbrowser::open("https://github.com/EchidnaHQ/Echidna/issues/new"); + }); + let act_search_feature_requests = SimpleAction::new("search-feature-requests", None); + + app.add_action(&act_search_feature_requests); + + act_search_feature_requests.connect_activate(|_action, _variant| { + webbrowser::open("https://github.com/EchidnaHQ/Echidna/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement"); + }); let act_window_close = SimpleAction::new("close", None); window.add_action(&act_window_close); - act_window_close.connect_activate(clone!(@weak window => + act_window_close.connect_activate(clone!(@weak window => move | _action, _variant | { window.close(); }