~ubuntu-branches/ubuntu/oneiric/ubuntuone-control-panel/oneiric

« back to all changes in this revision

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

* New upstream release:
  [ Alejandro J. Cura <alecu@canonical.com>]
    - Do not throw a webclient error when closing
      (LP: #845105).
  [ Natalia B. Bidart <natalia.bidart@canonical.com> ]
    - Removed all code related to Bookmarks (LP: #850142).
    - Replaces references to "Evolution" by "Thunderbird" (LP: #849494).
  [ Rodney Dawes <rodney.dawes@canonical.com> ]
    - Don't install a .desktop file for control panel
      (part of LP: #838778).
    - Point the indicator/Unity API at the installer .desktop file
      (part of LP: #838778).
    - Set the WMCLASS so Unity will fall back properly
      (part of LP: #838778).
    - Fix a few grammar mistakes (LP: #835093).
    - Don't show the "Get NGB free!" label on "Join now" button at all
      (LP: #819955).
* debian/control:
  - ubuntuone-control-panel-gtk depends now on ubuntuone-installer >= 2.0.0.
  - require ubuntuone-client >= 2.0.0.
  - require ubuntu-sso-client >= 1.4.0.
  - no longer install a .desktop file (will be installed by ubuntuone-installer).

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from PyQt4 import QtGui
22
22
 
23
 
from ubuntuone.controlpanel import backend
 
23
from ubuntuone.controlpanel import cache
 
24
from ubuntuone.controlpanel.gui.qt import handle_errors
24
25
from ubuntuone.controlpanel.gui.qt.loadingoverlay import LoadingOverlay
25
26
 
26
27
 
27
 
class UbuntuOneBin(QtGui.QWidget):
 
28
class UbuntuOneBin(cache.Cache, QtGui.QWidget):
28
29
    """The base widget for the Control Panel's tabs."""
29
30
 
30
31
    ui_class = None
31
32
 
32
 
    def __init__(self, parent=None):
 
33
    def __init__(self, *args, **kwargs):
33
34
        """Initialize the UI of the widget."""
34
 
        QtGui.QWidget.__init__(self, parent)
 
35
        super(UbuntuOneBin, self).__init__(*args, **kwargs)
35
36
        self.ui = None
36
37
        if self.ui_class is not None:
37
38
            # self.ui_class is not callable
45
46
        self._is_processing = None
46
47
        self.is_processing = False
47
48
 
 
49
        # pylint: disable=E0202
 
50
        handler = handle_errors(logger=self.logger,
 
51
                                error_handler=self._error_handler)
 
52
        self.load = handler(self.load)
 
53
 
48
54
        self._setup()
49
 
        self.backend = backend.ControlBackend()
50
55
 
51
56
    def _get_is_processing(self):
52
57
        """Get the value of is_processing."""
65
70
 
66
71
    is_processing = property(fget=_get_is_processing, fset=_set_is_processing)
67
72
 
 
73
    def _error_handler(self):
 
74
        """Custom error handler, unset is_processing."""
 
75
        self.is_processing = False
 
76
 
68
77
    def _setup(self):
69
78
        """Do some extra setupping for the UI."""
70
79
 
71
 
    # Invalid name "showEvent"
 
80
    # Invalid name "showEvent", "resizeEvent"
72
81
    # pylint: disable=C0103
73
82
 
74
83
    def showEvent(self, event):
75
84
        """Load info."""
 
85
        super(UbuntuOneBin, self).showEvent(event)
76
86
        self.load()
77
 
        event.accept()
78
 
 
79
 
    # Invalid name "resizeEvent"
80
 
    # pylint: disable=C0103
81
87
 
82
88
    def resizeEvent(self, event):
83
89
        """Resize the overlay to fit all the widget."""
84
90
        self.overlay.resize(event.size())
85
91
        event.accept()
86
92
 
 
93
    # pylint: enable=C0103
 
94
 
 
95
    # pylint: disable=E0202
87
96
    def load(self):
88
97
        """Load the widget with specific info."""