MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / addAnotherUser

Method addAnotherUser

nixnote.cpp:3045–3060  ·  view source on GitHub ↗

Add another user account.

Source from the content-addressed store, hash-verified

3043//* Add another user account.
3044//*********************************************************************
3045void 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//*********************************************************************

Callers

nothing calls this directly

Calls 6

addIdMethod · 0.80
setDataMethod · 0.80
addUserAccountMethod · 0.80
execMethod · 0.45
toStringMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected