-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move network settings in the settings page
fix: update network settings screen with shared components fix: remove logs panel from the settings page as it takes a lot of resources to load long log files fix: other minor improvements to the new settings page
- Loading branch information
Showing
16 changed files
with
267 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<BooleanItem>: | ||
height: 36 | ||
size_hint_y: None | ||
BoxLayout: | ||
orientation: "horizontal" | ||
Button: | ||
size_hint_x: None | ||
width: self.height | ||
font_name: "fonts/Font Awesome 6 Free-Solid-900.otf" | ||
font_size: 21 | ||
text: "\uf129" | ||
Label: | ||
size_hint_x: 0.7 | ||
text: root.name | ||
ToggleButton: | ||
size_hint_x: None | ||
width: 250 | ||
multiline: False | ||
text: 'ON' if root.value else 'OFF' | ||
state: 'down' if root.value else 'normal' | ||
on_release: root.value = True if self.state == 'down' else False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
|
||
from kivy.lang import Builder | ||
from kivy.logger import Logger | ||
from kivy.properties import StringProperty, BooleanProperty | ||
from kivy.uix.boxlayout import BoxLayout | ||
|
||
log = Logger.getChild(__name__) | ||
kv_file = os.path.join(os.path.dirname(__file__), __file__.replace(".py", ".kv")) | ||
if os.path.exists(kv_file): | ||
log.info(f"Loading KV file: {kv_file}") | ||
Builder.load_file(kv_file) | ||
|
||
|
||
class BooleanItem(BoxLayout): | ||
name = StringProperty("") | ||
value = BooleanProperty(False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,5 @@ | |
width: 250 | ||
multiline: False | ||
text: root.value | ||
disabled: root.disabled | ||
on_text_validate: root.value = self.text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 0 additions & 135 deletions
135
rotary_controller_python/components/network/network_popup.kv
This file was deleted.
Oops, something went wrong.
82 changes: 0 additions & 82 deletions
82
rotary_controller_python/components/network/network_popup.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
rotary_controller_python/components/setup/network_panel.kv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#: import StringItem components.forms.string_item | ||
#: import BooleanItem components.forms.boolean_item | ||
|
||
<NetworkPanel>: | ||
orientation: "vertical" | ||
ScrollView: | ||
do_scroll_x: False | ||
do_scroll_y: True | ||
GridLayout: | ||
id: grid_layout | ||
cols: 1 | ||
spacing: 1 | ||
size_hint_y: None | ||
StringItem: | ||
name: "Network Interface" | ||
value: root.device | ||
on_value: root.device = self.value | ||
|
||
StringItem: | ||
name: "Wifi Network" | ||
value: root.wpa_ssid | ||
on_value: root.wpa_ssid = self.value | ||
|
||
StringItem: | ||
name: "Wifi Password" | ||
value: root.wpa_psk | ||
on_value: root.wpa_psk = self.value | ||
|
||
BooleanItem: | ||
name: "Use DHCP" | ||
value: root.dhcp | ||
on_value: root.dhcp = self.value | ||
|
||
StringItem: | ||
name: "IP Address" | ||
value: root.address | ||
disabled: root.dhcp | ||
on_value: root.address = self.value | ||
|
||
StringItem: | ||
name: "Netmask Bits" | ||
value: root.netmask | ||
disabled: root.dhcp | ||
on_value: root.netmask = self.value | ||
|
||
StringItem: | ||
name: "Default Gateway" | ||
value: root.gateway | ||
disabled: root.dhcp | ||
on_value: root.gateway = self.value | ||
|
||
|
||
BoxLayout: | ||
orientation: "horizontal" | ||
|
||
BoxLayout: | ||
size_hint_y: None | ||
height: 64 | ||
orientation: "horizontal" | ||
Label: | ||
size_hint_x: 0.3 | ||
text: "Status:" | ||
TextInput: | ||
readonly: True | ||
multiline: True | ||
text: root.status_text | ||
|
||
BoxLayout: | ||
size_hint_y: None | ||
height: 48 | ||
orientation: "horizontal" | ||
|
||
Button: | ||
text: "Apply" | ||
background_color: "#cf3a3a" | ||
on_release: root.test_configuration() |
Oops, something went wrong.