~bhaveekdesai/ubuntuone-control-panel/bug-725802

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/gtk/gui.py

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2011-02-10 20:02:47 UTC
  • mfrom: (60.2.3 share-subs)
  • Revision ID: tarmac-20110210200247-pfuk4u66391bwg6b
- Shares info is now displayed in 'Folders' tab and is modifiable (LP: #714583).

Show diffs side-by-side

added added

removed removed

Lines of Context:
470
470
            if name:
471
471
                name = name + "'s"
472
472
                icon_name = self.SHARE_ICON_NAME
 
473
 
 
474
                # we already added user folders, let's add an empty row
 
475
                treeiter = self.volumes_store.append(None, empty_row)
473
476
            else:
474
477
                name = self.MY_FOLDERS
475
478
                icon_name = self.FOLDER_ICON_NAME
484
487
            for volume in volumes:
485
488
                sensitive = True
486
489
                path = self._process_path(volume['path'])
487
 
                if volume['type'] == u'ROOT':
 
490
                is_root = volume['type'] == backend.ControlBackend.ROOT_TYPE
 
491
 
 
492
                if is_root:
488
493
                    sensitive = False
489
494
                    path = self.ROOT % (path, ORANGE, self.ALWAYS_SUBSCRIBED)
490
495
 
491
496
                row = (path, bool(volume['subscribed']), icon_name, True,
492
497
                       sensitive, gtk.ICON_SIZE_MENU, volume['volume_id'])
493
498
 
494
 
                if volume['type'] == u'ROOT':  # root should go first!
 
499
                if is_root:  # root should go first!
495
500
                    self.volumes_store.prepend(treeiter, row)
496
501
                else:
497
502
                    self.volumes_store.append(treeiter, row)
498
503
 
499
 
            # When we display shares info, we'll need to smartly add
500
 
            # an empty row to the tree view to separate volume groups
501
 
            #treeiter = self.volumes_store.append(None, empty_row)
502
 
 
503
 
        self.volumes_view.expand_row(0, True)
 
504
        self.volumes_view.expand_all()
504
505
        self.volumes_view.show_all()
505
506
 
506
507
        self.is_processing = False