@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging ; logger = logging . getLogger ( __name__ ) ; logger . info ( " import " )
from PyQt5 import QtCore , QtGui , QtSvg , QtWidgets
translate = QtCore . QCoreApplication . translate
from . constantsAndConfigs import constantsAndConfigs
from template . qtgui . helper import stringToColor , removeInstancesFromScene , callContextMenu , stretchLine , stretchRect
import engine . api as api
@ -331,15 +334,19 @@ class CCGraphTransparentBlock(QtWidgets.QGraphicsRectItem):
def contextMenuEvent ( self , event ) :
listOfLabelsAndFunctions = [
( " split here " , lambda : self . splitHere ( event ) ) ,
( " duplicate " , lambda : api . duplicateCCBlock ( self . staticExportItem [ " id " ] ) ) ,
( " create content link " , lambda : api . duplicateContentLinkCCBlock ( self . staticExportItem [ " id " ] ) ) ,
( " unlink " , lambda : api . unlinkCCBlock ( self . staticExportItem [ " id " ] ) ) ,
( translate ( " ccblock " , " split here " ) , lambda : self . splitHere ( event ) ) ,
( translate ( " ccblock " , " duplicate " ) , lambda : api . duplicateCCBlock ( self . staticExportItem [ " id " ] ) ) ,
( translate ( " ccblock " , " create content link " ) , lambda : api . duplicateContentLinkCCBlock ( self . staticExportItem [ " id " ] ) ) ,
( translate ( " ccblock " , " unlink " ) , lambda : api . unlinkCCBlock ( self . staticExportItem [ " id " ] ) ) ,
( " separator " , None ) ,
( translate ( " ccblock " , " move to start " ) , lambda : api . moveCCBlockToStartOfTrack ( self . staticExportItem [ " id " ] ) ) ,
( translate ( " ccblock " , " move to end " ) , lambda : api . moveCCBlockToEndOfTrack ( self . staticExportItem [ " id " ] ) ) ,
( " separator " , None ) ,
( " join with next block " , lambda : api . mergeWithNextGraphBlock ( self . staticExportItem [ " id " ] ) ) ,
( " delete block " , lambda : api . deleteCCBlock ( self . staticExportItem [ " id " ] ) ) ,
( translate ( " ccblock " , " join with next block " ) , lambda : api . mergeWithNextGraphBlock ( self . staticExportItem [ " id " ] ) ) ,
( translate ( " ccblock " , " delete block " ) , lambda : api . deleteCCBlock ( self . staticExportItem [ " id " ] ) ) ,
( " separator " , None ) ,
( " append block at the end " , lambda ccNum = self . parentCCPath . getCCNumber ( ) : api . appendGraphBlock ( self . parentCCPath . parentDataTrackId , ccNum ) ) ,
( translate ( " ccblock " , " append block at the end " ) , lambda ccNum = self . parentCCPath . getCCNumber ( ) : api . appendGraphBlock ( self . parentCCPath . parentDataTrackId , ccNum ) ) ,
]
callContextMenu ( listOfLabelsAndFunctions )