Skip to content

Commit c61c316

Browse files
authored
Merge pull request #58 from RamesTheGeneric/main
Fix missing locale entries
2 parents 4cec4ff + 4c13436 commit c61c316

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

BabbleApp/Locale/English/locale.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"info.enterCaptureTwo": "not found, retrying...",
5656
"info.exitCaptureThread": "Exiting capture thread",
5757
"info.exitTrackingThread": "Exiting tracking thread",
58+
"info.serialCapture": "Failed to get serial picture",
5859
"log.info": "INFO",
5960
"log.warn": "WARN",
6061
"log.error": "ERROR",

BabbleApp/Locale/OwO/locale.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"info.enterCaptureTwo": "not found, retrying...",
5656
"info.exitCaptureThread": "Exiting capture thread",
5757
"info.exitTrackingThread": "Exiting tracking thread",
58+
"info.serialCapture": "Fawled to gwet seiewal pictower 3:",
5859
"log.info": "INFO",
5960
"log.warn": "WARN",
6061
"log.error": "ERROR",

BabbleApp/Locale/Pirate Speak/locale.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"info.enterCaptureTwo": "not found, retrying...",
5656
"info.exitCaptureThread": "Exiting capture thread",
5757
"info.exitTrackingThread": "Exiting tracking thread",
58+
"info.serialCapture": "Failed to get serial piccure, matey!",
5859
"log.info": "INFO",
5960
"log.warn": "WARN",
6061
"log.error": "ERROR",

BabbleApp/camera.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def __init__(
4343
camera_output_outgoing: "queue.Queue(maxsize=2)",
4444
settings: BabbleSettingsConfig,
4545
):
46-
self.current_capture_sourc = None
4746
self.camera_status = CameraState.CONNECTING
4847
self.config = config
4948
self.settings = settings

BabbleApp/camera_widget.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
get_camera_index_by_name,
1616
bg_color_highlight,
1717
bg_color_clear,
18+
is_valid_int_input
1819
)
1920
from lang_manager import LocaleStringManager as lang
2021

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

6869
self.babble_cnn = BabbleProcessor(
6970
self.config,
@@ -134,14 +135,14 @@ def __init__(self, widget_id: Tab, main_config: BabbleConfig, osc_queue: Queue):
134135
key=self.gui_restart_calibration,
135136
button_color=button_color,
136137
tooltip=lang._instance.get_string("camera.startCalibrationTooltip"),
137-
disabled=True,
138+
disabled=not self.settings_config.use_calibration,
138139
),
139140
sg.Button(
140141
lang._instance.get_string("camera.stopCalibration"),
141142
key=self.gui_stop_calibration,
142143
button_color=button_color,
143144
tooltip=lang._instance.get_string("camera.startCalibrationTooltip"),
144-
disabled=True,
145+
disabled=not self.settings_config.use_calibration,
145146
),
146147
],
147148
[
@@ -324,11 +325,11 @@ def render(self, window, event, values):
324325
if any(x in str(value) for x in ports):
325326
self.config.capture_source = value
326327
else:
327-
cam = get_camera_index_by_name(
328-
value
329-
) # Set capture_source to the UVC index. Otherwise treat value like an ipcam if we return none
328+
cam = get_camera_index_by_name(value) # Set capture_source to the UVC index. Otherwise treat value like an ipcam if we return none
330329
if cam != None:
331-
self.config.capture_source = get_camera_index_by_name(value)
330+
self.config.capture_source = cam
331+
elif is_valid_int_input(value):
332+
self.config.capture_source = int(value)
332333
else:
333334
self.config.capture_source = value
334335
except ValueError:
@@ -395,11 +396,11 @@ def render(self, window, event, values):
395396
if self.settings_config.use_calibration == True:
396397
window[self.gui_restart_calibration].update(disabled=False)
397398
window[self.gui_stop_calibration].update(disabled=False)
398-
print({lang._instance.get_string("info.enabled")})
399+
print(f'[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.enabled")}')
399400
else:
400401
window[self.gui_restart_calibration].update(disabled=True)
401402
window[self.gui_stop_calibration].update(disabled=True)
402-
print(lang._instance.get_string("algoritm.disabled"))
403+
print(f'[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.disabled")}')
403404

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

0 commit comments

Comments
 (0)