From 6d726bb10386b3d7f5481d41b735ec06cb2163ad Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 9 Jan 2018 09:35:59 +0100 Subject: Install composer/converations/people as separate views and load them dynamically. --- views/people/metadata.json | 4 ++++ views/people/qml/View.qml | 38 +++++++++++++++++++++++++++++++++++ views/people/tests/tst_peopleview.qml | 37 ++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 views/people/metadata.json create mode 100644 views/people/qml/View.qml create mode 100644 views/people/tests/tst_peopleview.qml (limited to 'views/people') diff --git a/views/people/metadata.json b/views/people/metadata.json new file mode 100644 index 00000000..44296a7e --- /dev/null +++ b/views/people/metadata.json @@ -0,0 +1,4 @@ +{ + "icon": "im-user-inverted", + "tooltip": "Your contacts." +} diff --git a/views/people/qml/View.qml b/views/people/qml/View.qml new file mode 100644 index 00000000..3f1b9261 --- /dev/null +++ b/views/people/qml/View.qml @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2017 Michael Bohlender, + * Copyright (C) 2017 Christian Mollekopf, + * + * 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; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +import QtQuick 2.7 +import QtQuick.Controls 2.1 +import org.kube.framework 1.0 as Kube + +Item { + + StackView.onActivated: { + Kube.Fabric.postMessage(Kube.Messages.synchronize, {"type": "contacts"}) + } + + Kube.People { + id: people + anchors { + fill: parent + margins: Kube.Units.smallSpacing + } + } +} diff --git a/views/people/tests/tst_peopleview.qml b/views/people/tests/tst_peopleview.qml new file mode 100644 index 00000000..263247ad --- /dev/null +++ b/views/people/tests/tst_peopleview.qml @@ -0,0 +1,37 @@ +/* + * Copyright 2017 Christian Mollekopf + * + * This program 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, 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 Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.7 +import QtTest 1.0 +import "../qml" + +TestCase { + id: testCase + width: 400 + height: 400 + name: "PeopleView" + + View { + id: peopleView + } + + function test_start() { + verify(peopleView) + } +} -- cgit v1.2.3