mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Merge branch 'main' of https://github.com/jborza/abogen
This commit is contained in:
+14
-3
@@ -1417,7 +1417,6 @@ class abogen(QWidget):
|
||||
if self.preview_playing:
|
||||
try:
|
||||
import pygame
|
||||
|
||||
pygame.mixer.music.stop()
|
||||
except Exception:
|
||||
pass
|
||||
@@ -1432,8 +1431,20 @@ class abogen(QWidget):
|
||||
self.voice_combo.setEnabled(False)
|
||||
self.btn_voice_formula_mixer.setEnabled(False) # Disable mixer button
|
||||
self.btn_start.setEnabled(False) # Disable start button during preview
|
||||
# start loading animation
|
||||
self.loading_movie.start()
|
||||
|
||||
# Start loading animation - ensure signal connection is always active
|
||||
if hasattr(self, 'loading_movie'):
|
||||
# Disconnect previous connections to avoid multiple connections
|
||||
try:
|
||||
self.loading_movie.frameChanged.disconnect()
|
||||
except TypeError:
|
||||
pass # Ignore error if not connected
|
||||
|
||||
# Reconnect the signal
|
||||
self.loading_movie.frameChanged.connect(
|
||||
lambda: self.btn_preview.setIcon(QIcon(self.loading_movie.currentPixmap()))
|
||||
)
|
||||
self.loading_movie.start()
|
||||
|
||||
def pipeline_loaded_callback(np_module, kpipeline_class, error):
|
||||
self._on_pipeline_loaded_for_preview(np_module, kpipeline_class, error)
|
||||
|
||||
+3
-4
@@ -66,10 +66,9 @@ def get_version():
|
||||
|
||||
# Define config path
|
||||
def get_user_config_path():
|
||||
if os.name == "nt":
|
||||
config_dir = os.path.join(os.environ["APPDATA"], "abogen")
|
||||
else:
|
||||
config_dir = os.path.join(os.path.expanduser("~"), ".config", "abogen")
|
||||
from platformdirs import user_config_dir
|
||||
# Use platformdirs to get the user configuration directory
|
||||
config_dir = user_config_dir("abogen", appauthor=False, roaming=True)
|
||||
os.makedirs(config_dir, exist_ok=True)
|
||||
return os.path.join(config_dir, "config.json")
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
import json
|
||||
from utils import get_user_config_path, get_resource_path
|
||||
from utils import get_user_config_path
|
||||
|
||||
|
||||
def _get_profiles_path():
|
||||
|
||||
Reference in New Issue
Block a user