feat: default workflow batch filters to latest batch
This commit is contained in:
@@ -405,6 +405,19 @@ def _set_batch_progress_overview(label, tasks):
|
||||
label.setText(_format_batch_progress(summary) if active else "")
|
||||
|
||||
|
||||
def _batch_filter_current_index(combo, batches, selected_batch, had_previous_items):
|
||||
batch_ids = {batch.id for batch in batches}
|
||||
if selected_batch in batch_ids:
|
||||
index = combo.findData(selected_batch)
|
||||
if index >= 0:
|
||||
return index
|
||||
if selected_batch is None and had_previous_items:
|
||||
index = combo.findData(None)
|
||||
if index >= 0:
|
||||
return index
|
||||
return 1 if batches else 0
|
||||
|
||||
|
||||
def _database_path(db_path=None, config=None) -> str:
|
||||
return db_path or appconfig.db_path(config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user