[Thunar-dev] Classic UI

Brian brian-schott at cox.net
Wed Mar 16 02:39:56 CET 2005


Auke Kok wrote:

>
> very, middle-click also conforms to mozilla/firefox 'open in new tab' 
> behaviour, I would get used to that very quickly!
>
> sofar 

Glad to hear that. Ever since I started using firefox, I've thought 
about a tabbed file manager. I'm sure there's some code from GAIM that 
could be stolen. They have tabs in their instant message windows that 
you can tear off into their own windows. Still not sure if it's 
practical or even a good idea, especially since the goal here is user 
friendly and simple.

Anyways, I found a bug in the code I just posted. (forgot to de-select 
things with the middle click) This should work:

    def _button_press_event(self, event):
        if event.button == 3 and event.type == gtk.gdk.BUTTON_PRESS:
            path = self.get_path_at_pos(int(event.x), int(event.y))
            if path:
                if not self.path_is_selected(path):
                    self.unselect_all()
                    self.select_path(path)
                self.grab_focus()
                self.context_menu()
            return True
        elif event.button == 2 and event.type == gtk.gdk.BUTTON_PRESS:
            path = self.get_path_at_pos(int(event.x), int(event.y))
            if path:
                iter = self.get_model().get_iter(path)
                info = self.get_model().get(iter, 
ThunarModel.COLUMN_FILEINFO)[0]
                if info.is_directory():
                    self.unselect_all()
                    self.select_path(path)
                    self.get_toplevel()._action_folder_middle_click()
        elif event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS:
            path = self.get_path_at_pos(int(event.x), int(event.y))
            if path:
                iter = self.get_model().get_iter(path)
                if event.button == 1:
                    self.unselect_all()
                    self.select_path(path)
                info = self.get_model().get(iter, 
ThunarModel.COLUMN_FILEINFO)[0]
                if info.is_directory():
                    self.activated(info)
            return True
        return False

I'm done spamming the list for tonight.
    Brian Schott



More information about the Thunar-dev mailing list