| 1 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
| 2 |
# |
| 3 |
# Copyright (C) 2014 Canonical Ltd. |
| 4 |
# |
| 5 |
# This program is free software; you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU Lesser General Public License as published by |
| 7 |
# the Free Software Foundation; version 3. |
| 8 |
# |
| 9 |
# This program is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
# GNU Lesser General Public License for more details. |
| 13 |
# |
| 14 |
# You should have received a copy of the GNU Lesser General Public License |
| 15 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
|
| 17 |
from lomiriuitoolkit._custom_proxy_objects import _qquicklistview |
| 18 |
|
| 19 |
|
| 20 |
class LomiriListView11(_qquicklistview.QQuickListView): |
| 21 |
"""Autopilot helper for the LomiriListView 1.1.""" |
| 22 |
|
| 23 |
def pull_to_refresh_enabled(self): |
| 24 |
refresh = self.select_single('PullToRefresh') |
| 25 |
return refresh.enabled |
| 26 |
|
| 27 |
def manual_refresh_wait(self): |
| 28 |
refresh = self.select_single('PullToRefresh') |
| 29 |
if refresh.enabled: |
| 30 |
self.pull_to_refresh() |
| 31 |
refresh.wait_for_refresh() |
| 32 |
return True |
| 33 |
return False |
| 34 |
|
| 35 |
def manual_refresh_nowait(self): |
| 36 |
refresh = self.select_single('PullToRefresh') |
| 37 |
if refresh.enabled: |
| 38 |
self.pull_to_refresh() |
| 39 |
return True |
| 40 |
return False |
| 41 |
|
| 42 |
def wait_refresh_completed(self): |
| 43 |
refresh = self.select_single('PullToRefresh') |
| 44 |
if refresh.enabled: |
| 45 |
refresh.wait_for_refresh() |
| 46 |
return True |
| 47 |
return False |
| 48 |
|
| 49 |
|
| 50 |
class LomiriListView(LomiriListView11): |
| 51 |
"""Autopilot helper for the LomiriListView 1.3.""" |