Merge remote-tracking branch 'origin/Applications/16.08'

wilder
Montel Laurent 10 years ago
commit 9c0c5fa6be
  1. 6
      src/filter/autotests/CMakeLists.txt
  2. 64
      src/filter/autotests/filteractionmissingidentitydialogtest.cpp
  3. 36
      src/filter/autotests/filteractionmissingidentitydialogtest.h
  4. 1
      src/filter/dialog/filteractionmissingaccountdialog.cpp
  5. 1
      src/filter/dialog/filteractionmissingargumentdialog.cpp
  6. 25
      src/filter/dialog/filteractionmissingidentitydialog.cpp
  7. 1
      src/filter/dialog/filteractionmissingsoundurldialog.cpp
  8. 1
      src/filter/dialog/filteractionmissingtagdialog.cpp
  9. 1
      src/filter/dialog/filteractionmissingtemplatedialog.cpp
  10. 1
      src/filter/dialog/filteractionmissingtransportdialog.cpp
  11. 14
      src/filter/dialog/selectthunderbirdfilterfilesdialog.cpp
  12. 3
      src/filter/filterselectiondialog.cpp
  13. 1
      src/filter/invalidfilters/invalidfilterdialog.cpp
  14. 11
      src/filter/tests/CMakeLists.txt
  15. 39
      src/filter/tests/filteractionmissingidentitydialoggui.cpp
  16. 1
      src/folder/accountconfigorderdialog.cpp
  17. 21
      src/tag/addtagdialog.cpp
  18. 3
      src/tag/tagwidget.cpp

@ -250,3 +250,9 @@ add_mailcommon_filter_test(filteractionmissingtagdialogtest
filteractionmissingtagdialogtest.cpp
../dialog/filteractionmissingtagdialog.cpp
)
add_mailcommon_filter_test(filteractionmissingidentitydialogtest
filteractionmissingidentitydialogtest.cpp
../dialog/filteractionmissingidentitydialog.cpp
../../../autotests/dummykernel.cpp
)

