~ubuntu-branches/ubuntu/trusty/ubuntu-system-settings-online-accounts/trusty-proposed

« back to all changes in this revision

Viewing changes to src/qml/AccountItem.qml

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Alberto Mardegan, Ubuntu daily release
  • Date: 2013-11-08 11:39:33 UTC
  • mfrom: (1.1.16)
  • Revision ID: package-import@ubuntu.com-20131108113933-xrv3xr4gparbjdq7
Tags: 0.2~+14.04.20131108-0ubuntu1
[ Alberto Mardegan ]
* Move OnlineAccounts into its own process Create the
  com.canonical.OnlineAccountsUI D-Bus service, whose task is to show
  the Online Accounts UI when clients request it. The SystemSettings
  plugin for Online Accounts becomes just one of these clients. The
  rationale for the change is that it has been decided by design that
  multiple instances of Online Accounts can be running at the same
  time (because the Online Accounts UI will be modal to the
  application which invoked it), yet they need to coordinate in order
  to avoid the creation of the same account in two different places.
  Using a single process with multiple windows and exposing a D-Bus
  API seems to be the best approach and is also flexible enough to
  accomodate for most of the design changes that might pop up. It's
  also a proved approach, used already by signon-ui (in fact, most of
  the code is taken from there). .
* Implement window transiency Let the service know what QWindow is
  active in the client process, and use that one as parent window for
  the transiency.

[ Ubuntu daily release ]
* Automatic snapshot from revision 77

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
import Ubuntu.Components.ListItems 0.1 as ListItem
 
22
import Ubuntu.OnlineAccounts 0.1
 
23
 
 
24
ListItem.Subtitled {
 
25
    property variant accountHandle
 
26
    property variant globalServiceHandle
 
27
    property variant __editPage: null
 
28
    property bool running: false
 
29
 
 
30
    text: providerName
 
31
    subText: displayName
 
32
    icon: "image://theme/" + globalService.provider.iconName
 
33
    progression: true
 
34
    opacity: globalService.enabled ? 1 : 0.5
 
35
 
 
36
    resources: [
 
37
        AccountService {
 
38
            id: globalService
 
39
            objectHandle: globalServiceHandle
 
40
        },
 
41
        Component {
 
42
            id: accountEditPage
 
43
            AccountEditPage {}
 
44
        }
 
45
    ]
 
46
 
 
47
    onClicked: {
 
48
        __editPage = accountEditPage.createObject(null, {
 
49
            "accountHandle": accountHandle })
 
50
        __editPage.finished.connect(__onEditFinished)
 
51
        pageStack.push(__editPage)
 
52
        running = true;
 
53
    }
 
54
 
 
55
    function __onEditFinished() {
 
56
        __editPage.destroy(1000)
 
57
        __editPage = null
 
58
        pageStack.pop()
 
59
        running = false
 
60
    }
 
61
}