mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 05:40:26 +02:00
Improvements in code
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
- Added loading gif animation to book handler window.
|
- Added loading gif animation to book handler window.
|
||||||
- Fixed light theme slider colors in voice mixer for better visibility (for non-Windows users).
|
- Fixed light theme slider colors in voice mixer for better visibility (for non-Windows users).
|
||||||
- Fixed subtitle word-count splitting logic for more accurate segmentation.
|
- Fixed subtitle word-count splitting logic for more accurate segmentation.
|
||||||
|
- Improvements in code and documentation.
|
||||||
|
|
||||||
# 1.2.0
|
# 1.2.0
|
||||||
- Added `Line` option to subtitle generation modes, allowing subtitles to be generated based on line breaks in the text, by @mleg in #94.
|
- Added `Line` option to subtitle generation modes, allowing subtitles to be generated based on line breaks in the text, by @mleg in #94.
|
||||||
|
|||||||
@@ -852,6 +852,7 @@ class abogen(QWidget):
|
|||||||
# Enable/disable subtitle options based on selected language (profile or voice)
|
# Enable/disable subtitle options based on selected language (profile or voice)
|
||||||
enable = self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION
|
enable = self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION
|
||||||
self.subtitle_combo.setEnabled(enable)
|
self.subtitle_combo.setEnabled(enable)
|
||||||
|
self.subtitle_format_combo.setEnabled(enable)
|
||||||
# loading gif for preview button
|
# loading gif for preview button
|
||||||
loading_gif_path = get_resource_path("abogen.assets", "loading.gif")
|
loading_gif_path = get_resource_path("abogen.assets", "loading.gif")
|
||||||
if loading_gif_path:
|
if loading_gif_path:
|
||||||
@@ -1115,6 +1116,10 @@ class abogen(QWidget):
|
|||||||
except Exception:
|
except Exception:
|
||||||
# Fail-safe: don't crash UI if model manipulation isn't supported on some platforms
|
# Fail-safe: don't crash UI if model manipulation isn't supported on some platforms
|
||||||
pass
|
pass
|
||||||
|
# Enable/disable subtitle format based on selected language
|
||||||
|
self.subtitle_format_combo.setEnabled(
|
||||||
|
self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION
|
||||||
|
)
|
||||||
controls_layout.addLayout(subtitle_format_layout)
|
controls_layout.addLayout(subtitle_format_layout)
|
||||||
|
|
||||||
# Replace single newlines dropdown (acts like checkbox)
|
# Replace single newlines dropdown (acts like checkbox)
|
||||||
@@ -1555,9 +1560,11 @@ class abogen(QWidget):
|
|||||||
# Enable/disable subtitle options based on language
|
# Enable/disable subtitle options based on language
|
||||||
if self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION:
|
if self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION:
|
||||||
self.subtitle_combo.setEnabled(True)
|
self.subtitle_combo.setEnabled(True)
|
||||||
|
self.subtitle_format_combo.setEnabled(True)
|
||||||
self.subtitle_mode = self.subtitle_combo.currentText()
|
self.subtitle_mode = self.subtitle_combo.currentText()
|
||||||
else:
|
else:
|
||||||
self.subtitle_combo.setEnabled(False)
|
self.subtitle_combo.setEnabled(False)
|
||||||
|
self.subtitle_format_combo.setEnabled(False)
|
||||||
|
|
||||||
def on_voice_combo_changed(self, index):
|
def on_voice_combo_changed(self, index):
|
||||||
data = self.voice_combo.itemData(index)
|
data = self.voice_combo.itemData(index)
|
||||||
@@ -1582,6 +1589,9 @@ class abogen(QWidget):
|
|||||||
self.subtitle_combo.setEnabled(
|
self.subtitle_combo.setEnabled(
|
||||||
self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION
|
self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION
|
||||||
)
|
)
|
||||||
|
self.subtitle_format_combo.setEnabled(
|
||||||
|
self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
self.mixed_voice_state = None
|
self.mixed_voice_state = None
|
||||||
self.selected_profile_name = None
|
self.selected_profile_name = None
|
||||||
@@ -1592,9 +1602,11 @@ class abogen(QWidget):
|
|||||||
save_config(self.config)
|
save_config(self.config)
|
||||||
if self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION:
|
if self.selected_lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION:
|
||||||
self.subtitle_combo.setEnabled(True)
|
self.subtitle_combo.setEnabled(True)
|
||||||
|
self.subtitle_format_combo.setEnabled(True)
|
||||||
self.subtitle_mode = self.subtitle_combo.currentText()
|
self.subtitle_mode = self.subtitle_combo.currentText()
|
||||||
else:
|
else:
|
||||||
self.subtitle_combo.setEnabled(False)
|
self.subtitle_combo.setEnabled(False)
|
||||||
|
self.subtitle_format_combo.setEnabled(False)
|
||||||
|
|
||||||
def update_subtitle_combo_for_profile(self, profile_name):
|
def update_subtitle_combo_for_profile(self, profile_name):
|
||||||
from abogen.voice_profiles import load_profiles
|
from abogen.voice_profiles import load_profiles
|
||||||
@@ -1603,6 +1615,7 @@ class abogen(QWidget):
|
|||||||
lang = entry.get("language") if isinstance(entry, dict) else None
|
lang = entry.get("language") if isinstance(entry, dict) else None
|
||||||
enable = lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION
|
enable = lang in SUPPORTED_LANGUAGES_FOR_SUBTITLE_GENERATION
|
||||||
self.subtitle_combo.setEnabled(enable)
|
self.subtitle_combo.setEnabled(enable)
|
||||||
|
self.subtitle_format_combo.setEnabled(enable)
|
||||||
|
|
||||||
def populate_profiles_in_voice_combo(self):
|
def populate_profiles_in_voice_combo(self):
|
||||||
# preserve current voice or profile
|
# preserve current voice or profile
|
||||||
|
|||||||
Reference in New Issue
Block a user