#NEWLINE# def contextMenuEvent( self , event ) : #NEWLINE# #INDENT# item = self . itemAt ( event . pos ( ) ) #NEWLINE# if isinstance ( item , QVistrailEntityItem ) : #NEWLINE# #INDENT# if ( item and ( self . openFilesItem . indexOfChild ( item ) == ( - 1 ) ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# menu = QtGui . QMenu ( self ) #NEWLINE# new_window = QtGui . QAction ( 'Open in New Window' , self , triggered = item . open_in_new_window ) #NEWLINE# new_window . setStatusTip ( 'Open specified vistrail file in another window' ) #NEWLINE# menu . addAction ( new_window ) #NEWLINE# close = QtGui . QAction ( 'Close' , self , triggered = ( lambda : self . close_vistrail ( item ) ) ) #NEWLINE# close . setStatusTip ( 'Close the specified vistrail file' ) #NEWLINE# menu . addAction ( close ) #NEWLINE# menu . exec_ ( event . globalPos ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( item , QWorkflowEntityItem ) or isinstance ( item , QVistrailListLatestItem ) ) : #NEWLINE# #INDENT# if ( item and ( self . openFilesItem . indexOfChild ( item . get_vistrail ( ) ) == ( - 1 ) ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# menu = QtGui . QMenu ( self ) #NEWLINE# act = QtGui . QAction ( 'Open' , self , triggered = item . open_workflow ) #NEWLINE# act . setStatusTip ( 'Open specified workflow in this window' ) #NEWLINE# menu . addAction ( act ) #NEWLINE# act = QtGui . QAction ( 'Open in new Tab' , self , triggered = item . open_workflow_in_new_tab ) #NEWLINE# act . setStatusTip ( 'Open specified workflow in a new tab' ) #NEWLINE# menu . addAction ( act ) #NEWLINE# act = QtGui . QAction ( 'Open in new Window' , self , triggered = item . open_workflow_in_new_window ) #NEWLINE# act . setStatusTip ( 'Open specified workflow in a new window' ) #NEWLINE# menu . addAction ( act ) #NEWLINE# menu . exec_ ( event . globalPos ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( item , QMashupEntityItem ) : #NEWLINE# #INDENT# if ( item and ( self . openFilesItem . indexOfChild ( item . parent ( ) . parent ( ) ) == ( - 1 ) ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# menu = QtGui . QMenu ( self ) #NEWLINE# act = QtGui . QAction ( 'Edit' , self , triggered = item . edit_mashup ) #NEWLINE# act . setStatusTip ( 'Edit the mashup' ) #NEWLINE# menu . addAction ( act ) #NEWLINE# act = QtGui . QAction ( 'Execute' , self , triggered = item . open_mashup ) #NEWLINE# act . setStatusTip ( 'Execute the mashup' ) #NEWLINE# menu . addAction ( act ) #NEWLINE# menu . exec_ ( event . globalPos ( ) )