| 1 |
/* |
| 2 |
* Copyright (C) 2012-2016 Canonical, Ltd. |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation; version 3. |
| 7 |
* |
| 8 |
* This program is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
* GNU General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU General Public License |
| 14 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
import QtQuick 2.4 |
| 18 |
|
| 19 |
import Lomiri.Components 1.3 |
| 20 |
import Lomiri.Components.Popups 1.3 |
| 21 |
import Lomiri.Contacts 0.1 as ContactsUI |
| 22 |
|
| 23 |
Dialog { |
| 24 |
id: alertMessageDialog |
| 25 |
|
| 26 |
property QtObject contact: null |
| 27 |
signal destruction |
| 28 |
|
| 29 |
title: i18n.dtr("lomiri-addressbook-app", "Contact Editor") |
| 30 |
text: { |
| 31 |
if (ContactsUI.Contacts.updateIsRunning) { |
| 32 |
return i18n.dtr("lomiri-addressbook-app", |
| 33 |
"Your <b>%1</b> contact sync account needs to be upgraded.\nWait until the upgrade is complete to edit contacts.") |
| 34 |
.arg(alertMessageDialog.contact.syncTarget.syncTarget) |
| 35 |
} |
| 36 |
if (Qt.application.name === "AddressBookApp") { |
| 37 |
i18n.dtr("lomiri-addressbook-app", |
| 38 |
"Your <b>%1</b> contact sync account needs to be upgraded. Use the sync button to upgrade the Contacts app.\nOnly local contacts will be editable until upgrade is complete.") |
| 39 |
.arg(alertMessageDialog.contact.syncTarget.syncTarget) |
| 40 |
} else { |
| 41 |
i18n.dtr("lomiri-addressbook-app", |
| 42 |
"Your <b>%1</b> contact sync account needs to be upgraded by running Contacts app.\nOnly local contacts will be editable until upgrade is complete.") |
| 43 |
.arg(alertMessageDialog.contact.syncTarget.syncTarget); |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
Button { |
| 48 |
text: i18n.dtr("lomiri-addressbook-app", "Close") |
| 49 |
onClicked: PopupUtils.close(alertMessageDialog) |
| 50 |
} |
| 51 |
|
| 52 |
Component.onCompleted: Qt.inputMethod.hide() |
| 53 |
} |