/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/frontend/gtk/handler.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-07-21 18:18:20 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060721181820-450b5e29bb2614d9
2006-07-21  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/olive.glade: some UI refreshment (push, remove and commit dialog)
    * olive/frontend/gtk/push.py: implemented 'push' functionality
    * olive/frontend/gtk/commit.py: implemented 'commit' functionality
    * olive/frontend/gtk/remove.py: implemented 'remove' functionality
    * olive/frontend/gtk/add.py: implemented 'add' functionality
    * olive/frontend/gtk/handler.py: implemented 'init' functionality
    * olive/backend/fileops.py: added recursive mode to add(), added
      NotBranchError exception to add() and remove()

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
except:
28
28
    sys.exit(1)
29
29
 
 
30
import olive.backend.errors as errors
 
31
 
 
32
from add import OliveAdd
30
33
from branch import OliveBranch
 
34
from commit import OliveCommit
31
35
from dialog import OliveDialog
 
36
from push import OlivePush
 
37
from remove import OliveRemove
32
38
 
33
39
class OliveHandler:
34
40
    """ Signal handler class for Olive. """
41
47
    def on_about_activate(self, widget):
42
48
        self.dialog.about()
43
49
        
 
50
    def on_menuitem_add_files_activate(self, widget):
 
51
        """ Add file(s)... menu handler. """
 
52
        add = OliveAdd(self.gladefile, self.comm)
 
53
        add.display()
 
54
    
44
55
    def on_menuitem_branch_branch_activate(self, widget):
45
56
        """ Branch/Branch... menu handler. """
46
57
        branch = OliveBranch(self.gladefile, self.comm)
47
58
        branch.display()
48
 
        
 
59
    
 
60
    def on_menuitem_branch_commit_activate(self, widget):
 
61
        """ Branch/Commit... menu handler. """
 
62
        commit = OliveCommit(self.gladefile, self.comm)
 
63
        commit.display()
 
64
    
 
65
    def on_menuitem_branch_push_activate(self, widget):
 
66
        """ Branch/Push... menu handler. """
 
67
        push = OlivePush(self.gladefile, self.comm)
 
68
        push.display()
 
69
    
 
70
    def on_menuitem_branch_initialize_activate(self, widget):
 
71
        """ Initialize current directory. """
 
72
        import olive.backend.init as init
 
73
        
 
74
        try:
 
75
            init.init(self.comm.get_path())
 
76
        except errors.AlreadyBranchError, errmsg:
 
77
            self.dialog.error_dialog('Directory is already a branch: %s' % errmsg)
 
78
        except errors.BranchExistsWithoutWorkingTree, errmsg:
 
79
            self.dialog.error_dialog('Branch exists without a working tree: %s' % errmsg)
 
80
        else:
 
81
            self.dialog.info_dialog('Directory successfully initialized.')
 
82
            self.comm.refresh_right()
 
83
        
 
84
    def on_menuitem_remove_file_activate(self, widget):
 
85
        """ Remove (unversion) selected file. """
 
86
        remove = OliveRemove(self.gladefile, self.comm)
 
87
        remove.display()
 
88
    
49
89
    def on_treeview_right_row_activated(self, treeview, path, view_column):
50
90
        """ Occurs when somebody double-clicks or enters an item in the
51
91
        file list. """
52
92
        import os.path
53
93
        
54
 
        treeselection = treeview.get_selection()
55
 
        (model, iter) = treeselection.get_selected()
56
 
        newdir = model.get_value(iter, 1)
 
94
        newdir = self.comm.get_selected_right()
57
95
        
58
96
        if newdir == '..':
59
97
            self.comm.set_path(os.path.split(self.comm.get_path())[0])