1
# -*- coding: utf-8 -*-
3
# Authors: Alejandro J. Cura <alecu@canonical.com>
4
# Natalia B. Bidart <natalia.bidart@canonical.com>
6
# Copyright 2011 Canonical Ltd.
8
# This program is free software: you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License version 3, as published
10
# by the Free Software Foundation.
12
# This program is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranties of
14
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15
# PURPOSE. See the GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License along
18
# with this program. If not, see <http://www.gnu.org/licenses/>.
20
"""The user interface for the control panel for Ubuntu One."""
22
from twisted.internet import defer
24
from ubuntuone.controlpanel.logger import setup_logging, log_call
25
from ubuntuone.controlpanel.gui import (
29
from ubuntuone.controlpanel.gui.qt.ubuntuonebin import UbuntuOneBin
30
from ubuntuone.controlpanel.gui.qt.ui import account_ui
33
logger = setup_logging('qt.account')
36
class AccountPanel(UbuntuOneBin):
37
"""The Account Tab Panel widget"""
42
"""Do some extra setupping for the UI."""
43
self.ui.edit_profile_button.uri = EDIT_PROFILE_LINK
44
self.ui.edit_services_button.uri = EDIT_ACCOUNT_LINK
46
@defer.inlineCallbacks
49
self.is_processing = True
50
info = yield self.backend.account_info()
51
self.process_info(info)
53
@log_call(logger.debug)
54
def process_info(self, info):
55
"""Process and display the account info."""
56
self.ui.name_label.setText(info["name"])
57
self.ui.email_label.setText(info["email"])
58
self.ui.services_description_label.setText(info["type"])
60
self.is_processing = False