/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/add.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-29 12:17:19 UTC
  • mto: (0.14.3 main)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060929121719-cf814acd83d1bd77
Cleanup Jelmer's changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
import os
17
18
import sys
18
19
 
19
20
try:
29
30
import bzrlib.errors as errors
30
31
 
31
32
from olive import gladefile
 
33
from dialog import error_dialog
32
34
 
33
35
class OliveAdd:
34
36
    """ Display the Add file(s) dialog and perform the needed actions. """
63
65
            
64
66
            if filename is None:
65
67
                error_dialog(_('No file was selected'),
66
 
                                         _('Please select a file from the list,\nor choose the other option.'))
 
68
                             _('Please select a file from the list,\nor choose the other option.'))
67
69
                return
68
70
            
 
71
            if self.wtpath == "":
 
72
                fullpath = self.wt.abspath(filename)
 
73
            else:
 
74
                fullpath = self.wt.abspath(self.wtpath + os.sep + filename)
 
75
            
69
76
            try:
70
 
                bzrlib.add.smart_add([directory + '/' + filename])
 
77
                bzrlib.add.smart_add([fullpath])
71
78
            except errors.NotBranchError:
72
79
                error_dialog(_('Directory is not a branch'),
73
 
                                         _('You can perform this action only in a branch.'))
 
80
                             _('You can perform this action only in a branch.'))
74
81
                return
75
82
        elif radio_unknown.get_active():
76
83
            # Add unknown files recursively
77
84
            try:
78
 
                bzrlib.add.smart_add([directory], True)
 
85
                bzrlib.add.smart_add([self.wtpath], True)
79
86
            except errors.NotBranchError:
80
87
                error_dialog(_('Directory is not a branch'),
81
 
                                         _('You can perform this action only in a branch.'))
 
88
                             _('You can perform this action only in a branch.'))
82
89
                return
83
90
        
84
91
        self.close()