def onExportToPackage(self): # check if category is not empty if self._rawNode._rawGraph.category == '': QMessageBox.information( None, "Warning", "Category is not set! Please step into compound and type category name." ) return packageNames = list(GET_PACKAGES().keys()) selectedPackageName, accepted = QInputDialog.getItem(None, "Select", "Select package", packageNames, editable=False) if accepted: packagePath = GET_PACKAGE_PATH(selectedPackageName) compoundsDir = os.path.join(packagePath, "Compounds") if not os.path.isdir(compoundsDir): os.mkdir(compoundsDir) self.onExport(root=compoundsDir) # refresh node box app = self.canvasRef().getApp() nodeBoxes = app.getRegisteredTools( classNameFilters=["NodeBoxTool"]) for nodeBox in nodeBoxes: nodeBox.refresh()
def shortcuts_info(self): data = "Ctrl+N - new file\n" data += "Ctrl+S - save\n" data += "Ctrl+Shift+S - save as\n" data += "Ctrl+O - open file\n" data += "Ctrl+D - duplicate\n" data += "Alt+Drag - duplicate\n" data += "Delete - kill selected nodes\n" data += "Ctrl+C - copy\n" data += "Ctrl+V - paste\n" data += "Ctrl+Z - undo\n" data += "Ctrl+Y - redo\n" data += "Tab - togle node box\n" data += "F - frame Selected\n" data += "G - frame All\n" data += "C - comment selected nodes\n" data += "Ctrl+Shift+ArrowLeft - Align left\n" data += "Ctrl+Shift+ArrowUp - Align Up\n" data += "Ctrl+Shift+ArrowRight - Align right\n" data += "Ctrl+Shift+ArrowBottom - Align Bottom\n" QMessageBox.information(self, "Shortcuts", data)
def qMsgBoxInformation(parentWidg, titleMsgBx, messageMsgBx): qmsgParent = None if(parentWidg is not None): qmsgParent = parentWidg reply = QMessageBox.Ok try: reply = QMessageBox.information(qmsgParent, titleMsgBx, messageMsgBx) except: parentScreen = QtGui.QApplication.desktop().screen(QtGui.QApplication.desktop().primaryScreen()) qmsgParent = QtGui.QMainWindow(parentScreen) reply = QMessageBox.information(qmsgParent, titleMsgBx, messageMsgBx) return reply
def show_info(parent, title, info): """ Show a info QMessageBox with the given info :return: """ return QMessageBox.information(parent, title, info)
def shortcuts_info(self): data = "Ctrl+Shift+N - togle node box\n" data += "Ctrl+N - new file\n" data += "Ctrl+S - save\n" data += "Ctrl+Shift+S - save as\n" data += "Ctrl+O - open file\n" data += "Ctrl+F - frame\n" data += "C - comment selected nodes\n" data += "Delete - kill selected nodes\n" data += "Ctrl+Shift+ArrowLeft - Align left\n" data += "Ctrl+Shift+ArrowUp - Align Up\n" data += "Ctrl+Shift+ArrowRight - Align right\n" data += "Ctrl+Shift+ArrowBottom - Align Bottom\n" QMessageBox.information(self, "Shortcuts", data)
def displayError(self, socketError): if socketError == QTcpSocket.RemoteHostClosedError: return QMessageBox.information( self, self.tr("Network error"), self.tr( "The following error occurred: {}.".format(self.tcpClient.errorString()) ), ) self.tcpClient.close() self.tcpServer.close() self.clientProgressBar.reset() self.serverProgressBar.reset() self.clientStatusLabel.setText(self.tr("Client ready")) self.serverStatusLabel.setText(self.tr("Server ready")) self.startButton.setEnabled(True) QGuiApplication.restoreOverrideCursor()
def displayError(self, socketError): if socketError == QLocalSocket.ServerNotFoundError: QMessageBox.information( self, self.tr("Local Fortune Client"), self.tr( "The host was not found. Please make sure " "that the server is running and that the " "server name is correct." ), ) elif socketError == QLocalSocket.ConnectionRefusedError: QMessageBox.information( self, self.tr("Local Fortune Client"), self.tr( "The connection was refused by the peer. " "Make sure the fortune server is running, " "and check that the server name is correct." ), ) elif socketError == QLocalSocket.PeerClosedError: return else: QMessageBox.information( self, self.tr("Local Fortune Client"), self.tr( "The following error occurred: %s." % (self.socket.errorString()) ), ) self.getFortuneButton.setEnabled(True)
def shortcuts_info(self): data = "Tab - togle node box\n" data += "Ctrl+N - new file\n" data += "Ctrl+S - save\n" data += "Ctrl+Shift+S - save as\n" data += "Ctrl+O - open file\n" data += "F - frame selected\n" data += "H - frame all\n" data += "C - comment selected nodes\n" data += "Delete - kill selected nodes\n" data += "Ctrl+C - Copy\n" data += "Ctrl+V - Paste\n" data += "Alt+Drag - Duplicate\n" data += "Ctrl+Z - Undo\n" data += "Ctrl+Y - Redo\n" data += "Alt+Click - Disconnect Pin\n" data += "Ctrl+Shift+ArrowLeft - Align left\n" data += "Ctrl+Shift+ArrowUp - Align Up\n" data += "Ctrl+Shift+ArrowRight - Align right\n" data += "Ctrl+Shift+ArrowBottom - Align Bottom\n" QMessageBox.information(self, "Shortcuts", data)