Anchor-annotator 0.3.3__py3-none-any.whl → 0.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {Anchor_annotator-0.3.3.dist-info → Anchor_annotator-0.5.0.dist-info}/METADATA +1 -1
- Anchor_annotator-0.5.0.dist-info/RECORD +22 -0
- anchor/_version.py +2 -2
- anchor/main.py +178 -62
- anchor/models.py +88 -54
- anchor/plot.py +316 -115
- anchor/resources_rc.py +6475 -4801
- anchor/settings.py +195 -95
- anchor/ui_error_dialog.py +15 -16
- anchor/ui_main_window.py +40 -612
- anchor/ui_preferences.py +75 -44
- anchor/undo.py +15 -5
- anchor/widgets.py +98 -132
- anchor/workers.py +29 -1
- Anchor_annotator-0.3.3.dist-info/RECORD +0 -22
- {Anchor_annotator-0.3.3.dist-info → Anchor_annotator-0.5.0.dist-info}/LICENSE +0 -0
- {Anchor_annotator-0.3.3.dist-info → Anchor_annotator-0.5.0.dist-info}/WHEEL +0 -0
- {Anchor_annotator-0.3.3.dist-info → Anchor_annotator-0.5.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: Anchor_annotator
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.5.0
|
4
4
|
Summary: Anchor annotator is a program for inspecting corpora for the Montreal Forced Aligner and correcting transcriptions and pronunciations.
|
5
5
|
Home-page: https://github.com/MontrealCorpusTools/Anchor-annotator
|
6
6
|
Author: Montreal Corpus Tools
|
@@ -0,0 +1,22 @@
|
|
1
|
+
anchor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
anchor/__main__.py,sha256=5ufG8lcx2x1am-04xI991AG7saJd24dxPw5JzjmB878,45
|
3
|
+
anchor/_version.py,sha256=aeBju2l8GTMwAhIRG_c2Q_oVPFacRkZZwGtxmvFCGPQ,411
|
4
|
+
anchor/command_line.py,sha256=EucG805HyWk_zkMO9RXv9Yj0I0JVdDLZb1_DX2_ISjM,503
|
5
|
+
anchor/db.py,sha256=ef4lO6HtCKoxC9CorIc0ZbPxKpjHa576a0ZIBOWNU9E,4956
|
6
|
+
anchor/main.py,sha256=ZJKMVgh1yFnuqcoCSSDXFWqmw5hxLcoQbA0JaNSK61Y,126473
|
7
|
+
anchor/models.py,sha256=tYtj_doI9LokNOo624b1OmVLTFpIdKBVPfAzCO90ou4,96315
|
8
|
+
anchor/plot.py,sha256=yNveJ6O52621xC5ggUhFeeSxFp-HWD8D3XVnBWc6vtE,112516
|
9
|
+
anchor/resources_rc.py,sha256=ad0TsmUT4851Rh4oWpwefIJ9Ijqhg3gwX8cnaRX_90w,8460639
|
10
|
+
anchor/settings.py,sha256=jyqvKYo2ZMeZkU7D6qmLxkF8xvnJsYh7eyk5_kQMKxY,51884
|
11
|
+
anchor/ui_corpus_manager.py,sha256=e3ybOd4UdYarrLBATxI8vIFnioa4R_BHrbsEz5mJ5eA,8564
|
12
|
+
anchor/ui_error_dialog.py,sha256=HKbjGT_jtdb9jfn9THQMbl1fmcdWyjYDazM4hCwZ5Yo,3931
|
13
|
+
anchor/ui_main_window.py,sha256=q7dsxdvjhMy-W_7qEqV9EalWUZsca1OwfdrU0EVz8d0,36574
|
14
|
+
anchor/ui_preferences.py,sha256=g3tcjAMFKIAqUJNEke7ww4LkdeTFA1zb8_lrhF6k5fo,43271
|
15
|
+
anchor/undo.py,sha256=HUrTT8N-y1jFrSBX4wSNSGF3G0YiBeKUqKJQQg1qffI,32919
|
16
|
+
anchor/widgets.py,sha256=iadb6GgR2Q-1eTdle_IPaMyEnkOBXMqBvjC1U6pWtJo,156787
|
17
|
+
anchor/workers.py,sha256=rjUWKyRJ-NiZpGvgYgoNi5M9ESoMFXpd7zgnx-f0WBY,172378
|
18
|
+
Anchor_annotator-0.5.0.dist-info/LICENSE,sha256=C0oIsblENEgWQ7XMNdYoXyXsIA5wa3YF0I9lK3H7A1s,1076
|
19
|
+
Anchor_annotator-0.5.0.dist-info/METADATA,sha256=2ochFmVpqLnnTKHb15k3R4BRxNH2wrrwdZDO0NJFjUg,1500
|
20
|
+
Anchor_annotator-0.5.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
21
|
+
Anchor_annotator-0.5.0.dist-info/top_level.txt,sha256=wX6ZKxImGRZKFQjs3f6XYw_TfbAp6Xs3SmbLfLbFAJ0,7
|
22
|
+
Anchor_annotator-0.5.0.dist-info/RECORD,,
|
anchor/_version.py
CHANGED
anchor/main.py
CHANGED
@@ -103,6 +103,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
103
103
|
self.status_indicator.setFixedWidth(self.ui.statusbar.height())
|
104
104
|
self.ui.statusbar.addPermanentWidget(self.status_indicator, 0)
|
105
105
|
self.settings = AnchorSettings()
|
106
|
+
self.settings.themeUpdated.connect(self.refresh_style_sheets)
|
107
|
+
self.style_hints = QtGui.QGuiApplication.styleHints()
|
108
|
+
self.style_hints.colorSchemeChanged.connect(self.refresh_style_sheets)
|
106
109
|
self.model_manager = ModelManager(
|
107
110
|
token=self.settings.value(AnchorSettings.GITHUB_TOKEN), ignore_cache=True
|
108
111
|
)
|
@@ -540,14 +543,14 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
540
543
|
self.dictionary_model,
|
541
544
|
)
|
542
545
|
self.ui.speakerWidget.set_models(
|
543
|
-
self.corpus_model, self.
|
546
|
+
self.corpus_model, self.file_selection_model, self.speaker_model
|
544
547
|
)
|
545
548
|
self.ui.transcriptionWidget.set_models(self.corpus_model, self.dictionary_model)
|
546
549
|
self.ui.alignmentWidget.set_models(self.corpus_model)
|
547
550
|
self.ui.acousticModelWidget.set_models(self.corpus_model)
|
548
551
|
self.ui.languageModelWidget.set_models(self.corpus_model)
|
549
552
|
self.ui.dictionaryWidget.set_models(self.dictionary_model)
|
550
|
-
self.ui.diarizationWidget.set_models(self.diarization_model, self.
|
553
|
+
self.ui.diarizationWidget.set_models(self.diarization_model, self.file_selection_model)
|
551
554
|
self.ui.oovWidget.set_models(self.oov_model)
|
552
555
|
self.file_selection_model.currentUtteranceChanged.connect(self.change_utterance)
|
553
556
|
self.selection_model.fileViewRequested.connect(self.file_selection_model.set_current_file)
|
@@ -827,9 +830,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
827
830
|
self.ui.lockEditAct.toggled.connect(self.toggle_lock)
|
828
831
|
self.ui.exportFilesAct.setEnabled(True)
|
829
832
|
self.ui.exportFilesAct.triggered.connect(self.export_files)
|
830
|
-
self.ui.showAllSpeakersAct.triggered.connect(
|
831
|
-
self.ui.utteranceDetailWidget.plot_widget.update_show_speakers
|
832
|
-
)
|
833
833
|
self.ui.muteAct.triggered.connect(self.update_mute_status)
|
834
834
|
self.volume_slider = QtWidgets.QSlider(QtCore.Qt.Orientation.Horizontal, self)
|
835
835
|
self.volume_slider.setMaximum(100)
|
@@ -868,9 +868,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
868
868
|
self.ui.selectMappingFileAct.triggered.connect(self.change_custom_mapping)
|
869
869
|
|
870
870
|
self.undo_act = self.undo_group.createUndoAction(self, "Undo")
|
871
|
-
self.undo_act.setIcon(QtGui.QIcon("
|
871
|
+
self.undo_act.setIcon(QtGui.QIcon.fromTheme("edit-undo"))
|
872
872
|
self.redo_act = self.undo_group.createRedoAction(self, "Redo")
|
873
|
-
self.redo_act.setIcon(QtGui.QIcon("
|
873
|
+
self.redo_act.setIcon(QtGui.QIcon.fromTheme("edit-redo"))
|
874
874
|
self.ui.menuEdit.addAction(self.undo_act)
|
875
875
|
self.ui.menuEdit.addAction(self.redo_act)
|
876
876
|
self.undo_group.setActiveStack(self.corpus_undo_stack)
|
@@ -1385,6 +1385,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1385
1385
|
self.ui.languageModelMenu.setEnabled(True)
|
1386
1386
|
|
1387
1387
|
def finalize_load_g2p_model(self, generator: PyniniValidator):
|
1388
|
+
if generator is None:
|
1389
|
+
return
|
1388
1390
|
self.dictionary_model.set_g2p_generator(generator)
|
1389
1391
|
self.corpus_model.g2p_model = generator.g2p_model
|
1390
1392
|
self.check_actions()
|
@@ -1849,6 +1851,54 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1849
1851
|
|
1850
1852
|
def refresh_style_sheets(self):
|
1851
1853
|
self.setStyleSheet(self.settings.style_sheet)
|
1854
|
+
self.styleSheetChanged.emit(self.settings.style_sheet)
|
1855
|
+
self.ui.utteranceDetailWidget.plot_widget.refresh_theme()
|
1856
|
+
QtGui.QIcon.setThemeName("anchor_light")
|
1857
|
+
if self.settings.theme_preset == "Native":
|
1858
|
+
dark_mode = (
|
1859
|
+
QtGui.QGuiApplication.styleHints().colorScheme() == QtCore.Qt.ColorScheme.Dark
|
1860
|
+
)
|
1861
|
+
if dark_mode:
|
1862
|
+
QtGui.QIcon.setThemeName("anchor_dark")
|
1863
|
+
if False:
|
1864
|
+
self.ui.playAct.setIcon(
|
1865
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.MediaPlaybackStart)
|
1866
|
+
)
|
1867
|
+
self.ui.muteAct.setIcon(
|
1868
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.AudioVolumeMuted)
|
1869
|
+
)
|
1870
|
+
self.ui.zoomInAct.setIcon(QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.ZoomIn))
|
1871
|
+
self.ui.zoomOutAct.setIcon(QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.ZoomOut))
|
1872
|
+
self.ui.zoomToSelectionAct.setIcon(
|
1873
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.ZoomFitBest)
|
1874
|
+
)
|
1875
|
+
self.ui.mergeUtterancesAct.setIcon(
|
1876
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.InputGaming)
|
1877
|
+
)
|
1878
|
+
self.ui.splitUtterancesAct.setIcon(
|
1879
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.ViewFullscreen)
|
1880
|
+
)
|
1881
|
+
self.ui.deleteUtterancesAct.setIcon(
|
1882
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.EditDelete)
|
1883
|
+
)
|
1884
|
+
self.ui.exportFilesAct.setIcon(
|
1885
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.DocumentSave)
|
1886
|
+
)
|
1887
|
+
self.ui.lockEditAct.setIcon(
|
1888
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.SystemLockScreen)
|
1889
|
+
)
|
1890
|
+
self.ui.getHelpAct.setIcon(QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.HelpAbout))
|
1891
|
+
self.ui.reportBugAct.setIcon(
|
1892
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.MailForward)
|
1893
|
+
)
|
1894
|
+
self.ui.alignUtteranceAct.setIcon(
|
1895
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.FormatTextUnderline)
|
1896
|
+
)
|
1897
|
+
self.ui.cancelCorpusLoadAct.setIcon(
|
1898
|
+
QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.ProcessStop)
|
1899
|
+
)
|
1900
|
+
self.undo_act.setIcon(QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.EditUndo))
|
1901
|
+
self.redo_act.setIcon(QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.EditRedo))
|
1852
1902
|
|
1853
1903
|
def refresh_corpus_history(self):
|
1854
1904
|
self.ui.loadRecentCorpusMenu.clear()
|
@@ -1867,8 +1917,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1867
1917
|
self.ui.loadRecentCorpusMenu.addAction(a)
|
1868
1918
|
|
1869
1919
|
def refresh_settings(self):
|
1870
|
-
self.
|
1871
|
-
self.styleSheetChanged.emit(self.settings.style_sheet)
|
1920
|
+
self.refresh_style_sheets()
|
1872
1921
|
self.refresh_shortcuts()
|
1873
1922
|
self.corpus_model.set_limit(self.settings.value(self.settings.RESULTS_PER_PAGE))
|
1874
1923
|
self.dictionary_model.set_limit(self.settings.value(self.settings.RESULTS_PER_PAGE))
|
@@ -1878,6 +1927,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1878
1927
|
self.ui.dictionaryWidget.refresh_settings()
|
1879
1928
|
self.ui.speakerWidget.refresh_settings()
|
1880
1929
|
self.media_player.refresh_settings()
|
1930
|
+
self.ui.utteranceDetailWidget.plot_widget.refresh()
|
1881
1931
|
|
1882
1932
|
def download_language_model(self):
|
1883
1933
|
self.download_worker.set_params(
|
@@ -2283,6 +2333,10 @@ class DetailedMessageBox(QtWidgets.QDialog): # pragma: no cover
|
|
2283
2333
|
self.ui = Ui_ErrorDialog()
|
2284
2334
|
self.ui.setupUi(self)
|
2285
2335
|
self.settings = AnchorSettings()
|
2336
|
+
icon = QtGui.QIcon.fromTheme("emblem-important")
|
2337
|
+
size = self.ui.iconLabel.size()
|
2338
|
+
self.ui.iconLabel.setPixmap(icon.pixmap(size))
|
2339
|
+
self.setWindowIcon(icon)
|
2286
2340
|
self.ui.detailed_message.setText(detailed_message)
|
2287
2341
|
self.ui.buttonBox.report_bug_button.clicked.connect(self.reportBug.emit)
|
2288
2342
|
self.ui.buttonBox.rejected.connect(self.reject)
|
@@ -2298,6 +2352,14 @@ class ManagerDialog(QtWidgets.QDialog):
|
|
2298
2352
|
self.ui.setupUi(self)
|
2299
2353
|
self.ui.tabWidget.setCurrentIndex(0)
|
2300
2354
|
self.settings = AnchorSettings()
|
2355
|
+
QtGui.QIcon.setThemeName("anchor_light")
|
2356
|
+
if self.settings.theme_preset == "Native":
|
2357
|
+
dark_mode = (
|
2358
|
+
QtGui.QGuiApplication.styleHints().colorScheme() == QtCore.Qt.ColorScheme.Dark
|
2359
|
+
)
|
2360
|
+
if dark_mode:
|
2361
|
+
QtGui.QIcon.setThemeName("anchor_dark")
|
2362
|
+
|
2301
2363
|
self.model_manager = model_manager
|
2302
2364
|
|
2303
2365
|
self.db_engine = db_engine
|
@@ -2379,33 +2441,10 @@ class OptionsDialog(QtWidgets.QDialog):
|
|
2379
2441
|
self.ui.setupUi(self)
|
2380
2442
|
self.settings = AnchorSettings()
|
2381
2443
|
|
2382
|
-
self.
|
2383
|
-
|
2384
|
-
self.ui.primaryBaseEdit.set_color(self.settings.value(self.settings.PRIMARY_BASE_COLOR))
|
2385
|
-
self.ui.primaryLightEdit.set_color(self.settings.value(self.settings.PRIMARY_LIGHT_COLOR))
|
2386
|
-
self.ui.primaryDarkEdit.set_color(self.settings.value(self.settings.PRIMARY_DARK_COLOR))
|
2387
|
-
self.ui.primaryVeryLightEdit.set_color(
|
2388
|
-
self.settings.value(self.settings.PRIMARY_VERY_LIGHT_COLOR)
|
2389
|
-
)
|
2390
|
-
self.ui.primaryVeryDarkEdit.set_color(
|
2391
|
-
self.settings.value(self.settings.PRIMARY_VERY_DARK_COLOR)
|
2392
|
-
)
|
2444
|
+
self.initial_theme = self.settings.current_theme
|
2393
2445
|
|
2394
|
-
self.
|
2395
|
-
self.ui.
|
2396
|
-
self.ui.accentDarkEdit.set_color(self.settings.value(self.settings.ACCENT_DARK_COLOR))
|
2397
|
-
self.ui.accentVeryLightEdit.set_color(
|
2398
|
-
self.settings.value(self.settings.ACCENT_VERY_LIGHT_COLOR)
|
2399
|
-
)
|
2400
|
-
self.ui.accentVeryDarkEdit.set_color(
|
2401
|
-
self.settings.value(self.settings.ACCENT_VERY_DARK_COLOR)
|
2402
|
-
)
|
2403
|
-
|
2404
|
-
self.ui.mainTextColorEdit.set_color(self.settings.value(self.settings.MAIN_TEXT_COLOR))
|
2405
|
-
self.ui.selectedTextColorEdit.set_color(
|
2406
|
-
self.settings.value(self.settings.SELECTED_TEXT_COLOR)
|
2407
|
-
)
|
2408
|
-
self.ui.errorColorEdit.set_color(self.settings.value(self.settings.ERROR_COLOR))
|
2446
|
+
self.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus)
|
2447
|
+
self.ui.errorColorEdit.colorChanged.connect(self.update_theme)
|
2409
2448
|
|
2410
2449
|
self.ui.fontEdit.set_font(self.settings.font)
|
2411
2450
|
|
@@ -2454,6 +2493,11 @@ class OptionsDialog(QtWidgets.QDialog):
|
|
2454
2493
|
self.settings.value(self.settings.TIME_DIRECTION)
|
2455
2494
|
)
|
2456
2495
|
)
|
2496
|
+
self.ui.visibleSpeakerComboBox.setCurrentIndex(
|
2497
|
+
self.ui.visibleSpeakerComboBox.findText(
|
2498
|
+
str(self.settings.value(self.settings.TIER_MAX_SPEAKERS))
|
2499
|
+
)
|
2500
|
+
)
|
2457
2501
|
|
2458
2502
|
self.ui.dynamicRangeEdit.setValue(self.settings.value(self.settings.SPEC_DYNAMIC_RANGE))
|
2459
2503
|
self.ui.specMaxTimeEdit.setText(str(self.settings.value(self.settings.SPEC_MAX_TIME)))
|
@@ -2470,6 +2514,11 @@ class OptionsDialog(QtWidgets.QDialog):
|
|
2470
2514
|
self.ui.frameLengthEdit.setValue(self.settings.value(self.settings.PITCH_FRAME_LENGTH))
|
2471
2515
|
self.ui.penaltyEdit.setText(str(self.settings.value(self.settings.PITCH_PENALTY_FACTOR)))
|
2472
2516
|
self.ui.pitchDeltaEdit.setText(str(self.settings.value(self.settings.PITCH_DELTA_PITCH)))
|
2517
|
+
self.ui.presetThemeEdit.setCurrentIndex(
|
2518
|
+
self.ui.presetThemeEdit.findText(str(self.settings.value(self.settings.THEME_PRESET)))
|
2519
|
+
)
|
2520
|
+
self.ui.presetThemeEdit.currentIndexChanged.connect(self.update_preset_theme)
|
2521
|
+
self.ui.presetThemeEdit.currentIndexChanged.connect(self.update_theme)
|
2473
2522
|
|
2474
2523
|
self.ui.audioDeviceEdit.clear()
|
2475
2524
|
for o in QtMultimedia.QMediaDevices.audioOutputs():
|
@@ -2484,6 +2533,82 @@ class OptionsDialog(QtWidgets.QDialog):
|
|
2484
2533
|
# self.setFont(self.settings.font)
|
2485
2534
|
# self.setStyleSheet(self.settings.style_sheet)
|
2486
2535
|
|
2536
|
+
def set_theme(self, theme):
|
2537
|
+
self.ui.primaryBaseEdit.set_color(theme[self.settings.PRIMARY_BASE_COLOR])
|
2538
|
+
self.ui.primaryLightEdit.set_color(theme[self.settings.PRIMARY_LIGHT_COLOR])
|
2539
|
+
self.ui.primaryDarkEdit.set_color(theme[self.settings.PRIMARY_DARK_COLOR])
|
2540
|
+
self.ui.primaryVeryLightEdit.set_color(theme[self.settings.PRIMARY_VERY_LIGHT_COLOR])
|
2541
|
+
self.ui.primaryVeryDarkEdit.set_color(theme[self.settings.PRIMARY_VERY_DARK_COLOR])
|
2542
|
+
|
2543
|
+
self.ui.accentBaseEdit.set_color(theme[self.settings.ACCENT_BASE_COLOR])
|
2544
|
+
self.ui.accentLightEdit.set_color(theme[self.settings.ACCENT_LIGHT_COLOR])
|
2545
|
+
self.ui.accentDarkEdit.set_color(theme[self.settings.ACCENT_DARK_COLOR])
|
2546
|
+
self.ui.accentVeryLightEdit.set_color(theme[self.settings.ACCENT_VERY_LIGHT_COLOR])
|
2547
|
+
self.ui.accentVeryDarkEdit.set_color(theme[self.settings.ACCENT_VERY_DARK_COLOR])
|
2548
|
+
|
2549
|
+
self.ui.mainTextColorEdit.set_color(theme[self.settings.MAIN_TEXT_COLOR])
|
2550
|
+
self.ui.selectedTextColorEdit.set_color(theme[self.settings.SELECTED_TEXT_COLOR])
|
2551
|
+
self.ui.errorColorEdit.set_color(theme[self.settings.ERROR_COLOR])
|
2552
|
+
|
2553
|
+
def update_preset_theme(self):
|
2554
|
+
theme = self.ui.presetThemeEdit.currentText()
|
2555
|
+
self.ui.primaryBaseEdit.setEnabled(False)
|
2556
|
+
self.ui.primaryLightEdit.setEnabled(False)
|
2557
|
+
self.ui.primaryDarkEdit.setEnabled(False)
|
2558
|
+
self.ui.primaryVeryLightEdit.setEnabled(False)
|
2559
|
+
self.ui.primaryVeryDarkEdit.setEnabled(False)
|
2560
|
+
self.ui.accentBaseEdit.setEnabled(False)
|
2561
|
+
self.ui.accentLightEdit.setEnabled(False)
|
2562
|
+
self.ui.accentDarkEdit.setEnabled(False)
|
2563
|
+
self.ui.accentVeryLightEdit.setEnabled(False)
|
2564
|
+
self.ui.accentVeryDarkEdit.setEnabled(False)
|
2565
|
+
self.ui.mainTextColorEdit.setEnabled(False)
|
2566
|
+
self.ui.selectedTextColorEdit.setEnabled(False)
|
2567
|
+
self.ui.errorColorEdit.setEnabled(False)
|
2568
|
+
if theme == "MFA":
|
2569
|
+
self.set_theme(self.settings.mfa_theme)
|
2570
|
+
self.settings.set_mfa_theme()
|
2571
|
+
elif theme != "Native":
|
2572
|
+
self.ui.primaryBaseEdit.setEnabled(True)
|
2573
|
+
self.ui.primaryLightEdit.setEnabled(True)
|
2574
|
+
self.ui.primaryDarkEdit.setEnabled(True)
|
2575
|
+
self.ui.primaryVeryLightEdit.setEnabled(True)
|
2576
|
+
self.ui.primaryVeryDarkEdit.setEnabled(True)
|
2577
|
+
self.ui.accentBaseEdit.setEnabled(True)
|
2578
|
+
self.ui.accentLightEdit.setEnabled(True)
|
2579
|
+
self.ui.accentDarkEdit.setEnabled(True)
|
2580
|
+
self.ui.accentVeryLightEdit.setEnabled(True)
|
2581
|
+
self.ui.accentVeryDarkEdit.setEnabled(True)
|
2582
|
+
self.ui.mainTextColorEdit.setEnabled(True)
|
2583
|
+
self.ui.selectedTextColorEdit.setEnabled(True)
|
2584
|
+
self.ui.errorColorEdit.setEnabled(True)
|
2585
|
+
|
2586
|
+
def update_theme(self):
|
2587
|
+
preset_theme = self.ui.presetThemeEdit.currentText()
|
2588
|
+
self.settings.setValue(self.settings.THEME_PRESET, preset_theme)
|
2589
|
+
if preset_theme != "Native":
|
2590
|
+
self.settings.set_theme(self.current_theme)
|
2591
|
+
else:
|
2592
|
+
self.settings.themeUpdated.emit()
|
2593
|
+
|
2594
|
+
@property
|
2595
|
+
def current_theme(self):
|
2596
|
+
return {
|
2597
|
+
AnchorSettings.MAIN_TEXT_COLOR: self.ui.mainTextColorEdit.color,
|
2598
|
+
AnchorSettings.SELECTED_TEXT_COLOR: self.ui.selectedTextColorEdit.color,
|
2599
|
+
AnchorSettings.ERROR_COLOR: self.ui.errorColorEdit.color,
|
2600
|
+
AnchorSettings.PRIMARY_BASE_COLOR: self.ui.primaryBaseEdit.color,
|
2601
|
+
AnchorSettings.PRIMARY_LIGHT_COLOR: self.ui.primaryLightEdit.color,
|
2602
|
+
AnchorSettings.PRIMARY_DARK_COLOR: self.ui.primaryDarkEdit.color,
|
2603
|
+
AnchorSettings.PRIMARY_VERY_LIGHT_COLOR: self.ui.primaryVeryLightEdit.color,
|
2604
|
+
AnchorSettings.PRIMARY_VERY_DARK_COLOR: self.ui.primaryVeryDarkEdit.color,
|
2605
|
+
AnchorSettings.ACCENT_BASE_COLOR: self.ui.accentBaseEdit.color,
|
2606
|
+
AnchorSettings.ACCENT_LIGHT_COLOR: self.ui.accentLightEdit.color,
|
2607
|
+
AnchorSettings.ACCENT_DARK_COLOR: self.ui.accentDarkEdit.color,
|
2608
|
+
AnchorSettings.ACCENT_VERY_LIGHT_COLOR: self.ui.accentVeryLightEdit.color,
|
2609
|
+
AnchorSettings.ACCENT_VERY_DARK_COLOR: self.ui.accentVeryDarkEdit.color,
|
2610
|
+
}
|
2611
|
+
|
2487
2612
|
def accept(self) -> None:
|
2488
2613
|
config.NUM_JOBS = self.ui.numJobsEdit.value()
|
2489
2614
|
config.USE_MP = self.ui.useMpCheckBox.isChecked()
|
@@ -2522,32 +2647,8 @@ class OptionsDialog(QtWidgets.QDialog):
|
|
2522
2647
|
self.settings.setValue(
|
2523
2648
|
self.settings.PITCH_DELTA_PITCH, float(self.ui.pitchDeltaEdit.text())
|
2524
2649
|
)
|
2525
|
-
|
2526
|
-
self.settings.setValue(self.settings.
|
2527
|
-
self.settings.setValue(self.settings.PRIMARY_LIGHT_COLOR, self.ui.primaryLightEdit.color)
|
2528
|
-
self.settings.setValue(self.settings.PRIMARY_DARK_COLOR, self.ui.primaryDarkEdit.color)
|
2529
|
-
self.settings.setValue(
|
2530
|
-
self.settings.PRIMARY_VERY_LIGHT_COLOR, self.ui.primaryVeryLightEdit.color
|
2531
|
-
)
|
2532
|
-
self.settings.setValue(
|
2533
|
-
self.settings.PRIMARY_VERY_DARK_COLOR, self.ui.primaryVeryDarkEdit.color
|
2534
|
-
)
|
2535
|
-
|
2536
|
-
self.settings.setValue(self.settings.ACCENT_BASE_COLOR, self.ui.accentBaseEdit.color)
|
2537
|
-
self.settings.setValue(self.settings.ACCENT_LIGHT_COLOR, self.ui.accentLightEdit.color)
|
2538
|
-
self.settings.setValue(self.settings.ACCENT_DARK_COLOR, self.ui.accentDarkEdit.color)
|
2539
|
-
self.settings.setValue(
|
2540
|
-
self.settings.ACCENT_VERY_LIGHT_COLOR, self.ui.accentVeryLightEdit.color
|
2541
|
-
)
|
2542
|
-
self.settings.setValue(
|
2543
|
-
self.settings.ACCENT_VERY_DARK_COLOR, self.ui.accentVeryDarkEdit.color
|
2544
|
-
)
|
2545
|
-
|
2546
|
-
self.settings.setValue(self.settings.MAIN_TEXT_COLOR, self.ui.mainTextColorEdit.color)
|
2547
|
-
self.settings.setValue(
|
2548
|
-
self.settings.SELECTED_TEXT_COLOR, self.ui.selectedTextColorEdit.color
|
2549
|
-
)
|
2550
|
-
self.settings.setValue(self.settings.ERROR_COLOR, self.ui.errorColorEdit.color)
|
2650
|
+
preset_theme = self.ui.presetThemeEdit.currentText()
|
2651
|
+
self.settings.setValue(self.settings.THEME_PRESET, preset_theme)
|
2551
2652
|
|
2552
2653
|
self.settings.setValue(self.settings.FONT, self.ui.fontEdit.font.toString())
|
2553
2654
|
|
@@ -2603,11 +2704,26 @@ class OptionsDialog(QtWidgets.QDialog):
|
|
2603
2704
|
self.settings.setValue(
|
2604
2705
|
self.settings.TIME_DIRECTION, self.ui.timeDirectionComboBox.currentText()
|
2605
2706
|
)
|
2707
|
+
self.settings.setValue(
|
2708
|
+
self.settings.TIER_MAX_SPEAKERS, int(self.ui.visibleSpeakerComboBox.currentText())
|
2709
|
+
)
|
2606
2710
|
self.settings.sync()
|
2607
|
-
|
2711
|
+
if preset_theme != "Native":
|
2712
|
+
self.settings.set_theme(self.current_theme)
|
2713
|
+
else:
|
2714
|
+
self.settings.themeUpdated.emit()
|
2715
|
+
super().accept()
|
2716
|
+
|
2717
|
+
def reject(self):
|
2718
|
+
self.settings.set_theme(self.initial_theme)
|
2719
|
+
self.settings.sync()
|
2720
|
+
super().reject()
|
2608
2721
|
|
2609
2722
|
|
2610
2723
|
class Application(QtWidgets.QApplication):
|
2724
|
+
def __init__(self, *args, **kwargs):
|
2725
|
+
super().__init__(*args, **kwargs)
|
2726
|
+
|
2611
2727
|
def setActiveWindow(self, act):
|
2612
2728
|
super().setActiveWindow(act)
|
2613
2729
|
act.styleSheetChanged.connect(self.setStyleSheet)
|