Skip to content

Commit 75e522c

Browse files
committed
fix: reformat networkng page and add option to opt out of error reporting
1 parent 9fc4153 commit 75e522c

File tree

5 files changed

+27
-25
lines changed

5 files changed

+27
-25
lines changed

rcp/app.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
from typing import List
33

4+
45
from kivy.app import App
56
from kivy.clock import Clock
67
from kivy.uix.screenmanager import ScreenManager, CardTransition, FadeTransition
@@ -21,6 +22,9 @@
2122
from rcp.main import log
2223
from rcp.utils import communication, devices
2324

25+
import sentry_sdk
26+
27+
2428
class MainApp(App):
2529
display_color = ConfigParserProperty(
2630
defaultvalue="#ffffffff",
@@ -164,6 +168,14 @@ def goto(self, screen: str):
164168

165169
def build(self):
166170
self.formats = FormatsDispatcher(id_override="0")
171+
172+
if not self.formats.disable_error_reporting:
173+
log.info("Error reporting is enabled, configuring Sentry")
174+
sentry_sdk.init(
175+
dsn="https://8fd20c0607e9c930a16d51a4b1eacc94@o4509625403506688.ingest.us.sentry.io/4509625405014016",
176+
send_default_pii=False,
177+
)
178+
167179
self.servo = ServoBar(
168180
id_override="0",
169181
)

rcp/components/setup/network_screen.kv

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,35 @@
2525

2626
TitleItem:
2727
name: "Network Interface"
28-
28+
BooleanItem:
29+
name: "Enable Wifi"
30+
value: root.wifi_enabled
31+
on_value: root.wifi_enabled = self.value
2932
DropDownItem:
3033
name: "Network Interface"
3134
options: root.devices
3235
value: root.devices[0] if len(root.devices) > 0 else ""
33-
3436
StringItem:
3537
name: "Hardware Address"
3638
disabled: True
3739
value: root.hwaddr
38-
39-
BooleanItem:
40-
name: "Enable Interface"
41-
value: root.wifi_enabled
42-
on_value: root.wifi_enabled = self.value
43-
4440
StringItem:
4541
name: "State"
4642
disabled: True
4743
value: root.state
4844

4945
TitleItem:
5046
name: "Connection Properties"
51-
5247
ButtonItem:
5348
name: "Network"
5449
value: root.connection if root.connection is not None else ""
5550
disabled: root.lock
5651
on_release: Factory.SsidPopup(callback=root.select_network, selected_network=root.connection).open()
57-
5852
StringItem:
5953
name: "Wifi Password"
6054
value: root.password
6155
disabled: root.lock
6256
on_value: root.password = self.value
63-
6457
ButtonItem:
6558
name: "Apply configuration"
6659
value: "Apply"
@@ -69,25 +62,29 @@
6962

7063
TitleItem:
7164
name: "IP Properties"
72-
7365
StringItem:
7466
name: "IP Address"
7567
value: root.address
7668
disabled: True
7769
on_value: root.address = self.value
78-
7970
StringItem:
8071
name: "DNS Server"
8172
value: root.dns
8273
disabled: True
8374
on_value: root.dns = self.value
84-
8575
StringItem:
8676
name: "Default Gateway"
8777
value: root.gateway
8878
disabled: True
8979
on_value: root.gateway = self.value
9080

81+
TitleItem:
82+
name: "Error Reporting"
83+
BooleanItem:
84+
name: "Disable Error Reporting"
85+
value: app.formats.disable_error_reporting
86+
on_value: app.formats.disable_error_reporting = self.value
87+
9188
TitleItem:
9289
name: "Status"
9390
TextInput:
@@ -96,4 +93,3 @@
9693
readonly: True
9794
multiline: True
9895
text: root.status_text
99-

rcp/dispatchers/formats.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from kivy.logger import Logger
44
from kivy.properties import (
55
NumericProperty,
6-
StringProperty, ListProperty, ObjectProperty, ColorProperty,
6+
StringProperty, ListProperty, ObjectProperty, ColorProperty, BooleanProperty,
77
)
88

99
from rcp.dispatchers import SavingDispatcher
@@ -44,6 +44,8 @@ class FormatsDispatcher(SavingDispatcher):
4444

4545
volume = NumericProperty(0.2)
4646

47+
disable_error_reporting = BooleanProperty(False)
48+
4749
def __init__(self, **kv):
4850
super().__init__(**kv)
4951
self.bind(current_format=self.update_format)

rcp/main.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
from kivy.core.window import Window
55
import platform
66
import asyncio
7-
import sentry_sdk
8-
9-
sentry_sdk.init(
10-
dsn="https://8fd20c0607e9c930a16d51a4b1eacc94@o4509625403506688.ingest.us.sentry.io/4509625405014016",
11-
# Add data like request headers and IP for users,
12-
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
13-
send_default_pii=True,
14-
)
157

168
log = Logger.getChild(__name__)
179

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)