~ubuntu-branches/ubuntu/quantal/ubuntuone-control-panel/quantal-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Natalia Bidart (nessita)
  • Date: 2012-03-21 14:11:29 UTC
  • mfrom: (1.1.28)
  • Revision ID: package-import@ubuntu.com-20120321141129-89ojm8a21r5k5su3
Tags: 2.99.91-0ubuntu1
* New upstream release:
  - Added the app name from ubuntu one to be used in the webclient
    so that it is shown in the sso ui (LP: #952880).
  - Added 'Computer to cloud' page to the wizard
    (part of LP: #933697).
  - Tweaked the title of the aforementioned page (LP: #888521).
  - Added 'Cloud to computer' page to the initial wizard
    (part of LP: #933697).
  - Added a confirmation dialog to quit the wizard
    (part of LP: #933697).
  - Implemented a method to list the user's default folders in
    every platform (part of LP: #933697).
  - Apply new specification for tabbing navigation and tabbing style
    (LP: #942020).
  - Make the "Explore" buttons for folders be disabled (style-wise)
    when the folder is not synched (LP: #949035).
  - Removed first line from the man page for the qt control panel
    so is detected as such and installed (LP: #948970).
  - Added several tweaks to the UI stylesheet to avoid 'movements'
    when focusing a button, and to remove the ugly border from the
    twitter and facebook buttons.
  - Enable platform-specific styling (LP: #953318).
  - Arranged Tab ordering in folders tab according to guidelines
    (LP: #950073).
  - Enabled Qt translation engine so standard dialogs are translated
    (LP: #951651).
  - Switched to the native file chooser on Linux (LP: #947711).
  - Fixed --alert and --switch-to tabname and updated --help and
    manpage accordingly (LP: #940465).
  - Don't hard-code the font sizes (LP: #942025, LP: #953062).
* Removed patches which were included upstream.
* debian/watch:
  - Updated url to fetch tarball from latest milestone.
* debian/control:
  - Bumped dependency versions on ubuntu-sso-client and ubuntuone-client to
    2.99.91.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    def _setup(self):
51
51
        """Do some extra setupping for the UI."""
52
52
        super(DevicesPanel, self)._setup()
53
 
        self.ui.local_device.setTitle(DEVICES_LOCAL_LABEL)
 
53
        self.ui.local_device_box.setTitle(DEVICES_LOCAL_LABEL)
54
54
        self.ui.other_devices.setTitle(DEVICES_REMOTE_LABEL)
55
55
        self.ui.manage_devices_button.setText(DEVICES_MANAGE_LABEL)
56
56
        self.ui.manage_devices_button.uri = EDIT_DEVICES_LINK
66
66
    @log_call(logger.debug)
67
67
    def process_info(self, info):
68
68
        """Process and display the devices info."""
69
 
        self.clear_device_info(self.ui.local_device_box)
70
69
        self.ui.list_devices.clear()
71
70
 
72
71
        for device_info in info:
76
75
 
77
76
    def on_local_device_removed(self):
78
77
        """When the local device is removed, clear the box and emit signal."""
79
 
        self.clear_device_info(self.ui.local_device_box)
 
78
        self.ui.local_device.clear()
80
79
        self.localDeviceRemoved.emit()
81
80
 
82
 
    def clear_device_info(self, box):
83
 
        """Clear all the device info."""
84
 
        children = box.count()
85
 
        # we need to reverse the index list to remove children because:
86
 
        # "Items are numbered consecutively from 0. If an item is deleted,
87
 
        # other items will be renumbered."
88
 
        # http://doc.qt.nokia.com/latest/qlayout.html#itemAt
89
 
        for i in reversed(range(children)):
90
 
            widget = box.itemAt(i).widget()
91
 
            box.removeWidget(widget)
92
 
            widget.deleteLater()
93
 
 
94
81
    def update_device_info(self, device_info):
95
82
        """Update one device."""
96
83
        if device_info["is_local"]:
100
87
 
101
88
    def update_local_device(self, device_info):
102
89
        """Update the info for the local device."""
103
 
        device_widget = device.DeviceWidget(device_id=device_info['device_id'])
104
 
        device_widget.update_device_info(device_info)
105
 
        device_widget.removed.connect(self.on_local_device_removed)
106
 
 
107
 
        self.ui.local_device_box.addWidget(device_widget)
 
90
        self.ui.local_device.update_device_info(device_info)
 
91
        self.ui.local_device.removed.connect(self.on_local_device_removed)
108
92
 
109
93
    def create_remote_device(self, device_info):
110
94
        """Add a remote device to the list."""
111
 
        widget = device.get_device_for_list_widget(device_info)
 
95
        widget = device.RemoteDeviceWidget()
 
96
        widget.update_device_info(device_info)
112
97
        item = QtGui.QListWidgetItem()
113
98
 
114
99
        self.ui.list_devices.addItem(item)