Ejemplo n.º 1
0
Toy* Toys::AddToy(Toy::EnumToyType type)
{
	Toy *toy = Toy::Create(type, m_pClient, /*parent*/0, GetWindowFlags());
	if( toy )
	{
		connect(toy, SIGNAL(recvWidgetsChanged()), this, SLOT(onRecvWidgetsChanged()));
		connect(toy, SIGNAL(closing(Toy*)), this, SLOT(onToyClosing(Toy*)));
		connect(toy, SIGNAL(changed()), this, SLOT(onToyChanged()));
		connect(toy, SIGNAL(toggleMainWindow()), this, SLOT(onToyToggledMainWindow()));
		if(m_Opacity != 100)
			toy->setWindowOpacity(m_Opacity * 0.01);
		m_List.push_back(toy);

		if( !m_Loading )
		{
			toy->showNormal();
			BuildRecvWidgetsTable();
			toy->raise();
		}

		emit changed();
	}

	return toy;
}