/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-08-09 12:20:51 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-20060809122051-f912e25c7d8755ac
Implemented pull functionality.

2006-08-09  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/backend/update.py: added NotBranchError support to pull()
    * olive/backend/__init__.py: added Branch/Pull signal
    * olive/backend/handler.py: implemented Branch/Pull signal handler

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
import olive.backend.errors as errors
31
31
 
32
 
from add import OliveAdd
33
 
from branch import OliveBranch
34
 
from checkout import OliveCheckout
35
 
from commit import OliveCommit
36
32
from dialog import OliveDialog
37
 
from diff import OliveDiff
38
33
from menu import OliveMenu
39
 
from push import OlivePush
40
 
from remove import OliveRemove
41
 
from status import OliveStatus
42
34
 
43
35
class OliveHandler:
44
36
    """ Signal handler class for Olive. """
55
47
        
56
48
    def on_menuitem_add_files_activate(self, widget):
57
49
        """ Add file(s)... menu handler. """
 
50
        from add import OliveAdd
58
51
        add = OliveAdd(self.gladefile, self.comm)
59
52
        add.display()
60
53
    
61
54
    def on_menuitem_branch_get_activate(self, widget):
62
55
        """ Branch/Get... menu handler. """
 
56
        from branch import OliveBranch
63
57
        branch = OliveBranch(self.gladefile, self.comm)
64
58
        branch.display()
65
59
    
66
60
    def on_menuitem_branch_checkout_activate(self, widget):
67
61
        """ Branch/Checkout... menu handler. """
 
62
        from checkout import OliveCheckout
68
63
        checkout = OliveCheckout(self.gladefile, self.comm)
69
64
        checkout.display()
70
65
    
71
66
    def on_menuitem_branch_commit_activate(self, widget):
72
67
        """ Branch/Commit... menu handler. """
 
68
        from commit import OliveCommit
73
69
        commit = OliveCommit(self.gladefile, self.comm)
74
70
        commit.display()
75
71
    
 
72
    def on_menuitem_branch_pull_activate(self, widget):
 
73
        """ Branch/Pull menu handler. """
 
74
        import olive.backend.update as update
 
75
        
 
76
        self.comm.set_busy(self.comm.window_main)
 
77
        
 
78
        try:
 
79
            ret = update.pull(self.comm.get_path())
 
80
        except errors.NotBranchError:
 
81
            self.dialog.error_dialog('Directory is not a branch.')
 
82
        except errors.NoLocationKnown:
 
83
            self.dialog.error_dialog('Parent location is unknown.')
 
84
        else:
 
85
            self.dialog.info_dialog('%d revision(s) pulled.' % ret)
 
86
        
 
87
        self.comm.set_busy(self.comm.window_main, False)
 
88
    
76
89
    def on_menuitem_branch_push_activate(self, widget):
77
90
        """ Branch/Push... menu handler. """
 
91
        from push import OlivePush
78
92
        push = OlivePush(self.gladefile, self.comm)
79
93
        push.display()
80
94
    
81
95
    def on_menuitem_branch_status_activate(self, widget):
82
96
        """ Branch/Status... menu handler. """
 
97
        from status import OliveStatus
83
98
        status = OliveStatus(self.gladefile, self.comm)
84
99
        status.display()
85
100
    
99
114
        
100
115
    def on_menuitem_remove_file_activate(self, widget):
101
116
        """ Remove (unversion) selected file. """
 
117
        from remove import OliveRemove
102
118
        remove = OliveRemove(self.gladefile, self.comm)
103
119
        remove.display()
104
120
    
105
121
    def on_menuitem_stats_diff_activate(self, widget):
106
122
        """ Statistics/Differences... menu handler. """
 
123
        from diff import OliveDiff
107
124
        diff = OliveDiff(self.gladefile, self.comm)
108
125
        diff.display()
109
126