|
15 | 15 | get_camera_index_by_name,
|
16 | 16 | bg_color_highlight,
|
17 | 17 | bg_color_clear,
|
| 18 | + is_valid_int_input |
18 | 19 | )
|
19 | 20 | from lang_manager import LocaleStringManager as lang
|
20 | 21 |
|
@@ -324,11 +325,11 @@ def render(self, window, event, values):
|
324 | 325 | if any(x in str(value) for x in ports):
|
325 | 326 | self.config.capture_source = value
|
326 | 327 | 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 |
330 | 329 | 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) |
332 | 333 | else:
|
333 | 334 | self.config.capture_source = value
|
334 | 335 | except ValueError:
|
@@ -395,11 +396,11 @@ def render(self, window, event, values):
|
395 | 396 | if self.settings_config.use_calibration == True:
|
396 | 397 | window[self.gui_restart_calibration].update(disabled=False)
|
397 | 398 | 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")}') |
399 | 400 | else:
|
400 | 401 | window[self.gui_restart_calibration].update(disabled=True)
|
401 | 402 | window[self.gui_stop_calibration].update(disabled=True)
|
402 |
| - print(lang._instance.get_string("info.disabled")) |
| 403 | + print(f'[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.disabled")}') |
403 | 404 |
|
404 | 405 | if event == "{}+UP".format(self.gui_roi_selection):
|
405 | 406 | # Event for mouse button up in ROI mode
|
|
0 commit comments