//Edit role constructor
addShowDialog::addShowDialog(MovieModel *movieModel, HallModel *hallModel, int showID, QDateTime dateTime, double price,
                           QString lang, bool DDD, bool subs, int movieID, int hallID, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::addShowDialog)
{
    ui->setupUi(this);

    role = Edit;

    this->showID = showID;

    this->movieModel = movieModel;
    this->hallModel = hallModel;

    //set combo boxes
    initComboBoxes(movieModel->getRowByPrimaryKeyValue(movieID), hallModel->getRowByPrimaryKeyValue(hallID));

    //Date
    ui->calendarWidget->setSelectedDate(dateTime.date());

    //Time
    ui->timeEdit->setTime(dateTime.time());

    //3D
    if(DDD)
        ui->DDDYesRB->setChecked(true);
    else
        ui->DDDNoRB->setChecked(true);

    //Subs
    if(subs)
        ui->subYesRB->setChecked(true);
    else
        ui->subNoRB->setChecked(true);

    //Language
    ui->languageCBB->setCurrentText(lang);

    //Price
    ui->priceSpinBox->setValue(price);

}
//Add show constructor
addShowDialog::addShowDialog(MovieModel *movieModel, HallModel *hallModel, int selMovieIndex, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::addShowDialog)
{
    ui->setupUi(this);

    role = Add;

    this->movieModel = movieModel;
    this->hallModel = hallModel;

    if(selMovieIndex < 0)
        selMovieIndex = 0;

    initComboBoxes(selMovieIndex, 0);

    //init radiobuttons (DDD = 3D...)
    ui->DDDNoRB->setChecked(true);
    ui->subNoRB->setChecked(true);
}
Exemple #3
0
void
userDialog_t::initWidget(QString& type)
{
	m_vlayout			= new QVBoxLayout(this);
	m_group				= new QGroupBox(this);
	m_buttons			= new QDialogButtonBox(this);
	m_glayout			= new QGridLayout(m_group);
	m_userLabel			= new QLabel(m_group);
	m_domainLabel		= new QLabel(m_group);
	m_username			= new QLineEdit(m_group);
	m_domain			= new QComboBox(m_group);
	m_passwordLabel		= new QLabel(m_group);
	m_algorithmLabel	= new QLabel(m_group);
	m_password			= new QLineEdit(m_group);
	m_algorithm			= new QComboBox(m_group);
	m_show				= new QCheckBox(m_group);
	m_realLabel			= new QLabel(m_group);
	m_phoneLabel		= new QLabel(m_group);
	m_name				= new QLineEdit(m_group);
	m_phone				= new QLineEdit(m_group);
	m_emailLabel		= new QLabel(m_group);
	m_streetLabel		= new QLabel(m_group);
	m_email				= new QLineEdit(m_group);
	m_street			= new QLineEdit(m_group);
	m_cityLabel			= new QLabel(m_group);
	m_stateLabel		= new QLabel(m_group);
	m_city				= new QLineEdit(m_group);
	m_state				= new QLineEdit(m_group);
	m_countryLabel		= new QLabel(m_group);
	m_postalLabel		= new QLabel(m_group);
	m_country			= new QLineEdit(m_group);
	m_postal			= new QLineEdit(m_group);

	resize(475, 345);

	m_glayout->addWidget(m_userLabel,			0, 0, 1, 1);
	m_glayout->addWidget(m_domainLabel,			0, 1, 1, 1);

	m_glayout->addWidget(m_username,			1, 0, 1, 1);
	m_glayout->addWidget(m_domain,				1, 1, 1, 1);
	
	m_glayout->addWidget(m_passwordLabel,		2, 0, 1, 1);
	m_glayout->addWidget(m_algorithmLabel,		2, 1, 1, 1);

	m_glayout->addWidget(m_password,			3, 0, 1, 1);
	m_glayout->addWidget(m_algorithm,			3, 1, 1, 1);
	m_glayout->addWidget(m_show,				3, 2, 1, 1);

	m_glayout->addWidget(m_realLabel,			4, 0, 1, 1);
	m_glayout->addWidget(m_phoneLabel,			4, 1, 1, 1);

	m_glayout->addWidget(m_name,				5, 0, 1, 1);
	m_glayout->addWidget(m_phone,				5, 1, 1, 2);

	m_glayout->addWidget(m_emailLabel,			6, 0, 1, 1);
	m_glayout->addWidget(m_streetLabel,			6, 1, 1, 1);

	m_glayout->addWidget(m_email,				7, 0, 1, 1);
	m_glayout->addWidget(m_street,				7, 1, 1, 2);

	m_glayout->addWidget(m_cityLabel,			8, 0, 1, 1);
	m_glayout->addWidget(m_stateLabel,			8, 1, 1, 1);

	m_glayout->addWidget(m_city,				9, 0, 1, 1);
	m_glayout->addWidget(m_state,				9, 1, 1, 2);

	m_glayout->addWidget(m_countryLabel,		10, 0, 1, 1);
	m_glayout->addWidget(m_postalLabel,			10, 1, 1, 1);

	m_glayout->addWidget(m_country,				11, 0, 1, 1);
	m_glayout->addWidget(m_postal,				11, 1, 1, 2);

	m_vlayout->addWidget(m_group);

	m_buttons->setOrientation(Qt::Horizontal);
	m_buttons->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);

	m_vlayout->addWidget(m_buttons);

	this->setWindowTitle(type);
	m_group->setTitle(type);

	m_userLabel->setText("Username");
	m_domainLabel->setText("Domain");
	m_passwordLabel->setText("Password");
	m_algorithmLabel->setText("Algorithm");
	m_show->setText("Show Password?");
	m_realLabel->setText("Real Name");
	m_phoneLabel->setText("Phone Number");
	m_emailLabel->setText("Email Address");
	m_streetLabel->setText("Street Address");
	m_cityLabel->setText("City");
	m_stateLabel->setText("State / Province");
	m_countryLabel->setText("Country");
	m_postalLabel->setText("Postal Code");

	initComboBoxes();

	m_show->setChecked(true);
	m_password->setEchoMode(QLineEdit::EchoMode::Normal);

	return;
}