1
# -*- coding: utf-8 -*-
3
# Authors: Natalia B. Bidart <natalia.bidart@canonical.com>
5
# Copyright 2011 Canonical Ltd.
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.
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.
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/>.
19
"""A button that opens links in the web."""
21
from PyQt4 import QtGui, QtCore
23
from ubuntuone.controlpanel.gui import qt
26
class GoToWebButton(QtGui.QPushButton):
27
"""The GoToWebButton widget"""
29
def __init__(self, *args, **kwargs):
30
"""Initialize the UI of the widget."""
31
super(GoToWebButton, self).__init__(*args, **kwargs)
33
self.setIcon(qt.icon_from_name('external_icon_white'))
34
self.setLayoutDirection(QtCore.Qt.RightToLeft)
35
self.clicked.connect(self.on_clicked)
39
"""Open self.uri if not None, do nothing otherwise."""
40
if self.uri is not None: