~boiko/dialer-app/rtm-empty_state

« back to all changes in this revision

Viewing changes to src/qml/Dialogs/SetDefaultSIMCardDialog.qml

  • Committer: CI bot
  • Author(s): Tiago Salem Herrmann
  • Date: 2014-08-13 22:27:36 UTC
  • mfrom: (215.1.3 dialer-app-dual-sim-settings)
  • Revision ID: ps-jenkins@lists.canonical.com-20140813222736-ytpgh4ghoagynzm6
Implement default sim dialogs. 
Approved by: Gustavo Pichorim Boiko

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2012-2013 Canonical Ltd.
 
3
 *
 
4
 * This file is part of dialer-app.
 
5
 *
 
6
 * dialer-app is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * dialer-app is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
import QtQuick 2.0
 
20
import Ubuntu.Components 1.1
 
21
import Ubuntu.Components.Popups 0.1
 
22
import Ubuntu.Telephony 0.1
 
23
 
 
24
Component {
 
25
    Dialog {
 
26
        id: dialogue
 
27
        property string phoneNumber: ""
 
28
        property string accountId: ""
 
29
        text: i18n.tr("Change all Call associations to " + mainView.account.displayName +"?")
 
30
        Column {
 
31
            anchors.left: parent.left
 
32
            anchors.right: parent.right
 
33
            spacing: units.gu(2)
 
34
            Row {
 
35
                anchors.horizontalCenter: parent.horizontalCenter
 
36
                spacing: units.gu(4)
 
37
                Button {
 
38
                    objectName: "setDefaultSimCardDialogNo"
 
39
                    text: i18n.tr("No")
 
40
                    color: UbuntuColors.orange
 
41
                    onClicked: {
 
42
                        PopupUtils.close(dialogue)
 
43
                        mainView.call(phoneNumber, accountId)
 
44
                        Qt.inputMethod.hide()
 
45
                    }
 
46
                }
 
47
                Button {
 
48
                    objectName: "setDefaultSimCardDialogYes"
 
49
                    text: i18n.tr("Yes")
 
50
                    color: UbuntuColors.orange
 
51
                    onClicked: {
 
52
                        telepathyHelper.setDefaultAccount(TelepathyHelper.Call, mainView.account)
 
53
                        PopupUtils.close(dialogue)
 
54
                        mainView.call(phoneNumber, accountId)
 
55
                        Qt.inputMethod.hide()
 
56
                    }
 
57
                }
 
58
            }
 
59
            Row {
 
60
                CheckBox {
 
61
                    id: dontAskAgainCheckbox
 
62
                    checked: false
 
63
                    onCheckedChanged: settings.dialPadDontAsk = checked
 
64
                }
 
65
                Label {
 
66
                    text: i18n.tr("Don't ask again")
 
67
                    anchors.verticalCenter: dontAskAgainCheckbox.verticalCenter
 
68
                    MouseArea {
 
69
                        anchors.fill: parent
 
70
                        onClicked: dontAskAgainCheckbox.checked = !dontAskAgainCheckbox.checked
 
71
                    }
 
72
                }
 
73
            }
 
74
        }
 
75
    }
 
76
}