~dobey/ubuntuone-control-panel/fix-grammar

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/gui/qt/signin.py

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2011-08-29 12:33:30 UTC
  • mfrom: (199.2.16 disconnect-flow)
  • Revision ID: tarmac-20110829123330-7cwk9j8n7rs4l2kg
- Check for credentials at startup, if they are not present, show the signin screen (LP: #800444).
  - After local device removal, show the sign in page (LP: #813073).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
 
 
3
# Authors: Natalia B Bidart <natalia.bidart@canonical.com>
 
4
#
 
5
# Copyright 2011 Canonical Ltd.
 
6
#
 
7
# This program is free software: you can redistribute it and/or modify it
 
8
# under the terms of the GNU General Public License version 3, as published
 
9
# by the Free Software Foundation.
 
10
#
 
11
# This program is distributed in the hope that it will be useful, but
 
12
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
13
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
14
# PURPOSE.  See the GNU General Public License for more details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License along
 
17
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 
 
19
"""The signin page."""
 
20
 
 
21
from PyQt4 import QtCore
 
22
 
 
23
from ubuntuone.controlpanel.gui import RESET_PASSWORD_LINK
 
24
from ubuntuone.controlpanel.gui.qt import icon_from_name
 
25
from ubuntuone.controlpanel.gui.qt.ubuntuonebin import UbuntuOneBin
 
26
from ubuntuone.controlpanel.gui.qt.ui import signin_ui
 
27
 
 
28
 
 
29
class SignInPanel(UbuntuOneBin):
 
30
    """The widget for signing in."""
 
31
 
 
32
    ui_class = signin_ui
 
33
    signinCanceled = QtCore.pyqtSignal()
 
34
 
 
35
    def _setup(self):
 
36
        """Do some extra setupping for the UI."""
 
37
        super(SignInPanel, self)._setup()
 
38
        self.ui.forgot_password_button.uri = RESET_PASSWORD_LINK
 
39
        icon = icon_from_name('external_icon_orange')
 
40
        self.ui.forgot_password_button.setIcon(icon)
 
41
 
 
42
    @QtCore.pyqtSlot()
 
43
    def on_signin_button_clicked(self):
 
44
        """The 'Sign in' button was clicked."""
 
45
        self.is_processing = True
 
46
 
 
47
    @QtCore.pyqtSlot()
 
48
    def on_cancel_button_clicked(self):
 
49
        """The 'Cancel' button was clicked."""
 
50
        self.signinCanceled.emit()