Пример #1
0
void Controller::setCurrentAlbum(const QString &_id)
{
    if(_id == "none")
    {
        m_pConfiguration->setCurrentAlbumFile(_id);
    }
    else if(m_listAlbums.find(_id) != m_listAlbums.end())
    {
        m_pCurrentAlbum = m_listAlbums[_id];
        m_pConfiguration->setCurrentAlbumFile(_id);
        emit currentAlbumChanged(m_pCurrentAlbum);
        emit currentIdChanged(_id);
    }
}
Пример #2
0
InstallApplicationWizardPrivate::choicePage::choicePage(QWidget *parent)
	: QWizardPage(parent)
{
	setTitle(tr("Select configuration"));
	setSubTitle(tr("Select the wine configuration that wine will use for the installation process."
			" The new application will be installed in this configuration."));

	QButtonGroup *group = new QButtonGroup(this);
	//### Radio buttons do not have word wrap so they need a \n every about 70 characters.
	QRadioButton *createRadio = new QRadioButton(tr("Create a new configuration"
			" (recommended if you\nwant to install a new windows application)"), this);
	QRadioButton *useRadio = new QRadioButton(tr("Use an existing configuration (use this if you want"
			" to install a\nsoftware patch, update, or an application that must cooperate with"
			"\nan already installed application, for example a plugin)"), this);

	group->addButton(createRadio);
	group->addButton(useRadio);
	createRadio->setChecked(true);

	QFrame *frame = new QFrame(this);
	QLabel *label = new QLabel(tr("Existing configuration to use:"), frame); //TODO validatePage() to check this!!
	ModelItemSelectComboBox *combo = new ModelItemSelectComboBox(ModelManager::ConfigurationsModel, frame);
	frame->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);

	QHBoxLayout *hlay = new QHBoxLayout(frame);
	hlay->addWidget(label);
	hlay->addWidget(combo);

	QVBoxLayout *vlay = new QVBoxLayout(this);
	vlay->addWidget(createRadio);
	vlay->addWidget(useRadio);
	vlay->addWidget(frame);

	frame->setEnabled(false);
	connect(useRadio, SIGNAL(toggled(bool)), frame, SLOT(setEnabled(bool)) );
	registerField("CreateNewConfiguration", createRadio, "checked", SIGNAL(toggled(bool)) );
	registerField("ConfigurationToUse", combo, "CurrentID", SIGNAL(currentIdChanged(quint16)) );
}