GTG

Comment 2 for bug 341871

Revision history for this message
Pititjo (jonathan-barnoud) wrote : Re: Open task with simple clic

This is very ugly but this modification of the GTG/taskbrowser/browser.py on_on_task_treeview_button_press_event method allow to open a task with simple click :

    def on_task_treeview_button_press_event(self,treeview,event) :
        if event.button == 3:
            x = int(event.x)
            y = int(event.y)
            time = event.time
            pthinfo = treeview.get_path_at_pos(x, y)
            print pthinfo
            if pthinfo is not None:
                path, col, cellx, celly = pthinfo #pylint: disable-msg=W0612
                treeview.grab_focus()
                treeview.set_cursor( path, col, 0)
                self.taskpopup.popup( None, None, None, event.button, time)
        elif event.button == 1:
            x = int(event.x)
            y = int(event.y)
            time = event.time
            pthinfo = treeview.get_path_at_pos(x, y)
            print pthinfo
            if pthinfo is not None:
                path, col, cellx, celly = pthinfo #pylint: disable-msg=W0612
                treeview.grab_focus()
                treeview.set_cursor( path, col, 0)
                tid = self.get_selected_task(self.task_tview)
                if tid :
                    self.open_task(tid)
            return 1

As I said, it's ugly.