Exemplo n.º 1
0
 def f(menu, doc):
     fm = appdata.app.fontMetrics()
     width = fm.averageCharWidth() * 80
     text = fm.elidedText(doc.name, Qt.ElideMiddle, width).replace(u'\u2026', '...')
     action = QAction(text, menu)
     action.triggered.connect(lambda: appdata.project.Compare(selected, doc))
     menu.addAction(action)
Exemplo n.º 2
0
 def f(menu, v):
     projname, ext = os.path.splitext(os.path.basename(v))
     action = QAction(projname, menu)
     action.triggered.connect(lambda: appdata.project.OpenProjectFile(v))
     action.setStatusTip(v)
     menu.addAction(action)