ProfileNewDlg::ProfileNewDlg(QWidget *parent)
:QDialog(parent)
{
	setupUi(this);
	setModal(true);
	setWindowTitle(CAP(caption()));

	bg_defAct->setButton(bg_defAct->id((Q3Button *)rb_chat));
	le_name->setFocus();

	connect(pb_create, SIGNAL(clicked()), SLOT(slotCreate()));
	connect(pb_close, SIGNAL(clicked()), SLOT(reject()));
	connect(le_name, SIGNAL(textChanged(const QString &)), SLOT(nameModified()));

	nameModified();
}
示例#2
0
ProfileNewDlg::ProfileNewDlg(QWidget *parent)
:QDialog(parent)
{
	setupUi(this);
	setModal(true);
	setWindowTitle(CAP(windowTitle()));

	buttonGroup_ = new QButtonGroup(this);
	buttonGroup_->addButton(rb_message, 0);
	buttonGroup_->addButton(rb_chat, 1);
	rb_chat->setChecked(true);

	le_name->setFocus();

	connect(pb_create, SIGNAL(clicked()), SLOT(slotCreate()));
	connect(pb_close, SIGNAL(clicked()), SLOT(reject()));
	connect(le_name, SIGNAL(textChanged(const QString &)), SLOT(nameModified()));

	nameModified();
}
示例#3
0
void
FormDeviserClass::initializeFrom(DeviserClass* element)
{
  mElement = element;

  mbInitializing = true;

  ui->txtBaseClass->clear();
  ui->txtDeclaration->clear();
  ui->txtImplementation->clear();
  ui->txtListOfClassName->clear();
  ui->txtListOfName->clear();
  ui->txtMaxNumChildren->clear();
  ui->txtMinNumChildren->clear();
  ui->txtName->clear();
  ui->txtTypeCode->clear();
  ui->txtXMLElementName->clear();

  ui->chkHasListOf->setChecked(false);
  ui->ctrlListOf->setVisible(false);
  ui->grpListOfAttributes->setVisible(false);

  ui->chkRequiresAdditionalCode->setChecked(false);
  ui->grpAdditional->setVisible(false);

  ui->chkIsBaseClass->setChecked(false);
  ui->grpInstantiations->setVisible(false);


  ui->tblAttributes->setModel(NULL);
  if (mpAttributesFilter != NULL)
    mpAttributesFilter->deleteLater();
  if (mpAttributes != NULL)
    mpAttributes->deleteLater();

  ui->tblLoAttributes->setModel(NULL);
  if (mpLoAttributesFilter != NULL)
    mpLoAttributesFilter->deleteLater();
  if (mpLoAttributes != NULL)
    mpLoAttributes->deleteLater();

  ui->tblInstantiations->setModel(NULL);
  if (mpConcretesFilter != NULL)
    mpConcretesFilter->deleteLater();
  if (mpConcretes!= NULL)
    mpConcretes->deleteLater();


  if (mElement != NULL)
  {
    ui->txtName->setText(element->getName());
    nameModified(element->getName());
    ui->txtBaseClass->setText(element->getBaseClass());

    const QString& typeCode = element->getTypeCode();
    const QString defaultTypeCode = element->getDefaultTypeCode();
    bool haveDefault = typeCode.isEmpty() || (typeCode == defaultTypeCode);
    ui->txtTypeCode->setText(element->getTypeCode());
    typeCodeModified(element->getTypeCode());
    ui->chkUseDefault->setChecked(true);

    ui->stackTypeCode->setCurrentIndex( haveDefault ? 1 : 0);

    ui->txtXMLElementName->setText(element->getElementName());

    ui->chkHasListOf->setChecked(
          element->hasListOf() ||
          !element->getListOfAttributes().empty() ||
          !element->getListOfName().isEmpty() ||
          !element->getListOfClassName().isEmpty() ||
          element->getMaxNumberChildren() != 0
        );
    ui->ctrlListOf->setVisible(ui->chkHasListOf->isChecked());
    ui->grpListOfAttributes->setVisible(ui->chkHasListOf->isChecked());

    ui->txtListOfName->setText(element->getListOfName());
    ui->txtListOfClassName->setText(element->getListOfClassName());
    if (element->getMinNumberChildren() != 1)
    ui->txtMinNumChildren->setText(QString::number(element->getMinNumberChildren()));
    if (element->getMaxNumberChildren() != 0)
    ui->txtMaxNumChildren->setText(QString::number(element->getMaxNumberChildren()));

    ui->txtDeclaration->setText(element->getAdditionalDeclarations());
    ui->txtImplementation->setText(element->getAdditionalDefinitions());
    ui->chkRequiresAdditionalCode->setChecked(!element->getAdditionalDeclarations().isEmpty() || !element->getAdditionalDefinitions().isEmpty());
    ui->grpAdditional->setVisible(ui->chkRequiresAdditionalCode->isChecked());

    ui->chkIsBaseClass->setChecked(element->isBaseClass() || !element->getConcretes().empty() );
    ui->grpInstantiations->setVisible(ui->chkIsBaseClass->isChecked());

    mpAttributesFilter = new QSortFilterProxyModel(this);
    mpAttributes = new AttributesModel(this, &element->getAttributes());
    mpAttributesFilter->setSourceModel(mpAttributes);
    ui->tblAttributes->setModel(mpAttributesFilter);

    mpLoAttributesFilter = new QSortFilterProxyModel(this);
    mpLoAttributes = new LoAttributesModel(this, &element->getListOfAttributes());
    mpLoAttributesFilter->setSourceModel(mpLoAttributes);
    ui->tblLoAttributes->setModel(mpLoAttributesFilter);

    mpConcretesFilter = new QSortFilterProxyModel(this);
    mpConcretes = new ConcretesModel(this, &element->getConcretes());
    mpConcretesFilter->setSourceModel(mpConcretes);
    ui->tblInstantiations->setModel(mpConcretesFilter);

  }

  mbInitializing = false;
}