Commit d05b7bba authored by Laurent Montel's avatar Laurent Montel 😁

start to redesign addresseditor

parent a3dd5967
......@@ -78,6 +78,7 @@ install(FILES
)
if (BUILD_TESTING)
add_subdirectory(src/editor/autotests)
add_subdirectory(src/editor/addresseditor/autotests/)
endif()
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
......
......@@ -32,6 +32,11 @@ configure_file(config-akonadi-contact.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config
configure_file( actions/contactactionssettings.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/contactactionssettings.kcfg @ONLY)
kconfig_add_kcfg_files(akonadicontact_actions_SRCS actions/contactactionssettings.kcfgc)
set(akonadicontact_addresslocation_editor_SRCS
editor/addresseditor/addresslocationwidget.cpp
editor/addresseditor/addresseslocationviewer.cpp
)
set(akonadicontact_editor_SRCS
editor/addresseditwidget.cpp
editor/categorieseditwidget.cpp
......@@ -62,6 +67,7 @@ set(akonadicontact_editor_SRCS
)
set(akonadicontact_LIB_SRC
${akonadicontact_addresslocation_editor_SRCS}
abstractcontactformatter.cpp
abstractcontactgroupformatter.cpp
attributeregistrar.cpp
......
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
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 "addresseslocationviewer.h"
AddressesLocationViewer::AddressesLocationViewer(QWidget *parent)
: QWidget(parent)
{
//TODO add list of address
}
AddressesLocationViewer::~AddressesLocationViewer()
{
}
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
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 ADDRESSESLOCATIONVIEWER_H
#define ADDRESSESLOCATIONVIEWER_H
#include <QWidget>
class AddressesLocationViewer : public QWidget
{
Q_OBJECT
public:
explicit AddressesLocationViewer(QWidget *parent = Q_NULLPTR);
~AddressesLocationViewer();
};
#endif // ADDRESSESLOCATIONVIEWER_H
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
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 "addresslocationwidget.h"
#include <KLineEdit>
#include <KLocalizedString>
#include <QVBoxLayout>
#include <QLabel>
#include <QCheckBox>
AddressLocationWidget::AddressLocationWidget(QWidget *parent)
: QWidget(parent)
{
QGridLayout *topLayout = new QGridLayout;
setLayout(topLayout);
mPreferredCheckBox = new QCheckBox(i18nc("street/postal", "This is the preferred address"), this);
mPreferredCheckBox->setObjectName(QStringLiteral("preferredcheckbox"));
}
AddressLocationWidget::~AddressLocationWidget()
{
}
void AddressLocationWidget::setAddress(const KContacts::Address &address)
{
//TODO
}
KContacts::Address AddressLocationWidget::address() const
{
return KContacts::Address();
}
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
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 ADDRESSLOCATIONWIDGET_H
#define ADDRESSLOCATIONWIDGET_H
#include <QWidget>
#include <KContacts/Address>
class QCheckBox;
class AddressLocationWidget : public QWidget
{
Q_OBJECT
public:
explicit AddressLocationWidget(QWidget *parent = Q_NULLPTR);
~AddressLocationWidget();
void setAddress(const KContacts::Address &address);
KContacts::Address address() const;
private:
QCheckBox *mPreferredCheckBox;
};
#endif // ADDRESSLOCATIONWIDGET_H
set(QT_REQUIRED_VERSION "5.4.0")
find_package(Qt5Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED)
set(addresseslocationviewer_SRCS addresseslocationviewertest.cpp )
add_executable(addresseslocationviewer ${addresseslocationviewer_SRCS})
add_test(addresseslocationviewer addresseslocationviewer)
ecm_mark_as_test(addresseslocationviewer)
target_link_libraries(addresseslocationviewer Qt5::Test Qt5::Widgets KF5::AkonadiContact KF5::Contacts KF5::I18n)
set(addresslocationwidget_SRCS addresslocationwidgettest.cpp )
add_executable(addresslocationwidget ${addresslocationwidget_SRCS})
add_test(addresslocationwidget addresslocationwidget)
ecm_mark_as_test(addresslocationwidget)
target_link_libraries(addresslocationwidget Qt5::Test Qt5::Widgets KF5::AkonadiContact KF5::Contacts KF5::I18n)
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
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 "addresseslocationviewertest.h"
#include <QTest>
AddressesLocationViewerTest::AddressesLocationViewerTest(QObject *parent)
: QObject(parent)
{
}
AddressesLocationViewerTest::~AddressesLocationViewerTest()
{
}
QTEST_MAIN(AddressesLocationViewerTest)
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
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 ADDRESSESLOCATIONVIEWERTEST_H
#define ADDRESSESLOCATIONVIEWERTEST_H
#include <QObject>
class AddressesLocationViewerTest : public QObject
{
Q_OBJECT
public:
explicit AddressesLocationViewerTest(QObject *parent = Q_NULLPTR);
~AddressesLocationViewerTest();
};
#endif // ADDRESSESLOCATIONVIEWERTEST_H
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
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 "addresslocationwidgettest.h"
#include <QTest>
AddressLocationWidgetTest::AddressLocationWidgetTest(QObject *parent)
: QObject(parent)
{
}
AddressLocationWidgetTest::~AddressLocationWidgetTest()
{
}
void AddressLocationWidgetTest::shouldHaveDefaultValue()
{
//TODO
}
QTEST_MAIN(AddressLocationWidgetTest)
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
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 ADDRESSLOCATIONWIDGETTEST_H
#define ADDRESSLOCATIONWIDGETTEST_H
#include <QObject>
class AddressLocationWidgetTest : public QObject
{
Q_OBJECT
public:
explicit AddressLocationWidgetTest(QObject *parent = Q_NULLPTR);
~AddressLocationWidgetTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // ADDRESSLOCATIONWIDGETTEST_H
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