mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-07-16 10:03:42 -07:00
better error UI
This commit is contained in:
parent
640ff5db62
commit
eff8c1e595
3 changed files with 7 additions and 6 deletions
|
@ -60,7 +60,7 @@ class QFaceSwapper(QBackendPanel):
|
|||
q_two_pass_label = QLabelPopupInfo(label=L('@QFaceSwapper.two_pass'), popup_info_text=L('@QFaceSwapper.help.two_pass') )
|
||||
q_two_pass = QCheckBoxCSWFlag(cs.two_pass, reflect_state_widgets=[q_two_pass_label])
|
||||
|
||||
grid_l = lib_qt.QXGridLayout(spacing=5)
|
||||
grid_l = lib_qt.QXGridLayout( spacing=5)
|
||||
row = 0
|
||||
grid_l.addWidget(q_model_label, row, 0, alignment=Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter )
|
||||
grid_l.addLayout(lib_qt.QXHBoxLayout([q_model, 2, btn_open_folder, 2, q_model_info_label]), row, 1, alignment=Qt.AlignmentFlag.AlignLeft )
|
||||
|
|
|
@ -11,6 +11,7 @@ from xlib.mp import csw as lib_csw
|
|||
from .QCSWControl import QCSWControl
|
||||
|
||||
|
||||
|
||||
class QErrorCSWError(QCSWControl):
|
||||
"""
|
||||
Implements lib_csw.Error control as widget
|
||||
|
@ -28,7 +29,7 @@ class QErrorCSWError(QCSWControl):
|
|||
fixed_size=(32,32),
|
||||
)
|
||||
|
||||
label = self._label = lib_qt.QXLabel(font=QXFontDB.get_default_font(size=7), word_wrap=True)
|
||||
label = self._label = lib_qt.QXTextEdit( font=QXFontDB.get_default_font(size=7), read_only=True, fixed_height=80 )
|
||||
|
||||
bar = lib_qt.QXFrame(layout=lib_qt.QXHBoxLayout(
|
||||
[ lib_qt.QXWidget(layout=lib_qt.QXHBoxLayout([label_warning]), size_policy=(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum)) ,
|
||||
|
|
|
@ -154,8 +154,8 @@ class DFMModelInitializer:
|
|||
|
||||
INITIALIZING, DOWNLOADING, INITIALIZED, ERROR, = range(4)
|
||||
downloader : ThreadFileDownloader = None
|
||||
url = dfm_model_info.get_url()
|
||||
status = None
|
||||
|
||||
while True:
|
||||
events = DFMModelInitializer.Events()
|
||||
|
||||
|
@ -168,7 +168,7 @@ class DFMModelInitializer:
|
|||
model_path = dfm_model_info.get_model_path()
|
||||
|
||||
if not model_path.exists():
|
||||
url = dfm_model_info.get_url()
|
||||
|
||||
if url is None:
|
||||
new_status = ERROR
|
||||
events.error = 'Model file is not found and URL is not defined.'
|
||||
|
@ -199,7 +199,7 @@ class DFMModelInitializer:
|
|||
events.download_progress = progress
|
||||
else:
|
||||
new_status = ERROR
|
||||
events.error = error
|
||||
events.error = f'Unable to download {url}, error:' + error
|
||||
|
||||
if new_status != status:
|
||||
events.prev_status_initializing = status == INITIALIZING
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue