def add_variable(self):
        """Add Equation to Equation Database"""
        dlg = VariableDialog(var=self.var, my_conn=self.my_conn, parent=self)

        if dlg.exec_():
            print('Inserted')
            self.var.set_records_for_parent()
示例#2
0
 def __on_add_clicked(self):
     self.edit_index = None
     parent = self.details_parent or QtGui.QDialog()
     self.new_dlg = VariableDialog(parent)
     new_var = HalVar('', '')
     new_var.type = 'text'
     self.new_dlg.setModel(new_var)
     self.new_dlg.show()
     self.new_dlg.accepted.connect(self.__on_add_accepted)
     self.new_dlg.rejected.connect(self.__on_add_rejected)
示例#3
0
    def __on_variable_edit(self):
        self.edit_index = self.lv_items.currentIndex()
        obj = self.data_model.data(self.edit_index, QtCore.Qt.EditRole)
        parent = self.details_parent or QtGui.QDialog()
        self.new_dlg = VariableDialog(parent)
        if not isinstance(parent, QtGui.QDialog):
            parent.children()[0].addWidget(self.new_dlg)

        self.new_dlg.setModel(obj)
        self.new_dlg.show()
        self.new_dlg.accepted.connect(self.__on_add_accepted)
        self.new_dlg.rejected.connect(self.__on_add_rejected)