@ -0,0 +1,64 @@
/*
Copyright (C) 2016 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "filteractionmissingidentitydialogtest.h"
#include "../filter/dialog/filteractionmissingidentitydialog.h"
#include "../../autotests/dummykernel.h"
#include "../../kernel/mailkernel.h"
#include <QDialogButtonBox>
#include <QLabel>
#include <QTest>
#include <KIdentityManagement/IdentityCombo>
FilterActionMissingIdentityDialogTest::FilterActionMissingIdentityDialogTest(QObject *parent)
: QObject(parent)
{
}
FilterActionMissingIdentityDialogTest::~FilterActionMissingIdentityDialogTest()
{
}
void FilterActionMissingIdentityDialogTest::initTestCase()
{
DummyKernel *kernel = new DummyKernel(0);
CommonKernel->registerKernelIf(kernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(kernel); //SettingsIf is used in FolderTreeWidget
}
void FilterActionMissingIdentityDialogTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionMissingIdentityDialog dlg(QStringLiteral("filename"));
QVERIFY(dlg.isModal());
QVERIFY(!dlg.windowTitle().isEmpty());
QLabel *label = dlg.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
KIdentityManagement::IdentityCombo *mComboBoxIdentity = dlg.findChild<KIdentityManagement::IdentityCombo *>(QStringLiteral("comboboxidentity"));
QVERIFY(mComboBoxIdentity);
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
}
QTEST_MAIN(FilterActionMissingIdentityDialogTest)

@ -0,0 +1,36 @@
/*
Copyright (C) 2016 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef FILTERACTIONMISSINGIDENTITYDIALOGTEST_H
#define FILTERACTIONMISSINGIDENTITYDIALOGTEST_H
#include <QObject>
class FilterActionMissingIdentityDialogTest : public QObject
{
Q_OBJECT
public:
explicit FilterActionMissingIdentityDialogTest(QObject *parent = Q_NULLPTR);
~FilterActionMissingIdentityDialogTest();
private Q_SLOTS:
void initTestCase();
void shouldHaveDefaultValue();
};
#endif // FILTERACTIONMISSINGIDENTITYDIALOGTEST_H

@ -62,7 +62,6 @@ FilterActionMissingAccountDialog::FilterActionMissingAccountDialog(const QString
connect(buttonBox, &QDialogButtonBox::accepted, this, &FilterActionMissingAccountDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &FilterActionMissingAccountDialog::reject);
mainLayout->addWidget(buttonBox);
okButton->setDefault(true);
readConfig();
}

@ -92,7 +92,6 @@ FilterActionMissingCollectionDialog::FilterActionMissingCollectionDialog(
connect(buttonBox, &QDialogButtonBox::accepted, this, &FilterActionMissingCollectionDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &FilterActionMissingCollectionDialog::reject);
mainLayout->addWidget(buttonBox);
mOkButton->setDefault(true);
mOkButton->setEnabled(false);
readConfig();
}

@ -42,30 +42,27 @@ FilterActionMissingIdentityDialog::FilterActionMissingIdentityDialog(const QStri
setWindowTitle(i18n("Select Identity"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QWidget *mainWidget = new QWidget(this);
mainLayout->addWidget(mainWidget);
QLabel *label = new QLabel(this);
label->setObjectName(QStringLiteral("label"));
label->setText(i18n("Filter identity is missing. "
"Please select an identity to use with filter \"%1\"",
filtername));
label->setWordWrap(true);
mainLayout->addWidget(label);
mComboBoxIdentity = new KIdentityManagement::IdentityCombo(KernelIf->identityManager(), this);
mComboBoxIdentity->setObjectName(QStringLiteral("comboboxidentity"));
mainLayout->addWidget(mComboBoxIdentity);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &FilterActionMissingIdentityDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &FilterActionMissingIdentityDialog::reject);
mainLayout->addWidget(buttonBox);
okButton->setDefault(true);
QVBoxLayout *lay = new QVBoxLayout(mainWidget);
QLabel *label = new QLabel(this);
label->setObjectName(QStringLiteral("label"));
label->setText(i18n("Filter identity is missing. "
"Please select an identity to use with filter \"%1\"",
filtername));
label->setWordWrap(true);
lay->addWidget(label);
mComboBoxIdentity = new KIdentityManagement::IdentityCombo(KernelIf->identityManager(), this);
mComboBoxIdentity->setObjectName(QStringLiteral("comboboxidentity"));
lay->addWidget(mComboBoxIdentity);
readConfig();
}

@ -64,7 +64,6 @@ FilterActionMissingSoundUrlDialog::FilterActionMissingSoundUrlDialog(const QStri
connect(buttonBox, &QDialogButtonBox::rejected, this, &FilterActionMissingSoundUrlDialog::reject);
mainLayout->addWidget(buttonBox);
okButton->setDefault(true);
readConfig();
}

@ -71,7 +71,6 @@ FilterActionMissingTagDialog::FilterActionMissingTagDialog(
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
QPushButton *user1Button = new QPushButton(this);
user1Button->setObjectName(QStringLiteral("addtag"));

@ -61,7 +61,6 @@ FilterActionMissingTemplateDialog::FilterActionMissingTemplateDialog(
connect(buttonBox, &QDialogButtonBox::accepted, this, &FilterActionMissingTemplateDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &FilterActionMissingTemplateDialog::reject);
mainLayout->addWidget(buttonBox);
okButton->setDefault(true);
readConfig();
}

@ -57,7 +57,6 @@ FilterActionMissingTransportDialog::FilterActionMissingTransportDialog(const QSt
connect(buttonBox, &QDialogButtonBox::accepted, this, &FilterActionMissingTransportDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &FilterActionMissingTransportDialog::reject);
mainLayout->addWidget(buttonBox);
okButton->setDefault(true);
readConfig();
}

@ -32,22 +32,22 @@ SelectThunderbirdFilterFilesDialog::SelectThunderbirdFilterFilesDialog(const QSt
: QDialog(parent)
{
setWindowTitle(i18n("Select thunderbird filter files"));
setModal(true);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mSelectFilterFilesWidget = new MailCommon::SelectThunderbirdFilterFilesWidget(defaultSettingPath, this);
mainLayout->addWidget(mSelectFilterFilesWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &SelectThunderbirdFilterFilesDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &SelectThunderbirdFilterFilesDialog::reject);
okButton->setDefault(true);
setModal(true);
mSelectFilterFilesWidget = new MailCommon::SelectThunderbirdFilterFilesWidget(defaultSettingPath, this);
connect(mSelectFilterFilesWidget, &MailCommon::SelectThunderbirdFilterFilesWidget::enableOkButton, okButton, &QPushButton::setEnabled);
mainLayout->addWidget(mSelectFilterFilesWidget);
okButton->setEnabled(false);
mainLayout->addWidget(buttonBox);
readConfig();
okButton->setEnabled(false);
}
SelectThunderbirdFilterFilesDialog::~SelectThunderbirdFilterFilesDialog()

@ -39,11 +39,10 @@ FilterSelectionDialog::FilterSelectionDialog(QWidget *parent)
QVBoxLayout *top = new QVBoxLayout;
setLayout(top);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setDefault(true);
mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
mOkButton->setDefault(true);
connect(buttonBox, &QDialogButtonBox::accepted, this, &FilterSelectionDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &FilterSelectionDialog::reject);
mOkButton->setDefault(true);
filtersListWidget = new QListWidget(this);
KListWidgetSearchLine *searchLine = new KListWidgetSearchLine(this, filtersListWidget);

@ -36,7 +36,6 @@ InvalidFilterDialog::InvalidFilterDialog(QWidget *parent)
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);

@ -95,3 +95,14 @@ target_link_libraries(filteractionmissingtagdialoggui
KF5::I18n
KF5::Completion
)
set(filteractionmissingidentitydialoggui_SRCS filteractionmissingidentitydialoggui.cpp ../../../autotests/dummykernel.cpp ../dialog/filteractionmissingidentitydialog.cpp)
add_executable(filteractionmissingidentitydialoggui ${filteractionmissingidentitydialoggui_SRCS})
ecm_mark_as_test(filteractionmissingidentitydialoggui)
target_link_libraries(filteractionmissingidentitydialoggui
Qt5::Core
Qt5::Gui
KF5::MailCommon
KF5::I18n
KF5::Completion
)

@ -0,0 +1,39 @@
/*
Copyright (C) 2016 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include <QApplication>
#include <QStandardPaths>
#include "../../../autotests/dummykernel.h"
#include "../kernel/mailkernel.h"
#include "../filter/dialog/filteractionmissingidentitydialog.h"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QStandardPaths::setTestModeEnabled(true);
DummyKernel *kernel = new DummyKernel(0);
CommonKernel->registerKernelIf(kernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(kernel); //SettingsIf is used in FolderTreeWidget
MailCommon::FilterActionMissingIdentityDialog *w = new MailCommon::FilterActionMissingIdentityDialog(QStringLiteral("filename"));
w->exec();
app.exec();
delete w;
return 0;
}

@ -72,7 +72,6 @@ AccountConfigOrderDialog::AccountConfigOrderDialog(QWidget *parent)
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::rejected, this, &AccountConfigOrderDialog::reject);
okButton->setDefault(true);
QWidget *page = new QWidget(this);
mainLayout->addWidget(page);

@ -54,21 +54,22 @@ AddTagDialog::AddTagDialog(const QList<KActionCollection *> &actions, QWidget *p
{
setModal(true);
setWindowTitle(i18n("Add Tag"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
d->mOkButton = buttonBox->button(QDialogButtonBox::Ok);
d->mOkButton->setDefault(true);
d->mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &AddTagDialog::slotSave);
connect(buttonBox, &QDialogButtonBox::rejected, this, &AddTagDialog::reject);
d->mOkButton->setDefault(true);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
d->mTagWidget = new MailCommon::TagWidget(actions, this);
mainLayout->addWidget(d->mTagWidget);
connect(d->mTagWidget->tagNameLineEdit(), &KLineEdit::textChanged, this, &AddTagDialog::slotTagNameChanged);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
d->mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
d->mOkButton = buttonBox->button(QDialogButtonBox::Ok);
connect(buttonBox, &QDialogButtonBox::accepted, this, &AddTagDialog::slotSave);
connect(buttonBox, &QDialogButtonBox::rejected, this, &AddTagDialog::reject);
d->mOkButton->setDefault(true);
d->mOkButton->setEnabled(false);
mainLayout->addWidget(d->mTagWidget);
mainLayout->addWidget(buttonBox);
}

@ -73,8 +73,7 @@ TagWidget::TagWidget(const QList<KActionCollection *> &actionCollections, QWidge
: QWidget(parent),
d(new MailCommon::TagWidgetPrivate)
{
QGridLayout *settings = new QGridLayout;
setLayout(settings);
QGridLayout *settings = new QGridLayout(this);
//Stretcher layout for adding some space after the label
QVBoxLayout *spacer = new QVBoxLayout();

Loading…
Cancel
Save