~mardy/ubuntu-system-settings-online-accounts/qml-dialog

« back to all changes in this revision

Viewing changes to src/AccountsPage.qml

  • Committer: Alberto Mardegan
  • Date: 2013-05-30 13:00:54 UTC
  • Revision ID: alberto.mardegan@canonical.com-20130530130054-oojk8zrqbhmiaitd
First iteration

Show existing accounts and providers list

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 Canonical Ltd.
 
3
 *
 
4
 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
 
5
 *
 
6
 * This program is free software: you can redistribute it and/or modify it
 
7
 * under the terms of the GNU General Public License version 3, as published
 
8
 * by the Free Software Foundation.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful, but
 
11
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
12
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
13
 * PURPOSE.  See the GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License along
 
16
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
import QtQuick 2.0
 
20
import Ubuntu.Components 0.1
 
21
 
 
22
Flickable {
 
23
    id: root
 
24
 
 
25
    property variant accountsModel
 
26
 
 
27
    contentHeight: contentItem.childrenRect.height
 
28
 
 
29
    Column {
 
30
        anchors.left: parent.left
 
31
        anchors.right: parent.right
 
32
 
 
33
        Repeater {
 
34
            model: accountsModel
 
35
 
 
36
            delegate: AccountItem {
 
37
                text: providerName
 
38
                subText: displayName
 
39
                globalServiceHandle: accountService
 
40
            }
 
41
        }
 
42
 
 
43
        Button {
 
44
            anchors.left: parent.left
 
45
            anchors.right: parent.right
 
46
            text: i18n.dtr(plugin.translations, "Add account…")
 
47
            onClicked: pageStack.push(newAccountPage)
 
48
        }
 
49
 
 
50
        AddAccountLabel {}
 
51
    }
 
52
 
 
53
    Component {
 
54
        id: newAccountPage
 
55
        NewAccountPage {}
 
56
    }
 
57
}