/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-09-07 07:55:25 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-20060907075525-3838cb1cd932379d
Merge from Richard Ferguson's development branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
from dialog import OliveDialog
34
34
from menu import OliveMenu
 
35
from launch import launch
35
36
 
36
37
class OliveHandler:
37
38
    """ Signal handler class for Olive. """
213
214
    def on_treeview_left_button_press_event(self, widget, event):
214
215
        """ Occurs when somebody right-clicks in the bookmark list. """
215
216
        if event.button == 3:
 
217
            # Don't show context with nothing selected
 
218
            if self.comm.get_selected_left() == None:
 
219
                return
 
220
 
216
221
            self.menu.left_context_menu().popup(None, None, None, 0,
217
222
                                                event.time)
218
223
        
219
224
    def on_treeview_left_row_activated(self, treeview, path, view_column):
220
225
        """ Occurs when somebody double-clicks or enters an item in the
221
226
        bookmark list. """
 
227
 
 
228
        newdir = self.comm.get_selected_left()
 
229
        if newdir == None:
 
230
            return
 
231
 
222
232
        self.comm.set_busy(treeview)
223
 
        
224
 
        newdir = self.comm.get_selected_left()
225
233
        self.comm.set_path(newdir)
226
 
        
227
234
        self.comm.refresh_right()
228
 
        
229
235
        self.comm.set_busy(treeview, False)
230
236
    
231
237
    def on_treeview_right_button_press_event(self, widget, event):
260
266
        if newdir == '..':
261
267
            self.comm.set_path(os.path.split(self.comm.get_path())[0])
262
268
        else:
263
 
            fullpath = self.comm.get_path() + '/' + newdir
 
269
            fullpath = self.comm.get_path() + os.sep + newdir
264
270
            if os.path.isdir(fullpath):
265
271
                # selected item is an existant directory
266
272
                self.comm.set_path(fullpath)
267
273
            else:
268
 
                if sys.platform == 'win32':
269
 
                    # open the file with the default application
270
 
                    os.startfile(fullpath)
271
 
                else:
272
 
                    # TODO: support other OSes
273
 
                    print "DEBUG: double-click on non-Win32 platforms not supported."
 
274
                launch(fullpath) 
274
275
        
275
276
        self.comm.refresh_right()
276
277