gupax: add [FileWindow] selector for p2pool/xmrig path

This commit is contained in:
hinto-janaiyo 2022-11-17 13:03:45 -05:00
parent addf5ad60e
commit 51df689cb0
No known key found for this signature in database
GPG key ID: B1C5A64B80691E45
6 changed files with 337 additions and 55 deletions

280
Cargo.lock generated
View file

@ -263,6 +263,18 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "atk-sys"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "atomic"
version = "0.5.1"
@ -444,13 +456,23 @@ dependencies = [
]
[[package]]
name = "calloop"
version = "0.10.2"
name = "cairo-sys-rs"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "595eb0438b3c6d262395fe30e6de9a61beb57ea56290b00a07f227fe6e20cbf2"
checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8"
dependencies = [
"libc",
"system-deps",
]
[[package]]
name = "calloop"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bcf530afb40e45e14440701e5e996d7fd139e84a912a4d83a8d6a0fb3e58663"
dependencies = [
"log",
"nix 0.24.2",
"nix 0.25.0",
"slotmap",
"thiserror",
"vec_map",
@ -477,6 +499,15 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
[[package]]
name = "cfg-expr"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa"
dependencies = [
"smallvec",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
@ -1029,9 +1060,9 @@ dependencies = [
[[package]]
name = "digest"
version = "0.10.5"
version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c"
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
dependencies = [
"block-buffer 0.10.3",
"crypto-common",
@ -1632,6 +1663,36 @@ dependencies = [
"slab",
]
[[package]]
name = "gdk-pixbuf-sys"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7"
dependencies = [
"gio-sys",
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "gdk-sys"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88"
dependencies = [
"cairo-sys-rs",
"gdk-pixbuf-sys",
"gio-sys",
"glib-sys",
"gobject-sys",
"libc",
"pango-sys",
"pkg-config",
"system-deps",
]
[[package]]
name = "generic-array"
version = "0.14.6"
@ -1692,6 +1753,19 @@ version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"
[[package]]
name = "gio-sys"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
"winapi",
]
[[package]]
name = "gl_generator"
version = "0.14.0"
@ -1703,6 +1777,16 @@ dependencies = [
"xml-rs",
]
[[package]]
name = "glib-sys"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4"
dependencies = [
"libc",
"system-deps",
]
[[package]]
name = "glow"
version = "0.11.2"
@ -1780,6 +1864,35 @@ dependencies = [
"gl_generator",
]
[[package]]
name = "gobject-sys"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a"
dependencies = [
"glib-sys",
"libc",
"system-deps",
]
[[package]]
name = "gtk-sys"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84"
dependencies = [
"atk-sys",
"cairo-sys-rs",
"gdk-pixbuf-sys",
"gdk-sys",
"gio-sys",
"glib-sys",
"gobject-sys",
"libc",
"pango-sys",
"system-deps",
]
[[package]]
name = "gupax"
version = "0.2.0"
@ -1804,9 +1917,11 @@ dependencies = [
"monero",
"num-format",
"num_cpus",
"openssl",
"rand 0.8.5",
"regex",
"reqwest",
"rfd",
"rusqlite",
"serde",
"serde_json",
@ -1919,7 +2034,7 @@ version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
dependencies = [
"digest 0.10.5",
"digest 0.10.6",
]
[[package]]
@ -2528,6 +2643,19 @@ dependencies = [
"memoffset",
]
[[package]]
name = "nix"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb"
dependencies = [
"autocfg",
"bitflags",
"cfg-if",
"libc",
"memoffset",
]
[[package]]
name = "nohash-hasher"
version = "0.2.0"
@ -2737,6 +2865,15 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
version = "111.24.0+1.1.1s"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3498f259dab01178c6228c6b00dcef0ed2a2d5e20d648c017861227773ea4abd"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
version = "0.9.77"
@ -2746,6 +2883,7 @@ dependencies = [
"autocfg",
"cc",
"libc",
"openssl-src",
"pkg-config",
"vcpkg",
]
@ -2768,6 +2906,18 @@ dependencies = [
"ttf-parser",
]
[[package]]
name = "pango-sys"
version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "parking_lot"
version = "0.12.1"
@ -2820,7 +2970,7 @@ version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
dependencies = [
"digest 0.10.5",
"digest 0.10.6",
"hmac",
"password-hash",
"sha2 0.10.6",
@ -3191,9 +3341,9 @@ dependencies = [
[[package]]
name = "reqwest"
version = "0.11.12"
version = "0.11.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc"
checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c"
dependencies = [
"base64",
"bytes",
@ -3238,6 +3388,30 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90987092c28e12b9cfcea38be09f931b7cfcfe41429f2d0971f2cd57903d5d12"
[[package]]
name = "rfd"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0149778bd99b6959285b0933288206090c50e2327f47a9c463bfdbf45c8823ea"
dependencies = [
"block",
"dispatch",
"glib-sys",
"gobject-sys",
"gtk-sys",
"js-sys",
"lazy_static",
"log",
"objc",
"objc-foundation",
"objc_id",
"raw-window-handle 0.5.0",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"windows",
]
[[package]]
name = "ring"
version = "0.16.20"
@ -3260,7 +3434,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b"
dependencies = [
"byteorder",
"digest 0.10.5",
"digest 0.10.6",
"num-bigint-dig",
"num-integer",
"num-iter",
@ -3550,7 +3724,7 @@ checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f"
dependencies = [
"cfg-if",
"cpufeatures",
"digest 0.10.5",
"digest 0.10.6",
]
[[package]]
@ -3561,7 +3735,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
dependencies = [
"cfg-if",
"cpufeatures",
"digest 0.10.5",
"digest 0.10.6",
]
[[package]]
@ -3585,7 +3759,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
dependencies = [
"cfg-if",
"cpufeatures",
"digest 0.10.5",
"digest 0.10.6",
]
[[package]]
@ -3594,7 +3768,7 @@ version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9"
dependencies = [
"digest 0.10.5",
"digest 0.10.6",
"keccak",
]
@ -3807,6 +3981,19 @@ dependencies = [
"unicode-xid",
]
[[package]]
name = "system-deps"
version = "6.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff"
dependencies = [
"cfg-expr",
"heck 0.4.0",
"pkg-config",
"toml",
"version-compare",
]
[[package]]
name = "tar"
version = "0.4.38"
@ -4126,7 +4313,7 @@ checksum = "0a212a87f32d6703b08276ce59e26b4b18e14b4e45bbd08d5fcacd93ffca8841"
dependencies = [
"arrayref",
"bytes",
"digest 0.10.5",
"digest 0.10.6",
"educe",
"generic-array",
"getrandom 0.2.8",
@ -4166,7 +4353,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cfbe2cd71c0753a039f7e212d81fd69ac93903ba7f0bafd3db6d5e8b8607022"
dependencies = [
"caret",
"digest 0.10.5",
"digest 0.10.6",
"signature",
"thiserror",
"tor-bytes",
@ -4287,7 +4474,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1105ea5a5e348f0e2d81cd1f60c1fdbe84b4f9f15f67d8917bca2911a72878b7"
dependencies = [
"digest 0.10.5",
"digest 0.10.6",
"hex",
"thiserror",
"tor-llcrypto",
@ -4330,7 +4517,7 @@ dependencies = [
"base64",
"derive_builder_fork_arti",
"derive_more",
"digest 0.10.5",
"digest 0.10.6",
"educe",
"event-listener",
"fs-mistrust",
@ -4443,7 +4630,7 @@ dependencies = [
"base64",
"ctr",
"curve25519-dalek",
"digest 0.10.5",
"digest 0.10.6",
"ed25519-dalek",
"getrandom 0.2.8",
"hex",
@ -4497,7 +4684,7 @@ dependencies = [
"base64ct",
"bitflags",
"derive_more",
"digest 0.10.5",
"digest 0.10.6",
"educe",
"hex",
"once_cell",
@ -4546,7 +4733,7 @@ dependencies = [
"cipher 0.4.3",
"coarsetime",
"derive_builder_fork_arti",
"digest 0.10.5",
"digest 0.10.6",
"educe",
"futures",
"generic-array",
@ -4778,6 +4965,12 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]]
name = "version-compare"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29"
[[package]]
name = "version_check"
version = "0.9.4"
@ -5070,6 +5263,19 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647"
dependencies = [
"windows_aarch64_msvc 0.37.0",
"windows_i686_gnu 0.37.0",
"windows_i686_msvc 0.37.0",
"windows_x86_64_gnu 0.37.0",
"windows_x86_64_msvc 0.37.0",
]
[[package]]
name = "windows-sys"
version = "0.36.1"
@ -5110,6 +5316,12 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_aarch64_msvc"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a"
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.0"
@ -5122,6 +5334,12 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_gnu"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1"
[[package]]
name = "windows_i686_gnu"
version = "0.42.0"
@ -5134,6 +5352,12 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_i686_msvc"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c"
[[package]]
name = "windows_i686_msvc"
version = "0.42.0"
@ -5146,6 +5370,12 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
[[package]]
name = "windows_x86_64_gnu"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d"
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.0"
@ -5164,6 +5394,12 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]]
name = "windows_x86_64_msvc"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.42.0"

View file

@ -36,10 +36,11 @@ log = "0.4.17"
monero = "0.18.0"
num_cpus = "1.13.1"
num-format = "0.4.0"
#openssl = { version = "*", features = ["vendored"] }
openssl = { version = "*", features = ["vendored"] }
rand = "0.8.5"
regex = "1.6.0"
reqwest = { version = "0.11.12", features = ["blocking", "json"] }
rfd = "0.10.0"
rusqlite = { version = "0.28.0", features = ["bundled"] }
serde = { version = "1.0.145", features = ["rc", "derive"] }
serde_json = "1.0"
@ -47,7 +48,6 @@ sha2 = "0.10.6"
tls-api = "0.9.0"
tls-api-native-tls = "0.9.0"
tokio = { version = "1.21.2", features = ["full"] }
#toml = "0.5.9"
toml = { version = "0.5.9", features = ["preserve_order"] }
tor-rtcompat = "0.7.0"
walkdir = "2.3.2"

View file

@ -73,7 +73,7 @@ pub fn get_file_path(file: File) -> Result<PathBuf, TomlError> {
let mut path = match dirs::data_dir() {
Some(mut path) => {
path.push(DIRECTORY);
info!("OS data path ... OK");
info!("OS | Data path ... OK");
path
},
None => { error!("Couldn't get OS PATH for data"); return Err(TomlError::Path(PATH_ERROR.to_string())) },

View file

@ -29,8 +29,33 @@ use std::thread;
use std::sync::{Arc,Mutex};
use log::*;
//---------------------------------------------------------------------------------------------------- FileWindow
// Struct for writing/reading the path state.
// The opened file picker is started in a new
// thread so main() needs to be in sync.
pub struct FileWindow {
thread: bool, // Is there already a FileWindow thread?
picked_p2pool: bool, // Did the user pick a path for p2pool?
picked_xmrig: bool, // Did the user pick a path for xmrig?
p2pool_path: String, // The picked p2pool path
xmrig_path: String, // The picked p2pool path
}
impl FileWindow {
pub fn new() -> Arc<Mutex<Self>> {
Arc::new(Mutex::new(Self {
thread: false,
picked_p2pool: false,
picked_xmrig: false,
p2pool_path: String::new(),
xmrig_path: String::new(),
}))
}
}
//---------------------------------------------------------------------------------------------------- Gupax
impl Gupax {
pub fn show(&mut self, og: &Arc<Mutex<State>>, state_ver: &Arc<Mutex<Version>>, update: &Arc<Mutex<Update>>, width: f32, height: f32, ctx: &egui::Context, ui: &mut egui::Ui) {
pub fn show(&mut self, og: &Arc<Mutex<State>>, state_ver: &Arc<Mutex<Version>>, update: &Arc<Mutex<Update>>, file_window: &Arc<Mutex<FileWindow>>, width: f32, height: f32, ctx: &egui::Context, ui: &mut egui::Ui) {
// Update button + Progress bar
ui.group(|ui| {
// These are in unnecessary [ui.vertical()]'s
@ -127,6 +152,21 @@ impl Gupax {
};
}
ui.spacing_mut().text_edit_width = ui.available_width() - SPACE;
if ui.button("Select File").clicked() {
if file_window.lock().unwrap().thread == false {
let file_window = Arc::clone(file_window);
thread::spawn(move|| {
match rfd::FileDialog::new().set_title("Select P2Pool Binary for Gupax").pick_file() {
Some(path) => {
info!("Gupax | [{}] path selected for P2Pool", path.display());
file_window.lock().unwrap().p2pool_path = path.display().to_string();
file_window.lock().unwrap().picked_p2pool = true;
},
None => info!("Gupax | No path selected for P2Pool"),
};
});
}
}
ui.text_edit_singleline(&mut self.p2pool_path).on_hover_text(GUPAX_PATH_P2POOL);
});
ui.horizontal(|ui| {
@ -145,7 +185,26 @@ impl Gupax {
};
}
ui.spacing_mut().text_edit_width = ui.available_width() - SPACE;
if ui.button("Select File").clicked() {
if file_window.lock().unwrap().thread == false {
let file_window = Arc::clone(file_window);
thread::spawn(move|| {
match rfd::FileDialog::new().set_title("Select XMRig Binary for Gupax").pick_file() {
Some(path) => {
info!("Gupax | [{}] path selected for XMRig", path.display());
file_window.lock().unwrap().xmrig_path = path.display().to_string();
file_window.lock().unwrap().picked_xmrig = true;
},
None => info!("Gupax | No path selected for XMRig"),
};
});
}
}
ui.text_edit_singleline(&mut self.xmrig_path).on_hover_text(GUPAX_PATH_XMRIG);
});
let mut guard = file_window.lock().unwrap();
if guard.picked_p2pool { self.p2pool_path = guard.p2pool_path.clone(); guard.picked_p2pool = false; }
if guard.picked_xmrig { self.xmrig_path = guard.xmrig_path.clone(); guard.picked_xmrig = false; }
drop(guard);
}
}

View file

@ -54,7 +54,7 @@ mod gupax;
mod p2pool;
mod xmrig;
mod update;
use {ferris::*,constants::*,node::*,disk::*,status::*,update::*};
use {ferris::*,constants::*,node::*,disk::*,status::*,update::*,gupax::*};
//---------------------------------------------------------------------------------------------------- Struct + Impl
// The state of the outer main [App].
@ -69,6 +69,7 @@ pub struct App {
og: Arc<Mutex<State>>, // og = Old state to compare against
state: State, // state = Working state (current settings)
update: Arc<Mutex<Update>>, // State for update data [update.rs]
file_window: Arc<Mutex<FileWindow>>, // State for the path selector in [Gupax]
ping: Arc<Mutex<Ping>>, // Ping data found in [node.rs]
og_node_vec: Vec<(String, Node)>, // Manual Node database
node_vec: Vec<(String, Node)>, // Manual Node database
@ -110,6 +111,7 @@ impl App {
}
fn new() -> Self {
info!("Initializing App Struct...");
let app = Self {
tab: Tab::default(),
ping: Arc::new(Mutex::new(Ping::new())),
@ -118,6 +120,7 @@ impl App {
og: Arc::new(Mutex::new(State::new())),
state: State::new(),
update: Arc::new(Mutex::new(Update::new(String::new(), PathBuf::new(), PathBuf::new(), true))),
file_window: FileWindow::new(),
og_node_vec: Node::new_vec(),
node_vec: Node::new_vec(),
diff: false,
@ -178,6 +181,7 @@ impl App {
let tor = og.gupax.update_via_tor;
app.update = Arc::new(Mutex::new(Update::new(app.exe.clone(), p2pool_path, xmrig_path, tor)));
drop(og); // Unlock [og]
info!("App ... OK");
app
}
}
@ -861,7 +865,7 @@ impl eframe::App for App {
Status::show(self, self.width, self.height, ctx, ui);
}
Tab::Gupax => {
Gupax::show(&mut self.state.gupax, &self.og, &self.state.version, &self.update, self.width, self.height, ctx, ui);
Gupax::show(&mut self.state.gupax, &self.og, &self.state.version, &self.update, &self.file_window, self.width, self.height, ctx, ui);
}
Tab::P2pool => {
P2pool::show(&mut self.state.p2pool, &mut self.node_vec, &self.og, self.p2pool, &self.ping, &self.regex, self.width, self.height, ctx, ui);

View file

@ -34,12 +34,12 @@ pub const CAKE: &'static str = "xmr-node.cakewallet.com:18081";
pub const CAKE_EU: &'static str = "xmr-node-eu.cakewallet.com:18081";
pub const CAKE_UK: &'static str = "xmr-node-uk.cakewallet.com:18081";
pub const CAKE_US: &'static str = "xmr-node-usa-east.cakewallet.com:18081";
pub const FEATHER_1: &'static str = "selsta1.featherwallet.net:18081";
pub const FEATHER_2: &'static str = "selsta2.featherwallet.net:18081";
pub const MAJESTICBANK_IS: &'static str = "node.majesticbank.is:18089";
pub const MAJESTICBANK_SU: &'static str = "node.majesticbank.su:18089";
pub const MONERUJO: &'static str = "nodex.monerujo.io:18081";
pub const RINO: &'static str = "node.community.rino.io:18081";
pub const SELSTA_1: &'static str = "selsta1.featherwallet.net:18081";
pub const SELSTA_2: &'static str = "selsta2.featherwallet.net:18081";
pub const SETH: &'static str = "node.sethforprivacy.com:18089";
pub const SUPPORTXMR: &'static str = "node.supportxmr.com:18081";
pub const SUPPORTXMR_IR: &'static str = "node.supportxmr.ir:18081";
@ -47,14 +47,14 @@ pub const SINGAPORE: &'static str = "singapore.node.xmr.pm:18089";
pub const XMRVSBEAST: &'static str = "p2pmd.xmrvsbeast.com:18081";
pub const NODE_IPS: [&'static str; 16] = [
C3POOL,CAKE,CAKE_EU,CAKE_UK,CAKE_US,MAJESTICBANK_IS,MAJESTICBANK_SU,MONERUJO,
RINO,SELSTA_1,SELSTA_2,SETH,SUPPORTXMR,SUPPORTXMR_IR,SINGAPORE,XMRVSBEAST,
C3POOL,CAKE,CAKE_EU,CAKE_UK,CAKE_US,FEATHER_1,FEATHER_2,MAJESTICBANK_IS,MAJESTICBANK_SU,
MONERUJO,RINO,SETH,SUPPORTXMR,SUPPORTXMR_IR,SINGAPORE,XMRVSBEAST,
];
#[derive(Copy,Clone,Eq,PartialEq,Debug,Deserialize,Serialize)]
pub enum NodeEnum {
C3pool,Cake,CakeEu,CakeUk,CakeUs,MajesticBankIs,MajesticBankSu,Monerujo,
Rino,Selsta1,Selsta2,Seth,SupportXmr,SupportXmrIr,Singapore,XmrVsBeast,
Rino,Feather1,Feather2,Seth,SupportXmr,SupportXmrIr,Singapore,XmrVsBeast,
}
impl std::fmt::Display for NodeEnum {
@ -122,12 +122,12 @@ pub fn ip_to_enum(ip: &'static str) -> NodeEnum {
CAKE_EU => CakeEu,
CAKE_UK => CakeUk,
CAKE_US => CakeUs,
FEATHER_1 => Feather1,
FEATHER_2 => Feather2,
MAJESTICBANK_IS => MajesticBankIs,
MAJESTICBANK_SU => MajesticBankSu,
MONERUJO => Monerujo,
RINO => Rino,
SELSTA_1 => Selsta1,
SELSTA_2 => Selsta2,
SETH => Seth,
SINGAPORE => Singapore,
SUPPORTXMR => SupportXmr,
@ -143,12 +143,12 @@ pub fn enum_to_ip(node: NodeEnum) -> &'static str {
CakeEu => CAKE_EU,
CakeUk => CAKE_UK,
CakeUs => CAKE_US,
Feather1 => FEATHER_1,
Feather2 => FEATHER_2,
MajesticBankIs => MAJESTICBANK_IS,
MajesticBankSu => MAJESTICBANK_SU,
Monerujo => MONERUJO,
Rino => RINO,
Selsta1 => SELSTA_1,
Selsta2 => SELSTA_2,
Seth => SETH,
Singapore => SINGAPORE,
SupportXmr => SUPPORTXMR,
@ -237,24 +237,7 @@ pub fn ping(ping: Arc<Mutex<Ping>>, og: Arc<Mutex<State>>) {
for ip in NODE_IPS.iter() {
// Match IP
let id = match *ip {
C3POOL => C3pool,
CAKE => Cake,
CAKE_EU => CakeEu,
CAKE_UK => CakeUk,
CAKE_US => CakeUs,
MAJESTICBANK_IS => MajesticBankIs,
MAJESTICBANK_SU => MajesticBankSu,
MONERUJO => Monerujo,
RINO => Rino,
SELSTA_1 => Selsta1,
SELSTA_2 => Selsta2,
SETH => Seth,
SINGAPORE => Singapore,
SUPPORTXMR => SupportXmr,
SUPPORTXMR_IR => SupportXmrIr,
_ => XmrVsBeast,
};
let id = ip_to_enum(ip);
// Misc
let mut timeout = 0;
let mut mid = Duration::new(0, 0);