Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing locale entries #58

Merged
merged 5 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BabbleApp/Locale/English/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"info.enterCaptureTwo": "not found, retrying...",
"info.exitCaptureThread": "Exiting capture thread",
"info.exitTrackingThread": "Exiting tracking thread",
"info.serialCapture": "Failed to get serial picture",
"log.info": "INFO",
"log.warn": "WARN",
"log.error": "ERROR",
Expand Down
1 change: 1 addition & 0 deletions BabbleApp/Locale/OwO/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"info.enterCaptureTwo": "not found, retrying...",
"info.exitCaptureThread": "Exiting capture thread",
"info.exitTrackingThread": "Exiting tracking thread",
"info.serialCapture": "Fawled to gwet seiewal pictower 3:",
"log.info": "INFO",
"log.warn": "WARN",
"log.error": "ERROR",
Expand Down
1 change: 1 addition & 0 deletions BabbleApp/Locale/Pirate Speak/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"info.enterCaptureTwo": "not found, retrying...",
"info.exitCaptureThread": "Exiting capture thread",
"info.exitTrackingThread": "Exiting tracking thread",
"info.serialCapture": "Failed to get serial piccure, matey!",
"log.info": "INFO",
"log.warn": "WARN",
"log.error": "ERROR",
Expand Down
1 change: 0 additions & 1 deletion BabbleApp/camera.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more sourc ;(

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def __init__(
camera_output_outgoing: "queue.Queue(maxsize=2)",
settings: BabbleSettingsConfig,
):
self.current_capture_sourc = None
self.camera_status = CameraState.CONNECTING
self.config = config
self.settings = settings
Expand Down
19 changes: 10 additions & 9 deletions BabbleApp/camera_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
get_camera_index_by_name,
bg_color_highlight,
bg_color_clear,
is_valid_int_input
)
from lang_manager import LocaleStringManager as lang

Expand Down Expand Up @@ -63,7 +64,7 @@ def __init__(self, widget_id: Tab, main_config: BabbleConfig, osc_queue: Queue):
self.capture_event = Event()
self.capture_queue = Queue(maxsize=2)
self.roi_queue = Queue(maxsize=2)
self.image_queue = Queue(maxsize=4)
self.image_queue = Queue(maxsize=500) # This is needed to prevent the UI from freezing during widget changes.

self.babble_cnn = BabbleProcessor(
self.config,
Expand Down Expand Up @@ -134,14 +135,14 @@ def __init__(self, widget_id: Tab, main_config: BabbleConfig, osc_queue: Queue):
key=self.gui_restart_calibration,
button_color=button_color,
tooltip=lang._instance.get_string("camera.startCalibrationTooltip"),
disabled=True,
disabled=not self.settings_config.use_calibration,
),
sg.Button(
lang._instance.get_string("camera.stopCalibration"),
key=self.gui_stop_calibration,
button_color=button_color,
tooltip=lang._instance.get_string("camera.startCalibrationTooltip"),
disabled=True,
disabled=not self.settings_config.use_calibration,
),
],
[
Expand Down Expand Up @@ -324,11 +325,11 @@ def render(self, window, event, values):
if any(x in str(value) for x in ports):
self.config.capture_source = value
else:
cam = get_camera_index_by_name(
value
) # Set capture_source to the UVC index. Otherwise treat value like an ipcam if we return none
cam = get_camera_index_by_name(value) # Set capture_source to the UVC index. Otherwise treat value like an ipcam if we return none
if cam != None:
self.config.capture_source = get_camera_index_by_name(value)
self.config.capture_source = cam
elif is_valid_int_input(value):
self.config.capture_source = int(value)
else:
self.config.capture_source = value
except ValueError:
Expand Down Expand Up @@ -395,11 +396,11 @@ def render(self, window, event, values):
if self.settings_config.use_calibration == True:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current state of the app, the "Start Calibration" and "Stop Calibration" buttons are disabled even if the app starts with the "Enable Calibration" checkbox set to true

window[self.gui_restart_calibration].update(disabled=False)
window[self.gui_stop_calibration].update(disabled=False)
print({lang._instance.get_string("info.enabled")})
print(f'[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.enabled")}')
else:
window[self.gui_restart_calibration].update(disabled=True)
window[self.gui_stop_calibration].update(disabled=True)
print(lang._instance.get_string("algoritm.disabled"))
print(f'[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.disabled")}')

if event == "{}+UP".format(self.gui_roi_selection):
# Event for mouse button up in ROI mode
Expand Down
Loading