示例#1
0
 def paste(self):
     widget = QtGui.QApplication.focusWidget()
     if not isinstance(widget, QtGui.QTableView):
         return
     text = QtGui.QApplication.clipboard().text()
     with messagebox(self):
         self.paste_text(widget.parent(), text)
示例#2
0
 def set_central_widget(self, nrmlfile):
     self.nrmlfile = nrmlfile
     with messagebox(self):
         converter = Converter.from_nrml(nrmlfile)
     self.tableset = converter.tableset
     widgetname = converter.__class__.__name__ + 'Widget'
     widgetclass = getattr(customtableview, widgetname)
     self.widget = widgetclass(converter.tableset, nrmlfile, self)
     self.setCentralWidget(self.widget)
示例#3
0
 def save(self, nrmlfile):  # save on current file
     try:
         node = self.full_check()
     except:
         return
     with messagebox(self):
         # save to a temporary file
         with open(nrmlfile + '~', 'w+') as f:
             node_to_nrml(node, f)
         # only if there are no errors rename the file
         os.rename(nrmlfile + '~', nrmlfile)
示例#4
0
 def full_check(self):
     with messagebox(self):
         return self.tableset.to_node()