Logo Search packages:      
Sourcecode: catfish version File versions  Download package

def catfish::catfish::on_treeview_files_button_pressed (   self,
  treeview,
  event 
)
Show a popup menu for files or handle clicked links.

Definition at line 787 of file catfish.py.

                                                               :
        """Show a popup menu for files or handle clicked links."""

        pri, sec = self.get_selected_filename(treeview)
        if event.button == 1:
            if pri == None:
                return
            model, path = self.treeview_get_selection(treeview, event)
            if path == None:
                return
            action = model.get_value(model.get_iter(path), 4)
            if sec == None and action <> None:
                try:
                    action = re.sub('<[^>]+>', '', action)
                    action_name, action_value = action.split(':')
                    subprocess.Popen([action_value])
                    icon, message = gtk.STOCK_INFO, _('The search daemon was started.')
                except Exception, msg:
                    if self.options.debug: print 'Debug:', msg
                    icon, message = (gtk.STOCK_CANCEL
                     , _('The search daemon could not be started.'))
                    print 'Error: %s could not be run.' % action_value
                listmodel = gtk.ListStore(gtk.gdk.Pixbuf, str, int, str, str, int)
                listmodel.append([self.get_icon_pixbuf(icon), message, -1, None, None, -1])
                self.treeview_files.set_model(listmodel)
        elif event.button == 2:
            if pri <> None:
                self.open_file(pri)
        elif event.button == 3:
            if sec <> None:
                self.menu_file.popup(None, None, None, event.button, event.time)


Generated by  Doxygen 1.6.0   Back to index