File indexing completed on 2024-12-29 04:54:46
0001 /* 0002 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-only 0005 */ 0006 0007 #include "editorsieve_gui.h" 0008 #include "ksieveui/tests/capability.h" 0009 #include <QDebug> 0010 0011 #include <QApplication> 0012 #include <QCommandLineParser> 0013 #include <QStandardPaths> 0014 0015 int main(int argc, char **argv) 0016 { 0017 QApplication app(argc, argv); 0018 QStandardPaths::setTestModeEnabled(true); 0019 0020 QCommandLineParser parser; 0021 parser.addVersionOption(); 0022 parser.addHelpOption(); 0023 0024 parser.process(app); 0025 0026 auto dialog = new SieveEditorTestWidget; 0027 const QStringList capabilities = KSieveUi::Test::fullCapabilitiesList(); 0028 // Add all capabilities for testing 0029 dialog->setSieveCapabilities(capabilities); 0030 if (dialog->exec()) { 0031 qDebug() << " generated script :\n" << dialog->script() << "\n"; 0032 } 0033 delete dialog; 0034 return 0; 0035 } 0036 0037 SieveEditorTestWidget::SieveEditorTestWidget(QWidget *parent) 0038 : KSieveUi::SieveEditor(parent) 0039 { 0040 connect(this, &SieveEditorTestWidget::valueChanged, this, &SieveEditorTestWidget::slotValueChanged); 0041 } 0042 0043 SieveEditorTestWidget::~SieveEditorTestWidget() = default; 0044 0045 void SieveEditorTestWidget::slotValueChanged(bool changed) 0046 { 0047 qDebug() << " value changed :" << changed; 0048 } 0049 0050 #include "moc_editorsieve_gui.cpp"