Add another user account.
| 3043 | //* Add another user account. |
| 3044 | //********************************************************************* |
| 3045 | void NixNote::addAnotherUser() { |
| 3046 | AddUserAccountDialog dialog; |
| 3047 | dialog.exec(); |
| 3048 | if (!dialog.okPushed) |
| 3049 | return; |
| 3050 | QString name = dialog.newAccountName->text().trimmed(); |
| 3051 | int six = dialog.newAccountServer->currentIndex(); |
| 3052 | QString server = dialog.newAccountServer->itemData(six, Qt::UserRole).toString(); |
| 3053 | int newid = global.accountsManager->addId(-1, name, "", server); |
| 3054 | QAction *newAction = new QAction(menuBar); |
| 3055 | newAction->setText(tr("Switch to ") +name); |
| 3056 | newAction->setCheckable(true); |
| 3057 | newAction->setData(newid); |
| 3058 | menuBar->addUserAccount(newAction); |
| 3059 | connect(newAction, SIGNAL(triggered()), this, SLOT(switchUser())); |
| 3060 | } |
| 3061 | |
| 3062 | |
| 3063 | //********************************************************************* |