Esempio n. 1
0
//-----------------------------------------------------------------------------
// Function: FileNameEditor::refresh()
//-----------------------------------------------------------------------------
void FileNameEditor::refresh()
{
    fileNameLabel_.setText(file_->getName());

    disconnect(&descriptionEditor_, SIGNAL(textChanged()), this, SLOT(onDescriptionChanged()));

    descriptionEditor_.setPlainText(file_->getDescription());

    connect(&descriptionEditor_, SIGNAL(textChanged()), this, SLOT(onDescriptionChanged()), Qt::UniqueConnection);
}
Esempio n. 2
0
void NameGroupEditor::refresh() {
	nameEdit_.setText(nameGroup_.name());
	displayNameEdit_.setText(nameGroup_.displayName());
	
	disconnect(&descriptionEdit_, SIGNAL(textChanged()),
		this, SLOT(onDescriptionChanged()));
	descriptionEdit_.setPlainText(nameGroup_.description());
	connect(&descriptionEdit_, SIGNAL(textChanged()),
		this, SLOT(onDescriptionChanged()), Qt::UniqueConnection);
}
Esempio n. 3
0
//-----------------------------------------------------------------------------
// Function: BusDefGroup::BusDefGroup()
//-----------------------------------------------------------------------------
BusDefGroup::BusDefGroup(QWidget *parent):
    QGroupBox(tr("General (Bus Definition)"), parent),
    busDef_(),
    directConnection_(tr("Allow direct master-slave connection"), this),
    isAddressable_(tr("Addressable bus"), this),
    maxMasters_(this),
    maxSlaves_(this),
    descriptionEditor_(this)
{
    QRegExp regExp(QString("[0-9]*"), Qt::CaseInsensitive, QRegExp::W3CXmlSchema11);
    QRegExpValidator* validator = new QRegExpValidator(regExp, this);
    maxMasters_.setValidator(validator);
    maxSlaves_.setValidator(validator);

    maxMasters_.setPlaceholderText(tr("unbound"));
    maxSlaves_.setPlaceholderText(tr("unbound"));

    setupLayout();

    connect(&maxMasters_, SIGNAL(editingFinished()), this, SLOT(onMastersChanged()), Qt::UniqueConnection);
    connect(&maxSlaves_, SIGNAL(editingFinished()),	this, SLOT(onSlavesChanged()), Qt::UniqueConnection);

    connect(&directConnection_, SIGNAL(toggled(bool)),
            this, SLOT(onDirectConnectionChanged(bool)), Qt::UniqueConnection);
    connect(&isAddressable_, SIGNAL(toggled(bool)),
            this, SLOT(onIsAddressableChanged(bool)), Qt::UniqueConnection);

    connect(&descriptionEditor_, SIGNAL(textChanged()), this, SLOT(onDescriptionChanged()), Qt::UniqueConnection);
}
medPluginGeneratorMainWindow::medPluginGeneratorMainWindow(QWidget *parent) : QMainWindow(parent)
{
    this->d = new medPluginGeneratorMainWindowPrivate;
    this->d->ui.setupUi(this);
    QSettings settings;

    QDir plugins_dir = qApp->applicationDirPath() + ".";

    d->output = settings.value("path", plugins_dir.absolutePath()).toString();
    d->ui.pathLineEdit->setText(d->output);

    d->ui.descriptionTextEdit->setAcceptRichText(false);

    connect(d->ui.pathToolButton, SIGNAL(clicked()), this, SLOT(onOutputPathClicked()));
    connect(d->ui.pathLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(onOutputPathChanged()));
    connect(d->ui.pluginTypeCombo, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(onPluginTypeChanged()));
    connect(d->ui.nameLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(onNameChanged()));
    connect(d->ui.descriptionTextEdit, SIGNAL(textChanged()), this, SLOT(onDescriptionChanged()));
    connect(d->ui.pluginLicenseCombo, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(onPluginLicenseChanged()));
    connect(d->ui.FamilyCombo, SIGNAL(currentIndexChanged(const int&)), this, SLOT(onFamilyChanged(int)));
    connect(d->ui.generateAction,    SIGNAL(triggered()), this, SLOT(generate()));
    connect(d->ui.quitAction,        SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(d->ui.aboutAction,       SIGNAL(triggered()), this, SLOT(about()));
    connect(d->ui.actionDefault_Path,SIGNAL(triggered()), this,
            SLOT(onSetDefaultPath()));

    connect(d->ui.quitButton,        SIGNAL(clicked()), qApp, SLOT(quit()));
    connect(d->ui.generateButton,    SIGNAL(clicked()), this, SLOT(generate()));

    Q_UNUSED(statusBar());
}
Esempio n. 5
0
FormFeedDetails::FormFeedDetails(ServiceRoot *service_root, QWidget *parent)
  : QDialog(parent),
    m_editableFeed(nullptr),
    m_serviceRoot(service_root) {
  initialize();
  createConnections();

  // Initialize that shit.
  onTitleChanged(QString());
  onDescriptionChanged(QString());
  onUrlChanged(QString());
  onUsernameChanged(QString());
  onPasswordChanged(QString());
}
Esempio n. 6
0
NameGroupEditor::NameGroupEditor( NameGroup& nameGroup,
								 QWidget *parent,
								 const QString& title /*= QString("Names")*/ ):
QGroupBox(title, parent),
nameGroup_(nameGroup),
nameEdit_(this),
displayNameEdit_(this),
descriptionEdit_(this) {

	// set the maximum height and width for this widget
	setMaximumHeight(NameGroupEditor::MAX_EDITOR_HEIGHT);

	// the layout manager for this widget
	QGridLayout* layout = new QGridLayout(this);

	QLabel* nameLabel = new QLabel(tr("Name:"), this);
	layout->addWidget(nameLabel, 0, 0, 1, 1);

	nameEdit_.setToolTip(tr("Set the name for the element"));
	nameEdit_.setProperty("mandatoryField", true);

	NameValidator* validator = new NameValidator(&nameEdit_);
	nameEdit_.setValidator(validator);
	layout->addWidget(&nameEdit_, 0, 1, 1, 1);

	QLabel* displayLabel = new QLabel(tr("Display Name:"), this);
	layout->addWidget(displayLabel, 1, 0, 1, 1);

	displayNameEdit_.setToolTip(tr("Set the display name for the element"));
	layout->addWidget(&displayNameEdit_, 1, 1, 1, 1);

	QLabel* descriptionLabel = new QLabel(tr("Description:"), this);
    layout->addWidget(descriptionLabel, 2, 0, 1, 1, Qt::AlignTop);

	descriptionEdit_.setToolTip(tr("Set the description for the element"));
    layout->addWidget(&descriptionEdit_, 2, 1, 1, 1);

	connect(&nameEdit_, SIGNAL(textEdited(const QString&)),
		this, SLOT(onNameChanged(const QString&)), Qt::UniqueConnection);
    connect(&nameEdit_, SIGNAL(editingFinished()), this, SIGNAL(nameChanged()), Qt::UniqueConnection);
	connect(&displayNameEdit_, SIGNAL(textEdited(const QString&)),
		this, SLOT(onDisplayNameChanged(const QString&)), Qt::UniqueConnection);
	connect(&descriptionEdit_, SIGNAL(textChanged()),
		this, SLOT(onDescriptionChanged()), Qt::UniqueConnection);
}
Esempio n. 7
0
//-----------------------------------------------------------------------------
// Function: FileNameEditor::FileNameEditor()
//-----------------------------------------------------------------------------
FileNameEditor::FileNameEditor(QSharedPointer<File> file, QWidget* parent)
    : QGroupBox(tr("File name and path"), parent), 
      fileNameLabel_(file->getName(), this),
      descriptionEditor_(this),
      file_(file)
{
    setMaximumHeight(100);
    
    QLabel* nameLabel = new QLabel(tr("Name:"), this);
    nameLabel->setToolTip(tr("The name field contains an absolute or relative\n"
        "path to a file name or directory"));

    QLabel* descriptionLabel = new QLabel(tr("Description:"), this);

    descriptionEditor_.setToolTip("Set the description for the file");

    QGridLayout* topLayout = new QGridLayout(this);
    topLayout->addWidget(nameLabel, 0, 0, 1, 1);
    topLayout->addWidget(&fileNameLabel_, 0, 1, 1, 1);
    topLayout->addWidget(descriptionLabel, 1, 0, 1, 1, Qt::AlignTop);
    topLayout->addWidget(&descriptionEditor_, 1, 1, 1, 1);

    connect(&descriptionEditor_, SIGNAL(textChanged()), this, SLOT(onDescriptionChanged()), Qt::UniqueConnection);
}
Esempio n. 8
0
void FormFeedDetails::createConnections() {
  // General connections.
  connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(apply()));
  connect(m_ui->m_txtTitle->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onTitleChanged(QString)));
  connect(m_ui->m_txtDescription->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onDescriptionChanged(QString)));
  connect(m_ui->m_txtUrl->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onUrlChanged(QString)));
  connect(m_ui->m_txtUsername->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onUsernameChanged(QString)));
  connect(m_ui->m_txtPassword->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onPasswordChanged(QString)));
  connect(m_ui->m_gbAuthentication, SIGNAL(toggled(bool)), this, SLOT(onAuthenticationSwitched()));
  connect(m_ui->m_cmbAutoUpdateType, SIGNAL(currentIndexChanged(int)), this, SLOT(onAutoUpdateTypeChanged(int)));
  connect(m_ui->m_btnFetchMetadata, SIGNAL(clicked()), this, SLOT(guessFeed()));

  // Icon connections.
  connect(m_actionFetchIcon, SIGNAL(triggered()), this, SLOT(guessIconOnly()));
  connect(m_actionLoadIconFromFile, SIGNAL(triggered()), this, SLOT(onLoadIconFromFile()));
  connect(m_actionNoIcon, SIGNAL(triggered()), this, SLOT(onNoIconSelected()));
  connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon()));
}