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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-08-19 20:31:46 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-20060819203146-1a5b098844b3f106
GUI (toolbar + menu) cleanup.

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

    * olive/frontend/gtk/__init__.py: applied Diff toolbutton menu
    * olive/frontend/gtk/menu.py: implemented the Diff toolbutton menu
    * cmenu.ui: added Diff toolbutton menu; removed Log from right context menu
    * olive.glade: swapped Diff and Log toolbuttons; coverted log button to an
      ordinary GtkToolButton

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
                                       'Diff', None,
74
74
                                       'Show the diff of the file',
75
75
                                       self.diff),
76
 
                                      ('log', None,
77
 
                                       'Log', None,
78
 
                                       'Show the log of the file',
79
 
                                       self.log),
80
76
                                      ('bookmark', None,
81
77
                                       'Bookmark', None,
82
78
                                       'Bookmark current location',
84
80
                                      ('remove_bookmark', gtk.STOCK_REMOVE,
85
81
                                       'Remove', None,
86
82
                                       'Remove the selected bookmark',
87
 
                                       self.remove_bookmark)
 
83
                                       self.remove_bookmark),
 
84
                                      ('diff_selected', None,
 
85
                                       'Selected...', None,
 
86
                                       'Show the differences of the selected file',
 
87
                                       self.diff_selected),
 
88
                                      ('diff_all', None,
 
89
                                       'All...', None,
 
90
                                       'Show the differences of all files',
 
91
                                       self.diff_all)
88
92
                                     ])
89
93
        
90
94
        self.ui.insert_action_group(self.actiongroup, 0)
91
95
        self.ui.add_ui_from_file(self.uifile)
92
96
        
93
97
        self.cmenu_right = self.ui.get_widget('/context_right')
94
 
        
95
98
        self.cmenu_left = self.ui.get_widget('/context_left')
 
99
        self.toolbar_diff = self.ui.get_widget('/toolbar_diff')
96
100
        
97
101
        # Set icons
98
102
        commit_menu = self.ui.get_widget('/context_right/commit')
107
111
        diff_icon = gtk.Image()
108
112
        diff_icon.set_from_pixbuf(diff_pixbuf)
109
113
        diff_menu.set_image(diff_icon)
110
 
        log_menu = self.ui.get_widget('/context_right/log')
111
 
        log_image = self.comm.menuitem_stats_log.get_image()
112
 
        log_pixbuf = log_image.get_pixbuf()
113
 
        log_icon = gtk.Image()
114
 
        log_icon.set_from_pixbuf(log_pixbuf)
115
 
        log_menu.set_image(log_icon)
116
114
 
117
115
    def right_context_menu(self):
118
116
        return self.cmenu_right
180
178
        diff = OliveDiff(self.gladefile, self.comm, self.dialog)
181
179
        diff.display()
182
180
    
183
 
    def log(self, action):
184
 
        """ Right context menu -> Log """
185
 
        from log import OliveLog
186
 
        log = OliveLog(self.gladefile, self.comm, self.dialog)
187
 
        log.display()
188
 
    
189
181
    def bookmark(self, action):
190
182
        """ Right context menu -> Bookmark """
191
183
        if self.comm.pref.add_bookmark(self.comm.get_path()):
202
194
        self.comm.pref.remove_bookmark(self.comm.get_selected_left())
203
195
        
204
196
        self.comm.refresh_left()
 
197
    
 
198
    def diff_selected(self, action):
 
199
        """ Diff toolbutton -> Selected... """
 
200
        print "DEBUG: not implemented."
 
201
    
 
202
    def diff_all(self, action):
 
203
        """ Diff toolbutton -> All... """
 
204
        from diff import OliveDiff
 
205
        diff = OliveDiff(self.gladefile, self.comm, self.dialog)
 
206
        diff.display()