Mercurial > libervia-desktop-kivy
annotate cagou/core/dialog.py @ 207:a8190aecdd79
root widget: use mirror version of cagou profile for NotifsIcon
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 25 May 2018 12:04:20 +0200 |
parents | dbd2274fc78b |
children | 50f7c000b4ae |
rev | line source |
---|---|
203
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 #!/usr//bin/env python2 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
3 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
4 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
5 # Copyright (C) 2016-2018 Jérôme Poisson (goffi@goffi.org) |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
7 # This program is free software: you can redistribute it and/or modify |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
8 # it under the terms of the GNU Affero General Public License as published by |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
9 # the Free Software Foundation, either version 3 of the License, or |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
10 # (at your option) any later version. |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
11 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
15 # GNU Affero General Public License for more details. |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
16 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
17 # You should have received a copy of the GNU Affero General Public License |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
19 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
20 """generic dialogs""" |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
21 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
22 from sat.core.i18n import _ |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
23 from kivy.uix.boxlayout import BoxLayout |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
24 from kivy import properties |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
25 from sat.core import log as logging |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
26 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
27 log = logging.getLogger(__name__) |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
28 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
29 |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
30 class ConfirmDialog(BoxLayout): |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
31 title = properties.StringProperty() |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
32 message = properties.StringProperty(_(u"Are you sure?")) |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
33 # callback for no/cancel |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
34 no_cb = properties.ObjectProperty() |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
35 # callback for yes/ok |
dbd2274fc78b
core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
36 yes_cb = properties.ObjectProperty() |