| 24 | extern Global global; |
| 25 | |
| 26 | AddUserAccountDialog::AddUserAccountDialog(QWidget *parent) : |
| 27 | QDialog(parent) |
| 28 | { |
| 29 | okPushed = false; |
| 30 | okButton = new QPushButton(this); |
| 31 | cancelButton = new QPushButton(this); |
| 32 | buttonLayout = new QHBoxLayout(); |
| 33 | mainLayout = new QVBoxLayout(); |
| 34 | labelLayout = new QGridLayout(); |
| 35 | newAccountLabel = new QLabel(); |
| 36 | newAccountServer = new QComboBox(); |
| 37 | newAccountServerLabel = new QLabel(); |
| 38 | newAccountServerLabel->setText(tr("Server")); |
| 39 | okButton->setText(tr("OK")); |
| 40 | okButton->setEnabled(false); |
| 41 | cancelButton->setText(tr("Cancel")); |
| 42 | connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked())); |
| 43 | connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked())); |
| 44 | setLayout(mainLayout); |
| 45 | |
| 46 | newAccountLabel = new QLabel(tr("Account Name")); |
| 47 | newAccountName = new QLineEdit(); |
| 48 | connect(newAccountName, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); |
| 49 | |
| 50 | labelLayout->addWidget(newAccountLabel,0,0); |
| 51 | labelLayout->addWidget(newAccountName, 0, 1); |
| 52 | labelLayout->addWidget(newAccountServerLabel, 1,0);; |
| 53 | labelLayout->addWidget(newAccountServer,1,1); |
| 54 | |
| 55 | QSpacerItem *spacer1 = new QSpacerItem(10,10,QSizePolicy::Maximum, QSizePolicy::Minimum); |
| 56 | QSpacerItem *spacer2= new QSpacerItem(10,10,QSizePolicy::Maximum, QSizePolicy::Minimum); |
| 57 | buttonLayout->addSpacerItem(spacer1); |
| 58 | buttonLayout->setStretch(0,100); |
| 59 | buttonLayout->setStretch(3,100); |
| 60 | buttonLayout->addWidget(okButton); |
| 61 | buttonLayout->addWidget(cancelButton); |
| 62 | buttonLayout->addSpacerItem(spacer2); |
| 63 | |
| 64 | mainLayout->addLayout(labelLayout); |
| 65 | mainLayout->addLayout(buttonLayout); |
| 66 | |
| 67 | accountNames = global.accountsManager->nameList(); |
| 68 | |
| 69 | newAccountServer->addItem(tr("Evernote"), "www.evernote.com"); |
| 70 | newAccountServer->addItem(tr("Yinxiang Biji"), "app.yinxiang.com"); |
| 71 | newAccountServer->addItem(tr("Evernote Sandbox"), "sandbox.evernote.com"); |
| 72 | this->setFont(global.getGuiFont(font())); |
| 73 | } |
| 74 | |
| 75 | |
| 76 |
nothing calls this directly
no test coverage detected