示例#1
0
 def triggerOneToMany(self):  #invoke one to many relationship dialog
     if (project.getEntityCount()):  #if object count > 0
         if (project.getEntityCount() > 1):
             if (self._currentEntitySelected !=
                     None):  #entity must be selected
                 others = [
                 ]  #these are other entities excluding the currently selected entity
                 for i in project.getEntityNames():
                     if (i != self._currentEntitySelected):
                         others.append(i)
                 msg = QVariant(
                     dialogs.oneToManyDialog.format(
                         self._currentEntitySelected, others))
                 QMetaObject.invokeMethod(
                     self.object, "oneToManyDialog",
                     Q_ARG(QVariant,
                           msg))  #invoke one to one relationship dialog
             else:
                 QMetaObject.invokeMethod(
                     self.object, "selectToCreateRelationshipErr"
                 )  #invoked if no object is selected
         else:
             QMetaObject.invokeMethod(
                 self.object,
                 "notEnoughObjectsError")  #invoked if object count is <= 1
     else:
         QMetaObject.invokeMethod(
             self.object,
             "noObjectExists")  #invoke noObjectExists javascript function
示例#2
0
 def triggerAtrributeRename(
         self, row):  #invoked when user wants to rename attribute
     if (project.getEntityCount()):  #if object count > 0
         if (self._currentEntitySelected != None):  #entity must be selected
             if (
                     row == -1
             ):  #if no row is selected --Row is the currentRow in table view
                 QMetaObject.invokeMethod(
                     self.object, "selectAttributeToRenameError"
                 )  #invoked if no attribute is selected --Error
             else:
                 msg = QVariant(row)  #pass properties view current row
                 attributeName = QVariant()
                 attributeName = QMetaObject.invokeMethod(
                     self.object, "getCurrentProperty",
                     Q_RETURN_ARG(QVariant),
                     Q_ARG(QVariant, msg))  #get attribute name
                 msg = QVariant(
                     dialogs.renamePropertyDialog.format(
                         attributeName, row)
                 )  #pass entity names to rename objects dialog combobox
                 QMetaObject.invokeMethod(
                     self.object, "renamePropertyDialog",
                     Q_ARG(QVariant, msg))  #invoke the rename window
         else:
             QMetaObject.invokeMethod(self.object, "selectObjectErrorRename"
                                      )  #invoked if no object is selected
     else:
         QMetaObject.invokeMethod(
             self.object,
             "noObjectExists")  #invoke noObjectExists javascript function
示例#3
0
    def triggerAtrributeDelete(
            self, row):  #invoked when user wants to delete attribute
        if (project.getEntityCount()):  #if object count > 0
            if (self._currentEntitySelected != None):
                if (
                        row == -1
                ):  #if no row is selected --Row is the currentRow in table view
                    QMetaObject.invokeMethod(
                        self.object, "selectAttributeError"
                    )  #invoked if no attribute is selected --Error
                else:
                    msg = QVariant(row)  #pass properties view current row
                    attributeName = QVariant()
                    attributeName = QMetaObject.invokeMethod(
                        self.object, "getCurrentProperty",
                        Q_RETURN_ARG(QVariant),
                        Q_ARG(QVariant, msg))  #get attribute name
                    attributeId = project.getAttributeIdThroughName(
                        self._currentEntitySelected, attributeName)
                    edit = project.EditAttribute(attributeId)
                    edit.delete()
                    QMetaObject.invokeMethod(self.object,
                                             "removePropertiesModel",
                                             Q_ARG(QVariant, msg))

            else:
                QMetaObject.invokeMethod(
                    self.object,
                    "selectObjectError")  #invoked if no object is selected
        else:
            QMetaObject.invokeMethod(
                self.object,
                "noObjectExists")  #invoke noObjectExists javascript function
示例#4
0
 def triggerVisualizeEntity(self):
     if (project.getEntityCount()):  #if object count > 0
         msg = QVariant(
             dialogs.visualizeEntityDialog.format(project.getEntityNames())
         )  #pass entity names to delete objects dialog combobox
         QMetaObject.invokeMethod(self.object, "visualizeObjectDialog",
                                  Q_ARG(QVariant,
                                        msg))  #invoke the delete window
     else:
         QMetaObject.invokeMethod(
             self.object,
             "noObjectExists")  #invoke noObjectExists javascript function
示例#5
0
 def triggerObjectRename(
         self):  #this slot is called when user wants to rename object
     if (project.getEntityCount()):  #if object count > 0
         msg = QVariant(
             dialogs.renameEntityDialog.format(project.getEntityNames())
         )  #pass entity names to rename objects dialog combobox
         QMetaObject.invokeMethod(self.object, "renameObjectDialog",
                                  Q_ARG(QVariant,
                                        msg))  #invoke the rename window
     else:
         QMetaObject.invokeMethod(
             self.object,
             "noObjectExists")  #invoke noObjectExists javascript function
示例#6
0
 def triggerNewFloatProperty(
         self):  #this function invokes the FLOAT property DIALOG
     if (project.getEntityCount()):  #if object count > 0
         msg = QVariant(
             dialogs.new_floatPropertyDialog.format(
                 project.getEntityNames())
         )  #pass entity names to new_stringPropertyDialog dialog combobox
         QMetaObject.invokeMethod(
             self.object, "newPropertyDialog", Q_ARG(QVariant, msg)
         )  #invoke the newPropertyDialog function--Javascript function
     else:
         QMetaObject.invokeMethod(
             self.object, "noObjectExists"
         )  #invoke noObjectxists function --Javascript function
示例#7
0
 def triggerNewBooleanProperty(
     self
 ):  #invoke create BOOLEAN property DIALOG --invoke JAVASCRIPT FUNCTION
     if (project.getEntityCount()):  #if object count > 0
         msg = QVariant(
             dialogs.new_booleanPropertyDialog.format(
                 project.getEntityNames())
         )  #pass entity names to new_booleanPropertyDialog dialog combobox
         QMetaObject.invokeMethod(self.object, "newPropertyDialog",
                                  Q_ARG(QVariant,
                                        msg))  #invoke newPropertyDialog
     else:
         QMetaObject.invokeMethod(
             self.object, "noObjectExists"
         )  #invoke noObjectxists function --Javascript function