Always present the SD card selection dialog box when creating a zip.

The "Import without asking for confirmation" preference should only
apply to actual importing.
This commit is contained in:
sawinglogz 2021-09-02 15:49:34 -04:00
parent 65ddecf818
commit 4abef160ff
2 changed files with 4 additions and 4 deletions

View File

@ -999,7 +999,7 @@ void MainWindow::on_action_Import_Data_triggered()
} }
QList<ImportPath> MainWindow::selectCPAPDataCards(const QString & prompt) QList<ImportPath> MainWindow::selectCPAPDataCards(const QString & prompt, bool alwaysPrompt)
{ {
QList<ImportPath> datacards = detectCPAPCards(); QList<ImportPath> datacards = detectCPAPCards();
@ -1028,7 +1028,7 @@ QList<ImportPath> MainWindow::selectCPAPDataCards(const QString & prompt)
infostr = tr("A %1 file structure was located at:").arg(datacards[0].loader->loaderName()); infostr = tr("A %1 file structure was located at:").arg(datacards[0].loader->loaderName());
} }
if (!p_profile->cpap->autoImport()) { if (alwaysPrompt || !p_profile->cpap->autoImport()) {
QMessageBox mbox(QMessageBox::NoIcon, QMessageBox mbox(QMessageBox::NoIcon,
tr("CPAP Data Located"), infostr+"\n\n"+QDir::toNativeSeparators(datacards[0].path)+"\n\n"+ tr("CPAP Data Located"), infostr+"\n\n"+QDir::toNativeSeparators(datacards[0].path)+"\n\n"+
prompt, prompt,
@ -2661,7 +2661,7 @@ void MainWindow::on_mainsplitter_splitterMoved(int, int)
void MainWindow::on_actionCreate_Card_zip_triggered() void MainWindow::on_actionCreate_Card_zip_triggered()
{ {
QList<ImportPath> datacards = selectCPAPDataCards(tr("Would you like to zip this card?")); QList<ImportPath> datacards = selectCPAPDataCards(tr("Would you like to zip this card?"), true);
for (auto & datacard : datacards) { for (auto & datacard : datacards) {
QString cardPath = QDir(datacard.path).canonicalPath(); QString cardPath = QDir(datacard.path).canonicalPath();

View File

@ -374,7 +374,7 @@ private:
QString getMainWindowTitle(); QString getMainWindowTitle();
void importCPAPBackups(); void importCPAPBackups();
QList<ImportPath> detectCPAPCards(); QList<ImportPath> detectCPAPCards();
QList<ImportPath> selectCPAPDataCards(const QString & prompt); QList<ImportPath> selectCPAPDataCards(const QString & prompt, bool alwaysPrompt = false);
void importCPAPDataCards(const QList<ImportPath> & datacards); void importCPAPDataCards(const QList<ImportPath> & datacards);
void addMachineToMenu(Machine* mach, QMenu* menu); void addMachineToMenu(Machine* mach, QMenu* menu);
void purgeDay(MachineType type); void purgeDay(MachineType type);