Commit 6bcfe211 authored by Laurent Montel's avatar Laurent Montel 😁

Allow to use dnd for moving script part

parent 2c3e11e1
......@@ -23,3 +23,5 @@ add_sieveeditor_autocreatescripts(selectheadersdialogtest.cpp "../sievecondition
add_sieveeditor_autocreatescripts(sieveeditorgraphicalmodewidgettest.cpp "${ksieveui_sieveeditor_autocreatescripts_LIB_SRCS};../../tests/capability.cpp")
add_sieveeditor_autocreatescripts(sievedatespinboxtest.cpp "")
add_sieveeditor_autocreatescripts(regexpeditorlineedittest.cpp "")
add_sieveeditor_autocreatescripts(sievescriptlistboxtest.cpp "")
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "sievescriptlistboxtest.h"
#include "autocreatescripts/sievescriptlistbox.h"
#include <QTest>
#include <QVBoxLayout>
QTEST_MAIN(SieveScriptListBoxTest)
SieveScriptListBoxTest::SieveScriptListBoxTest(QObject *parent)
: QObject(parent)
{
}
void SieveScriptListBoxTest::shouldHaveDefaultValues()
{
KSieveUi::SieveScriptListBox lst(QStringLiteral("foo"));
QVBoxLayout *layout = lst.findChild<QVBoxLayout *>(QStringLiteral("layout"));
QVERIFY(layout);
QListWidget *mSieveListScript = lst.findChild<QListWidget *>(QStringLiteral("mSieveListScript"));
QVERIFY(mSieveListScript);
QCOMPARE(mSieveListScript->dragDropMode(), QAbstractItemView::InternalMove);
}
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef SIEVESCRIPTLISTBOXTEST_H
#define SIEVESCRIPTLISTBOXTEST_H
#include <QObject>
class SieveScriptListBoxTest : public QObject
{
Q_OBJECT
public:
explicit SieveScriptListBoxTest(QObject *parent = nullptr);
~SieveScriptListBoxTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValues();
};
#endif // SIEVESCRIPTLISTBOXTEST_H
......@@ -98,7 +98,10 @@ SieveScriptListBox::SieveScriptListBox(const QString &title, QWidget *parent)
: QGroupBox(title, parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setObjectName(QStringLiteral("layout"));
mSieveListScript = new QListWidget(this);
mSieveListScript->setObjectName(QStringLiteral("mSieveListScript"));
mSieveListScript->setDragDropMode(QAbstractItemView::InternalMove);
layout->addWidget(mSieveListScript);
//----------- the first row of buttons
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment