Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ serde = { version = "1", features = ["derive"] }
toml = "0.8"
unicode-width = "0.2"
p2poolv2_config = { git = "https://github.com/p2poolv2/p2poolv2", package = "p2poolv2_config" }
bitcoin = "0.32.5"
toml_edit = "0.22"

[dev-dependencies]
insta = "1.44.3"
Expand Down
13 changes: 13 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use crate::bitcoin_config::ConfigEntry as BitcoinEntry;
use crate::components::bitcoin_config_view::BitcoinConfigView;
use crate::components::file_explorer::FileExplorer;
use crate::components::p2pool_config_view::P2PoolConfigView;
use crate::components::settings_view::SettingsView;
use crate::settings::Settings;
use p2poolv2_config::Config as P2PoolConfig;
Expand Down Expand Up @@ -71,6 +72,10 @@ pub enum AppAction {
CommitEdit(usize, String),
// Saves bitcoin config to disk
SaveBitcoinConfig,
/// Commits an edited p2pool config value: (entry index, new value)
CommitP2PoolEdit(usize, String),
/// Saves p2pool config to disk
SaveP2PoolConfig,
// Open the file explorer to pick a path for a settings field (field index)
OpenExplorerForSettings(usize),
// Clear a settings field by index, setting it back to None
Expand All @@ -85,6 +90,7 @@ pub struct App {
pub p2pool_conf_path: Option<PathBuf>,
pub explorer: FileExplorer,
pub bitcoin_config_view: BitcoinConfigView,
pub p2pool_config_view: P2PoolConfigView,
pub settings_view: SettingsView,
pub p2pool_config: Option<P2PoolConfig>,
pub bitcoin_data: Vec<BitcoinEntry>,
Expand All @@ -109,6 +115,7 @@ impl App {
p2pool_conf_path: None,
explorer: FileExplorer::new(),
bitcoin_config_view: BitcoinConfigView::new(),
p2pool_config_view: P2PoolConfigView::new(),
settings_view: SettingsView::new(),
p2pool_config: None,
bitcoin_data: Vec::new(),
Expand All @@ -127,6 +134,12 @@ impl App {
self.bitcoin_config_view.editing = false;
self.bitcoin_config_view.edit_input.clear();
}
if self.current_screen == CurrentScreen::P2PoolConfig {
self.p2pool_config_view.warning_message = None;
self.p2pool_config_view.save_message = None;
self.p2pool_config_view.editing = false;
self.p2pool_config_view.edit_input.clear();
}
if let Some(&(_, screen)) = SIDEBAR_ITEMS.get(self.sidebar_index) {
self.current_screen = screen;
}
Expand Down
Loading
Loading