File indexing completed on 2024-12-22 05:01:15
0001 /* 0002 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-only 0005 */ 0006 0007 #include <QApplication> 0008 #include <QCommandLineParser> 0009 #include <QStandardPaths> 0010 0011 #include "sieveimapinterface/kmailsieveimapinstanceinterface.h" 0012 #include "sieveimapinterface/kmsieveimappasswordprovider.h" 0013 #include <KSieveCore/MultiImapVacationManager> 0014 #include <KSieveCore/SieveImapInstanceInterfaceManager> 0015 #include <KSieveUi/MultiImapVacationDialog> 0016 int main(int argc, char **argv) 0017 { 0018 QApplication app(argc, argv); 0019 QStandardPaths::setTestModeEnabled(true); 0020 0021 QCommandLineParser parser; 0022 parser.addVersionOption(); 0023 parser.addHelpOption(); 0024 0025 parser.process(app); 0026 0027 app.setQuitOnLastWindowClosed(true); 0028 KSieveCore::SieveImapInstanceInterfaceManager::self()->setSieveImapInstanceInterface(new KMailSieveImapInstanceInterface); 0029 KMSieveImapPasswordProvider provider(nullptr); 0030 KSieveCore::MultiImapVacationManager manager(&provider); 0031 KSieveUi::MultiImapVacationDialog dlg(&manager); 0032 QObject::connect(&dlg, &KSieveUi::MultiImapVacationDialog::okClicked, &app, &QApplication::quit); 0033 QObject::connect(&dlg, &KSieveUi::MultiImapVacationDialog::cancelClicked, &app, &QApplication::quit); 0034 0035 dlg.show(); 0036 0037 return app.exec(); 0038 }