This commit is contained in:
Mark Qvist 2023-10-31 17:48:17 +01:00
parent dec98f26f8
commit 82e054e840
2 changed files with 274 additions and 246 deletions

View File

@ -262,8 +262,8 @@ class SidebandApp(MDApp):
self.update_loading_text() self.update_loading_text()
self.init_announces_view() self.init_announces_view()
self.announces_view.update() self.announces_view.update()
self.telemetry_init() # self.telemetry_init()
self.settings_init() # self.settings_init()
self.connectivity_init() self.connectivity_init()
self.object_details_screen = ObjectDetails(self) self.object_details_screen = ObjectDetails(self)

View File

@ -973,7 +973,6 @@ MDScreen:
disabled: False disabled: False
""" """
layout_map_screen = """ layout_map_screen = """
MDScreen: MDScreen:
name: "map_screen" name: "map_screen"
@ -1101,6 +1100,7 @@ MDScreen:
orientation: "vertical" orientation: "vertical"
MDTopAppBar: MDTopAppBar:
id: settings_top_bar
title: "Preferences" title: "Preferences"
anchor_title: "left" anchor_title: "left"
elevation: 0 elevation: 0
@ -1111,31 +1111,55 @@ MDScreen:
['close', lambda x: root.app.close_settings_action(self)], ['close', lambda x: root.app.close_settings_action(self)],
] ]
ScrollView: MDScrollView:
id: settings_scrollview id: settings_scrollview
size_hint_x: 1
size_hint_y: None
size: [root.width, root.height-root.ids.settings_top_bar.height]
do_scroll_x: False
do_scroll_y: True
MDBoxLayout: MDGridLayout:
orientation: "vertical" cols: 1
spacing: 0 padding: [dp(28), dp(28), dp(28), dp(28)]
size_hint_y: None size_hint_y: None
height: self.minimum_height height: self.minimum_height
padding: [0, 0, 0, 0]
MDLabel:
text: "User Options"
font_style: "H6"
size_hint_y: None
height: self.texture_size[1]
MDLabel:
id: settings_info0
markup: True
text: "\\nTest - Remove"
size_hint_y: None
height: self.texture_size[1]
MDBoxLayout: MDBoxLayout:
orientation: "vertical" orientation: "horizontal"
spacing: "16dp"
size_hint_y: None size_hint_y: None
height: self.minimum_height padding: [0,0,dp(24),dp(0)]
padding: [dp(28), dp(16), dp(28), dp(16)] height: dp(48)
MDLabel: MDLabel:
text: "" text: "Notifications"
font_style: "H6" font_style: "H6"
MDLabel: MDSwitch:
text: "User Options" id: settings_notifications_on
font_style: "H6" pos_hint: {"center_y": 0.3}
active: True
MDBoxLayout:
id: telemetry_information_fields
orientation: "horizontal"
size_hint_y: None
spacing: dp(16)
height: dp(64)
padding: [0, dp(0), 0, dp(0)]
MDTextField: MDTextField:
id: settings_display_name id: settings_display_name
@ -1144,270 +1168,274 @@ MDScreen:
max_text_length: 128 max_text_length: 128
font_size: dp(24) font_size: dp(24)
MDTextField: MDBoxLayout:
id: settings_propagation_node_address md_bg_color: [0.2, 0.2, 0.8, 0.8]
hint_text: "LXMF Propagation Node" size_hint_y: 1.0
disabled: False
text: ""
max_text_length: 32
font_size: dp(24)
MDTextField:
id: settings_print_command
hint_text: "Print Command"
disabled: False
text: ""
font_size: dp(24)
MDLabel: MDLabel:
text: "" id: filler
font_style: "H6" text: "Test"
MDLabel: MDTextField:
text: "Address & Identity" id: settings_propagation_node_address
font_style: "H6" hint_text: "LXMF Propagation Node"
text: ""
max_text_length: 32
font_size: dp(24)
height: dp(64)
MDTextField: MDTextField:
id: settings_lxmf_address id: settings_print_command
hint_text: "Your LXMF Address" hint_text: "Print Command"
text: "" text: ""
disabled: False font_size: dp(24)
max_text_length: 32 height: dp(64)
font_size: dp(24)
MDTextField: MDLabel:
id: settings_identity_hash text: "Address & Identity"
hint_text: "Your Identity Hash" font_style: "H6"
text: "" size_hint_y: None
disabled: False height: self.texture_size[1]
max_text_length: 32
font_size: dp(24)
MDLabel:
id: settings_info1
markup: True
text: "\\nYour address and identity hashes are derived from your primary identity keys, and are therefore not editable, but these fields can be used to view and copy the hashes. If you want a new LXMF address, create or import a new primary identity."
size_hint_y: None
height: self.texture_size[1]
MDTextField:
id: settings_lxmf_address
hint_text: "Your LXMF Address"
text: ""
max_text_length: 32
font_size: dp(24)
height: dp(64)
MDTextField:
id: settings_identity_hash
hint_text: "Your Identity Hash"
text: ""
max_text_length: 32
font_size: dp(24)
height: dp(64)
MDBoxLayout: MDBoxLayout:
orientation: "vertical" orientation: "horizontal"
# spacing: "24dp"
size_hint_y: None size_hint_y: None
height: self.minimum_height padding: [0,0,dp(24),dp(0)]
padding: [dp(28), dp(16), dp(28), dp(16)] height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Notifications"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Notifications" id: settings_notifications_on
font_style: "H6" pos_hint: {"center_y": 0.3}
active: True
MDSwitch: MDBoxLayout:
id: settings_notifications_on orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
active: True padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Dark Mode"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Dark Mode" id: settings_dark_ui
font_style: "H6" pos_hint: {"center_y": 0.3}
active: False
MDSwitch: MDBoxLayout:
id: settings_dark_ui orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
active: False padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "E-Ink Mode"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "E-Ink Mode" id: settings_eink_mode
font_style: "H6" pos_hint: {"center_y": 0.3}
active: False
MDSwitch: MDBoxLayout:
id: settings_eink_mode orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
active: False padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Display styles in conversation list"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Display styles in conversation list" id: display_style_in_contact_list
font_style: "H6" pos_hint: {"center_y": 0.3}
active: False
MDSwitch: MDBoxLayout:
id: display_style_in_contact_list orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
active: False padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Advanced Metrics"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Advanced Metrics" id: settings_advanced_statistics
font_style: "H6" pos_hint: {"center_y": 0.3}
active: False
MDSwitch: MDBoxLayout:
id: settings_advanced_statistics orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
active: False padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Announce Automatically"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Announce Automatically" id: settings_start_announce
font_style: "H6" pos_hint: {"center_y": 0.3}
active: False
MDSwitch: MDBoxLayout:
id: settings_start_announce orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
active: False padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Try Propagation Node on direct delivery failure"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Try Propagation Node on direct delivery failure" id: settings_lxmf_try_propagation_on_fail
font_style: "H6" pos_hint: {"center_y": 0.3}
disabled: False
active: False
MDSwitch: MDBoxLayout:
id: settings_lxmf_try_propagation_on_fail orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
disabled: False padding: [0,0,dp(24),dp(0)]
active: False height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Send via Propagation Node by default"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Send via Propagation Node by default" id: settings_lxmf_delivery_by_default
font_style: "H6" pos_hint: {"center_y": 0.3}
disabled: False
active: False
MDSwitch: MDBoxLayout:
id: settings_lxmf_delivery_by_default orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
disabled: False padding: [0,0,dp(24),dp(0)]
active: False height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Ignore unknown senders"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Ignore unknown senders" id: settings_lxmf_ignore_unknown
font_style: "H6" pos_hint: {"center_y": 0.3}
disabled: False
active: False
MDSwitch: MDBoxLayout:
id: settings_lxmf_ignore_unknown orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
disabled: False padding: [0,0,dp(24),dp(0)]
active: False height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Limit each sync to 3 messages"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Limit each sync to 3 messages" id: settings_lxmf_sync_limit
font_style: "H6" pos_hint: {"center_y": 0.3}
disabled: False
active: False
MDSwitch: MDBoxLayout:
id: settings_lxmf_sync_limit orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
disabled: False padding: [0,0,dp(24),dp(0)]
active: False height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" id: settings_lxmf_sync_periodic
size_hint_y: None text: "Sync with Propagation Node periodically"
padding: [0,0,dp(24),dp(0)] font_style: "H6"
height: dp(48)
MDLabel: MDSwitch:
id: settings_lxmf_sync_periodic id: settings_lxmf_periodic_sync
text: "Sync with Propagation Node periodically" pos_hint: {"center_y": 0.3}
font_style: "H6" disabled: False
active: False
MDSwitch: MDBoxLayout:
id: settings_lxmf_periodic_sync id: lxmf_syncslider_container
pos_hint: {"center_y": 0.3} orientation: "vertical"
disabled: False size_hint_y: None
active: False padding: [0,0,dp(0),0]
height: dp(68)
MDBoxLayout: MDSlider
id: lxmf_syncslider_container min: 1
orientation: "vertical" max: 214
size_hint_y: None value: 150
padding: [0,0,dp(0),0] id: settings_lxmf_sync_interval
height: dp(68) sensitivity: "all"
hint: False
MDSlider MDBoxLayout:
min: 1 orientation: "horizontal"
max: 214 size_hint_y: None
value: 150 padding: [0,0,dp(24),dp(0)]
id: settings_lxmf_sync_interval height: dp(48)
sensitivity: "all"
hint: False
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Use Home Node as Broadcast Repeater"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Use Home Node as Broadcast Repeater" id: settings_home_node_as_broadcast_repeater
font_style: "H6" pos_hint: {"center_y": 0.3}
active: False
disabled: True
MDSwitch: MDBoxLayout:
id: settings_home_node_as_broadcast_repeater orientation: "horizontal"
pos_hint: {"center_y": 0.3} size_hint_y: None
active: False padding: [0,0,dp(24),dp(0)]
disabled: True height: dp(48)
MDBoxLayout: MDLabel:
orientation: "horizontal" text: "Debug Logging"
size_hint_y: None font_style: "H6"
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel: MDSwitch:
text: "Debug Logging" id: settings_debug
font_style: "H6" pos_hint: {"center_y": 0.3}
disabled: False
MDSwitch: active: False
id: settings_debug
pos_hint: {"center_y": 0.3}
disabled: False
active: False
""" """
layout_repository_screen = """ layout_repository_screen = """