show new identity dialog when creating a forum post and no identities exist

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8334 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
electron128 2015-06-01 08:55:30 +00:00
parent 0eddd419f0
commit da722292f6

View File

@ -33,6 +33,7 @@
#include "gui/RetroShareLink.h"
#include "gui/common/Emoticons.h"
#include "gui/common/UIStateHelper.h"
#include "gui/Identity/IdEditDialog.h"
#include "util/HandleRichText.h"
#include "util/misc.h"
@ -294,12 +295,26 @@ void CreateGxsForumMsg::createMsg()
std::cerr << std::endl;
break;
case GxsIdChooser::None:
{
// This is ONLY for the case where no id exists yet
// If an id exists, the chooser would not return None
IdEditDialog dlg(this);
dlg.setupNewId(false);
dlg.exec();
// fetch new id, we will then see if the identity creation was successful
std::list<RsGxsId> own_ids;
if(!rsIdentity->getOwnIds(own_ids) || own_ids.size() != 1)
return;
// we have only a single id, so we can use the first one
authorId = own_ids.front();
break;
}
case GxsIdChooser::NoId:
case GxsIdChooser::None:
default:
std::cerr << "CreateGxsForumMsg::createMsg() ERROR GETTING AuthorId!";
std::cerr << std::endl;
QMessageBox::warning(this, tr("RetroShare"),tr("Please choose Signing Id"), QMessageBox::Ok, QMessageBox::Ok);
QMessageBox::warning(this, tr("RetroShare"),tr("Congrats, you found a bug! ")+QString(__FILE__)+":"+QString(__LINE__), QMessageBox::Ok, QMessageBox::Ok);
return;
}//switch (ui.idChooser->getChosenId(authorId))