/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/__init__.py

  • Committer: Alexander Belchenko
  • Date: 2006-10-10 08:04:07 UTC
  • mto: (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 103.
  • Revision ID: bialix@ukr.net-20061010080407-936c4c08f535805e
updir link (..) added always to the top of directories list
also this link added only if we not in the root directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
484
484
        # Expand the tree
485
485
        self.treeview_left.expand_all()
486
486
 
 
487
    def _add_updir_to_dirlist(self, dirlist, curdir):
 
488
        """Add .. to the top of directories list if we not in root directory
 
489
 
 
490
        @param  dirlist:    list of directories (modified in place)
 
491
        @param  curdir:     current directory
 
492
        @return:            nothing
 
493
        """
 
494
        if curdir is None:
 
495
            curdir = self.path
 
496
 
 
497
        if sys.platform == 'win32':
 
498
            drive, tail = os.path.splitdrive(curdir)
 
499
            if tail in ('', '/', '\\'):
 
500
                return
 
501
        else:
 
502
            if curdir == '/':
 
503
                return
 
504
 
 
505
        # insert always as first element
 
506
        dirlist.insert(0, '..')
 
507
 
487
508
    def _load_right(self):
488
509
        """ Load data into the right panel. (Filelist) """
489
510
        # Create ListStore
490
511
        liststore = gtk.ListStore(str, str, str)
491
512
        
492
 
        dirs = ['..']
 
513
        dirs = []
493
514
        files = []
494
515
        
495
516
        # Fill the appropriate lists
505
526
        # Sort'em
506
527
        dirs.sort()
507
528
        files.sort()
 
529
 
 
530
        # add updir link to dirs
 
531
        self._add_updir_to_dirlist(dirs, self.path)
508
532
        
509
533
        if not self.notbranch:
510
534
            branch = self.wt.branch
666
690
        liststore = self.treeview_right.get_model()
667
691
        liststore.clear()
668
692
 
669
 
        dirs = ['..']
 
693
        dirs = []
670
694
        files = []
671
695
 
672
696
        # Fill the appropriate lists
682
706
        # Sort'em
683
707
        dirs.sort()
684
708
        files.sort()
685
 
        
 
709
 
 
710
        # add updir link to dirs
 
711
        self._add_updir_to_dirlist(dirs, path)
 
712
 
686
713
        # Try to open the working tree
687
714
        notbranch = False
688
715
        try: