FactorySettingsPopUp::FactorySettingsPopUp(QWidget *parent): AbstractPopUpWidget(ConfirmMode::ACCEPT, tr("Restore Factory Settings"), parent) { connect(this, SIGNAL(confirm()), this, SLOT(onConfirm())); QGridLayout *mainLayout = new QGridLayout; mainLayout->addWidget(new QLabel(tr("Are you sure? Restoring to Factory Settings will delete all data.")), 0, 0, 1, 2, 0); setLayout(mainLayout); }
void ProfileEdit::keyDown(char key) { // BACKSPACE pressed if (key == GLV_KEY_BACKSPACE) { if (editText.length() > 0) editText.erase(editText.end()-1); } else // ENTER key pressed if (key == GLV_KEY_ENTER) { onConfirm(); } else // ESCAPE key if (key == GLV_KEY_ESCAPE) { onCancel(); } else // text edit key input if ( ('a'<=key && key<='z') || ('A'<=key && key<='Z') || ('0'<=key && key<='9') || key==GLV_KEY_SPACE ) { if (editText.length() < 23) editText += key; } };
ProductPopUp::ProductPopUp(QWidget *parent) : AbstractPopUpWidget(ConfirmMode::ACCEPT, tr("Create product"), parent), txtBxName(new TextLineEdit()), txtBxNumber(new TextLineEdit()), numBxTotalPercentage(new NumberLineEdit()) { txtBxName->setPlaceholderText(tr("Name")); txtBxNumber->setPlaceholderText(tr("Product Number")); numBxTotalPercentage->setPlaceholderText(tr("Total Percentage")); connect(this, SIGNAL(cancel()), this, SLOT(onClose())); connect(this, SIGNAL(confirm()), this, SLOT(onConfirm())); QGridLayout *mainLayout = new QGridLayout; mainLayout->setAlignment(Qt::AlignTop); mainLayout->addWidget(new QLabel(tr("Name:")), 0, 0, 1, 1, 0); mainLayout->addWidget(txtBxName, 0, 1, 1, 1, 0); mainLayout->addWidget(new QLabel(tr("Product Number:")), 1, 0, 1, 1, 0); mainLayout->addWidget(txtBxNumber, 1, 1, 1, 1, 0); mainLayout->addWidget(new QLabel(tr("Total Percentage:")), 2, 0, 1, 1, 0); mainLayout->addWidget(numBxTotalPercentage, 2, 1, 1, 1, 0); setLayout(mainLayout); }
KickMemberBox::KickMemberBox(PeerData *chat, UserData *member) : ConfirmBox(lng_profile_sure_kick(lt_user, member->firstName), lang(lng_box_remove)) , _chat(chat) , _member(member) { connect(this, SIGNAL(confirmed()), this, SLOT(onConfirm())); }
SharePhoneConfirmBox::SharePhoneConfirmBox(PeerData *recipient) : ConfirmBox(lang(lng_bot_share_phone), lang(lng_bot_share_phone_confirm)) , _recipient(recipient) { connect(this, SIGNAL(confirmed()), this, SLOT(onConfirm())); }
void GUIFloatField::inputConfirmed() { setText(applyRangeAndStep(mValue)); onConfirm(); }
void GUIVector2Field::inputConfirmed() { onConfirm(); }
void GUIIntField::inputConfirmed() { onConfirm(); }