fix: allow native inspection and backup entry after batch errors
This commit is contained in:
1 parent
aea6192ef9
commit
1acfbd6374
5 files changed
+65
-12
No files matched your search
@@ -199,10 +199,14 @@ def _inspect_project(job, process, emit):
|
||||
while process.poll() is None and time.monotonic() < deadline + 3:
|
||||
windows = [w for w in _windows(process.pid) if not (
|
||||
w['title'] == '' and w['class'] in ('UAC_InputIndicatorOverlayWnd', 'UAC Input Indicator'))]
|
||||
mains = [w for w in windows if w['class'].startswith('Afx:')
|
||||
and w['title'].casefold() == ('iCDB Project Backup - '+str(project)).casefold()]
|
||||
main = mains[0] if len(mains) == 1 else None
|
||||
shells = [w for w in windows if w['class'].startswith('Afx:') and w['title'] == 'iCDB Project Backup']
|
||||
exact = [w for w in windows if w['class'].startswith('Afx:')
|
||||
and w['title'].casefold() == ('iCDB Project Backup - '+str(project)).casefold()]
|
||||
# EE7.9 can keep the generic shell title while loading the requested PRJ.
|
||||
# Its Output still binds the project; waiting only for the decorated title
|
||||
# turns a valid session into a false timeout.
|
||||
mains = exact or shells
|
||||
main = mains[0] if len(mains) == 1 else None
|
||||
unknown = [w for w in windows if w is not main and w not in shells]
|
||||
if unknown:
|
||||
result.update(status='UNCONFIRMED', unknown_dialogs=unknown)
|
||||
|
||||
@@ -312,8 +312,9 @@ class MainWindow(QWidget):
|
||||
# are optional and only enable the extra contents check.
|
||||
ready = not self.busy and self.loaded_path == self.lmc_edit.text() and self.cbb_table.rowCount() > 0
|
||||
selected = self.selected_records()
|
||||
native_target = self._native_backup_target()
|
||||
self.native_backup_button.setEnabled(ready and self._native_backup_session is None
|
||||
and len(selected) == 1 and selected[0].status != 'READY')
|
||||
and native_target is not None)
|
||||
ready = ready and not self._native_backup_same_library()
|
||||
self.batch_button.setEnabled(ready and bool(self._eligible_names()))
|
||||
self.selected_batch_button.setEnabled(ready and bool(self._eligible_names(checked_only=True)))
|
||||
@@ -521,7 +522,19 @@ class MainWindow(QWidget):
|
||||
|
||||
def _maintenance_names(self):
|
||||
records = self.selected_records() or self.visible_records()
|
||||
return [record.name for record in records if record.status != 'READY']
|
||||
return [record.name for record in records
|
||||
if record.status != 'READY' and record.name not in self.skipped_names]
|
||||
|
||||
def _native_backup_target(self):
|
||||
selected = self.selected_records()
|
||||
if selected:
|
||||
return selected[0] if len(selected) == 1 and selected[0].status != 'READY' else None
|
||||
row = self.cbb_table.currentRow()
|
||||
if row < 0 or self.cbb_table.isRowHidden(row):
|
||||
return None
|
||||
item = self.cbb_table.item(row, 0)
|
||||
record = self._records_by_name.get(item.text()) if item is not None else None
|
||||
return record if record is not None and record.status != 'READY' else None
|
||||
|
||||
def _check_visible(self, state):
|
||||
self.cbb_table.blockSignals(True)
|
||||
@@ -740,12 +753,12 @@ class MainWindow(QWidget):
|
||||
def open_native_backup(self):
|
||||
if self.busy or not self.loaded_path or self._native_backup_session is not None:
|
||||
return
|
||||
selected = self.selected_records()
|
||||
if len(selected) != 1 or selected[0].status == 'READY':
|
||||
target = self._native_backup_target()
|
||||
if target is None:
|
||||
self.status_label.setText('请勾选一个非 READY CBB。')
|
||||
return
|
||||
from cbb_refresh_verify.native_backup import launch_native_backup
|
||||
request = self._request(selected[0].name)
|
||||
request = self._request(target.name)
|
||||
launcher = self.native_backup_launcher or launch_native_backup
|
||||
self._global_icdb_run = False
|
||||
self._reimport_offers = ()
|
||||
|
||||
Reference in new issue
Block a user