mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-21 20:23:20 +03:00
cleanup
This commit is contained in:
@@ -146,4 +146,8 @@ impl ClientRow {
|
|||||||
pub fn set_position(&self, pos: Position) {
|
pub fn set_position(&self, pos: Position) {
|
||||||
self.imp().set_pos(pos);
|
self.imp().set_pos(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_dns_state(&self, resolved: bool) {
|
||||||
|
self.imp().set_dns_state(resolved);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,6 +213,14 @@ impl ClientRow {
|
|||||||
.set_active(active);
|
.set_active(active);
|
||||||
self.enable_switch.unblock_signal(handler);
|
self.enable_switch.unblock_signal(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(super) fn set_dns_state(&self, resolved: bool) {
|
||||||
|
if resolved {
|
||||||
|
self.dns_button.set_css_classes(&["success"])
|
||||||
|
} else {
|
||||||
|
self.dns_button.set_css_classes(&["warning"])
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WidgetImpl for ClientRow {}
|
impl WidgetImpl for ClientRow {}
|
||||||
|
|||||||
@@ -368,11 +368,7 @@ impl Window {
|
|||||||
|
|
||||||
fn update_dns_state(&self, handle: ClientHandle, resolved: bool) {
|
fn update_dns_state(&self, handle: ClientHandle, resolved: bool) {
|
||||||
if let Some(client_row) = self.row_for_handle(handle) {
|
if let Some(client_row) = self.row_for_handle(handle) {
|
||||||
if resolved {
|
client_row.set_dns_state(resolved);
|
||||||
client_row.imp().dns_button.set_css_classes(&["success"])
|
|
||||||
} else {
|
|
||||||
client_row.imp().dns_button.set_css_classes(&["warning"])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user