File indexing completed on 2024-05-12 05:25:36
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "pimdatabackuprestoreui.h" 0008 #include "abstractimportexportjob.h" 0009 #include "importexportprogressindicatorgui.h" 0010 #include <KLocalizedString> 0011 #include <KMessageBox> 0012 0013 PimDataBackupRestoreUI::PimDataBackupRestoreUI(QWidget *parentWidget, QObject *parent) 0014 : PimDataBackupRestore(parent) 0015 , mParentWidget(parentWidget) 0016 { 0017 } 0018 0019 PimDataBackupRestoreUI::~PimDataBackupRestoreUI() = default; 0020 0021 bool PimDataBackupRestoreUI::continueToRestore() 0022 { 0023 const int answer = 0024 KMessageBox::questionTwoActions(mParentWidget, 0025 i18n("The archive was created by a newer version of this program. It might contain additional data which " 0026 "will be skipped during import. Do you want to import it?"), 0027 i18n("Not correct version"), 0028 KGuiItem(i18nc("@action:button", "Import"), QStringLiteral("document-import")), 0029 KStandardGuiItem::cancel()); 0030 if (answer == KMessageBox::ButtonCode::SecondaryAction) { 0031 return false; 0032 } 0033 return true; 0034 } 0035 0036 void PimDataBackupRestoreUI::addExportProgressIndicator() 0037 { 0038 mImportExportData->setImportExportProgressIndicator(new ImportExportProgressIndicatorGui(mParentWidget, this)); 0039 } 0040 0041 #include "moc_pimdatabackuprestoreui.cpp"