Skip to content

Commit

Permalink
Keep Home tab in debug build only
Browse files Browse the repository at this point in the history
- this tab is useful for debugging only
- cleanup some warnings

Signed-off-by: Mikhail Malyshev <[email protected]>
  • Loading branch information
rucoder committed Nov 6, 2024
1 parent 9a6fe4c commit 2a407bf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ use crate::events::Event;
use crate::model::model::Model;
use crate::model::model::MonitorModel;
use crate::ui::ipdialog::InterfaceState;
use crate::ui::message_box::create_message_box;
use crate::ui::ui::Ui;
use core::fmt::Debug;

use std::cell::RefCell;
use std::collections::HashMap;
Expand Down
1 change: 0 additions & 1 deletion src/model/device/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ impl From<&NetworkPortStatus> for NetworkInterfaceStatus {
})
.unwrap(),
}),
_ => NetworkType::Ethernet,
};

let is_dhcp = port.dhcp == DhcpType::Client;
Expand Down
1 change: 1 addition & 0 deletions src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod activity;
pub mod app_page;
pub mod dialog;
pub mod focus_tracker;
#[cfg(debug_assertions)]
pub mod homepage;
pub mod input_dialog;
pub mod ipdialog;
Expand Down
13 changes: 8 additions & 5 deletions src/ui/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ use crate::{
use super::{
action::Action,
app_page::ApplicationsPage,
homepage::HomePage,
layer_stack::LayerStack,
networkpage::create_network_page,
statusbar::{create_status_bar, StatusBarState},
summary_page::SummaryPage,
window::Window,
};

#[cfg(debug_assertions)]
use super::homepage::HomePage;

use std::result::Result::Ok;

use anyhow::Result;
Expand All @@ -54,8 +56,8 @@ pub struct Ui {
#[derive(Default, Copy, Clone, Display, EnumIter, Debug, FromRepr, EnumCount)]
pub enum UiTabs {
#[default]
//Debug,
Summary,
#[cfg(debug_assertions)]
Home,
Network,
Applications,
Expand Down Expand Up @@ -92,9 +94,10 @@ impl Ui {

pub fn init(&mut self) {
self.views[UiTabs::Summary as usize].push(Box::new(SummaryPage::new()));
self.views[UiTabs::Home as usize].push(Box::new(HomePage::new()));

// self.views[UiTabs::Home as usize].push(Box::new(d));
#[cfg(debug_assertions)]
{
self.views[UiTabs::Home as usize].push(Box::new(HomePage::new()));
}

self.views[UiTabs::Network as usize].push(Box::new(create_network_page()));

Expand Down

0 comments on commit 2a407bf

Please sign in to comment.