void OBSBasicSourceSelect::on_buttonBox_accepted()
{
	bool useExisting = ui->selectExisting->isChecked();
	bool visible = ui->sourceVisible->isChecked();

	if (useExisting) {
		QListWidgetItem *item = ui->sourceList->currentItem();
		if (!item)
			return;

		AddExisting(QT_TO_UTF8(item->text()), visible, false);
	} else {
		if (ui->sourceName->text().isEmpty()) {
			OBSMessageBox::warning(this,
					QTStr("NoNameEntered.Title"),
					QTStr("NoNameEntered.Text"));
			return;
		}

		if (!AddNew(this, id, QT_TO_UTF8(ui->sourceName->text()),
					visible, newSource))
			return;
	}

	done(DialogCode::Accepted);
}
Exemplo n.º 2
0
CUnknown* CUnknowns::Add(char* szClassName)
{
	CUnknown*			pcUnknown;

	if ((szClassName == NULL) || (szClassName[0] == 0))
	{
		gcLogger.Error2(__METHOD__, " No constructor found for class with empty name.", NULL);
		return NULL;
	}

	pcUnknown = (CUnknown*)mpcConstructors->Construct(szClassName, &mcAlloc);
	if (pcUnknown)
	{
		pcUnknown = AddExisting(pcUnknown);
		return pcUnknown;
	}
	else
	{
		gcLogger.Error2(__METHOD__, " No constructor found for class [", szClassName, "].", NULL);
		return NULL;	
	}
}
void OBSBasicSourceSelect::on_buttonBox_accepted()
{
	bool useExisting = ui->selectExisting->isChecked();

	if (useExisting) {
		QListWidgetItem *item = ui->sourceList->currentItem();
		if (!item)
			return;

		AddExisting(QT_TO_UTF8(item->text()));
	} else {
		if (ui->sourceName->text().isEmpty()) {
			QMessageBox::information(this,
					QTStr("NoNameEntered"),
					QTStr("NoNameEntered"));
			return;
		}

		if (!AddNew(this, id, QT_TO_UTF8(ui->sourceName->text())))
			return;
	}

	done(DialogCode::Accepted);
}
void OBSBasicSourceSelect::SourcePaste(const char *name, bool visible, bool dup)
{
	AddExisting(name, visible, dup);
}
Exemplo n.º 5
0
void LogicCollection::Add( const std::string& p_name, entityid p_id )
{
    Logic* l = LogicDB.generate( p_name, p_id );
    AddExisting( l );
}