/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-13 14:08:06 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-20060813140806-3364d3e02a086d51
Modified OliveDialog class interface; huge cleanups.

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

    * olive/frontend/gtk/branch.py: display number of revisions branched
    * olive/frontend/gtk/*: use new dialog interface with detailed descriptions
    * olive/frontend/gtk/dialog.py: modified according to GNOME HIG (primary
      and secondary text)

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    def on_menuitem_add_files_activate(self, widget):
49
49
        """ Add file(s)... menu handler. """
50
50
        from add import OliveAdd
51
 
        add = OliveAdd(self.gladefile, self.comm)
 
51
        add = OliveAdd(self.gladefile, self.comm, self.dialog)
52
52
        add.display()
53
53
    
54
54
    def on_menuitem_branch_get_activate(self, widget):
55
55
        """ Branch/Get... menu handler. """
56
56
        from branch import OliveBranch
57
 
        branch = OliveBranch(self.gladefile, self.comm)
 
57
        branch = OliveBranch(self.gladefile, self.comm, self.dialog)
58
58
        branch.display()
59
59
    
60
60
    def on_menuitem_branch_checkout_activate(self, widget):
61
61
        """ Branch/Checkout... menu handler. """
62
62
        from checkout import OliveCheckout
63
 
        checkout = OliveCheckout(self.gladefile, self.comm)
 
63
        checkout = OliveCheckout(self.gladefile, self.comm, self.dialog)
64
64
        checkout.display()
65
65
    
66
66
    def on_menuitem_branch_commit_activate(self, widget):
67
67
        """ Branch/Commit... menu handler. """
68
68
        from commit import OliveCommit
69
 
        commit = OliveCommit(self.gladefile, self.comm)
 
69
        commit = OliveCommit(self.gladefile, self.comm, self.dialog)
70
70
        commit.display()
71
71
    
72
72
    def on_menuitem_branch_pull_activate(self, widget):
78
78
        try:
79
79
            ret = update.pull(self.comm.get_path())
80
80
        except errors.NotBranchError:
81
 
            self.dialog.error_dialog('Directory is not a branch.')
 
81
            self.dialog.error_dialog('Directory is not a branch',
 
82
                                     'You can perform this action only in a branch.')
82
83
        except errors.NoLocationKnown:
83
 
            self.dialog.error_dialog('Parent location is unknown.')
 
84
            self.dialog.error_dialog('Parent location is unknown',
 
85
                                     'Pulling is not possible until there is no parent location.')
84
86
        else:
85
 
            self.dialog.info_dialog('%d revision(s) pulled.' % ret)
 
87
            self.dialog.info_dialog('Pull successful',
 
88
                                    '%d revision(s) pulled.' % ret)
86
89
        
87
90
        self.comm.set_busy(self.comm.window_main, False)
88
91
    
89
92
    def on_menuitem_branch_push_activate(self, widget):
90
93
        """ Branch/Push... menu handler. """
91
94
        from push import OlivePush
92
 
        push = OlivePush(self.gladefile, self.comm)
 
95
        push = OlivePush(self.gladefile, self.comm, self.dialog)
93
96
        push.display()
94
97
    
95
98
    def on_menuitem_branch_status_activate(self, widget):
96
99
        """ Branch/Status... menu handler. """
97
100
        from status import OliveStatus
98
 
        status = OliveStatus(self.gladefile, self.comm)
 
101
        status = OliveStatus(self.gladefile, self.comm, self.dialog)
99
102
        status.display()
100
103
    
101
104
    def on_menuitem_branch_initialize_activate(self, widget):
105
108
        try:
106
109
            init.init(self.comm.get_path())
107
110
        except errors.AlreadyBranchError, errmsg:
108
 
            self.dialog.error_dialog('Directory is already a branch: %s' % errmsg)
 
111
            self.dialog.error_dialog('Directory is already a branch',
 
112
                                     'The current directory (%s) is already a branch.\nYou can start using it, or initialize another directory.' % errmsg)
109
113
        except errors.BranchExistsWithoutWorkingTree, errmsg:
110
 
            self.dialog.error_dialog('Branch exists without a working tree: %s' % errmsg)
 
114
            self.dialog.error_dialog('Branch without a working tree',
 
115
                                     'The current directory (%s)\nis a branch without a working tree.' % errmsg)
 
116
        except:
 
117
            raise
111
118
        else:
112
 
            self.dialog.info_dialog('Directory successfully initialized.')
 
119
            self.dialog.info_dialog('Ininialize successful',
 
120
                                    'Directory successfully initialized.')
113
121
            self.comm.refresh_right()
114
122
        
115
123
    def on_menuitem_file_make_directory_activate(self, widget):
116
124
        """ File/Make directory... menu handler. """
117
125
        from mkdir import OliveMkdir
118
 
        mkdir = OliveMkdir(self.gladefile, self.comm)
 
126
        mkdir = OliveMkdir(self.gladefile, self.comm, self.dialog)
119
127
        mkdir.display()
120
128
    
121
129
    def on_menuitem_file_move_activate(self, widget):
122
130
        """ File/Move... menu handler. """
123
131
        from move import OliveMove
124
 
        move = OliveMove(self.gladefile, self.comm)
 
132
        move = OliveMove(self.gladefile, self.comm, self.dialog)
125
133
        move.display()
126
134
    
127
135
    def on_menuitem_file_rename_activate(self, widget):
128
136
        """ File/Rename... menu handler. """
129
137
        from rename import OliveRename
130
 
        rename = OliveRename(self.gladefile, self.comm)
 
138
        rename = OliveRename(self.gladefile, self.comm, self.dialog)
131
139
        rename.display()
132
140
 
133
141
    def on_menuitem_remove_file_activate(self, widget):
134
142
        """ Remove (unversion) selected file. """
135
143
        from remove import OliveRemove
136
 
        remove = OliveRemove(self.gladefile, self.comm)
 
144
        remove = OliveRemove(self.gladefile, self.comm, self.dialog)
137
145
        remove.display()
138
146
    
139
147
    def on_menuitem_stats_diff_activate(self, widget):
140
148
        """ Statistics/Differences... menu handler. """
141
149
        from diff import OliveDiff
142
 
        diff = OliveDiff(self.gladefile, self.comm)
 
150
        diff = OliveDiff(self.gladefile, self.comm, self.dialog)
143
151
        diff.display()
144
152
    
145
153
    def on_menuitem_stats_infos_activate(self, widget):
146
154
        """ Statistics/Informations... menu handler. """
147
155
        from info import OliveInfo
148
 
        info = OliveInfo(self.gladefile, self.comm)
 
156
        info = OliveInfo(self.gladefile, self.comm, self.dialog)
149
157
        info.display()
150
158
    
151
159
    def on_menuitem_stats_log_activate(self, widget):
152
160
        """ Statistics/Log... menu handler. """
153
161
        from log import OliveLog
154
 
        log = OliveLog(self.gladefile, self.comm)
 
162
        log = OliveLog(self.gladefile, self.comm, self.dialog)
155
163
        log.display()
156
164
    
157
165
    def on_treeview_left_button_press_event(self, widget, event):
208
216
 
209
217
    def not_implemented(self, widget):
210
218
        """ Display a Not implemented error message. """
211
 
        self.dialog.error_dialog('This feature is not yet implemented.')
 
219
        self.dialog.error_dialog('I feel sorry',
 
220
                                 'This feature is not yet implemented.')
212
221