diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui index 0444c1b81..377d00c90 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui @@ -258,38 +258,6 @@ - - - - - 0 - 0 - - - - Qt::NoFocus - - - Create new Identity - - - New ID - - - - :/images/identity/identity_create_32.png:/images/identity/identity_create_32.png - - - - 24 - 24 - - - - true - - - diff --git a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp index f62ed378f..369bb4f3d 100644 --- a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp @@ -26,7 +26,6 @@ #include "ui_PostedCreatePostDialog.h" #include "util/TokenQueue.h" -#include "gui/Identity/IdDialog.h" #include @@ -39,7 +38,6 @@ PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *pos connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost())); connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); - connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(createNewGxsId())); ui->headerFrame->setHeaderImage(QPixmap(":/images/posted_64.png")); ui->headerFrame->setHeaderText(tr("Submit a new Post")); @@ -58,20 +56,20 @@ PostedCreatePostDialog::~PostedCreatePostDialog() void PostedCreatePostDialog::createPost() { RsGxsId authorId; - switch (ui->idChooser->getChosenId(authorId)) { - case GxsIdChooser::KnowId: - case GxsIdChooser::UnKnowId: - break; - case GxsIdChooser::NoId: - case GxsIdChooser::None: - default: + switch (ui->idChooser->getChosenId(authorId)) { + case GxsIdChooser::KnowId: + case GxsIdChooser::UnKnowId: + break; + case GxsIdChooser::NoId: + case GxsIdChooser::None: + default: std::cerr << "PostedCreatePostDialog::createPost() ERROR GETTING AuthorId!, Post Failed"; std::cerr << std::endl; QMessageBox::warning(this, tr("RetroShare"),tr("Please create or choose a Signing Id first"), QMessageBox::Ok, QMessageBox::Ok); return; - }//switch (ui->idChooser->getChosenId(authorId)) + }//switch (ui->idChooser->getChosenId(authorId)) RsPostedPost post; post.mMeta.mGroupId = mGrpId; @@ -84,7 +82,7 @@ void PostedCreatePostDialog::createPost() /* error message */ QMessageBox::warning(this, "RetroShare", tr("Please add a Title"), QMessageBox::Ok, QMessageBox::Ok); return; //Don't add a empty title!! - }//if(ui->titleEdit->text().isEmpty()) + }//if(ui->titleEdit->text().isEmpty()) uint32_t token; mPosted->createPost(token, post); @@ -92,11 +90,3 @@ void PostedCreatePostDialog::createPost() accept(); } - -void PostedCreatePostDialog::createNewGxsId() -{ - IdEditDialog dlg(this); - dlg.setupNewId(false); - dlg.exec(); - ui->idChooser->setDefaultId(dlg.getLastIdName()); -} diff --git a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h index af0e5e0c6..d4a7bc49c 100644 --- a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h +++ b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h @@ -47,7 +47,6 @@ public: private slots: void createPost(); - void createNewGxsId(); private: QString mLink; diff --git a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui index d3343d184..aca174f1c 100644 --- a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui +++ b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui @@ -171,38 +171,6 @@ - - - - - 0 - 0 - - - - Qt::NoFocus - - - Create new Identity - - - New ID - - - - :/images/identity/identity_create_32.png:/images/identity/identity_create_32.png - - - - 24 - 24 - - - - true - - - diff --git a/retroshare-gui/src/gui/Posted/PostedListWidget.cpp b/retroshare-gui/src/gui/Posted/PostedListWidget.cpp index ece03a63c..6fcf4b440 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidget.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidget.cpp @@ -28,7 +28,6 @@ #include "PostedCreatePostDialog.h" #include "PostedItem.h" -#include "gui/Identity/IdDialog.h" #include "gui/common/UIStateHelper.h" #include @@ -63,8 +62,6 @@ PostedListWidget::PostedListWidget(const RsGxsGroupId &postedId, QWidget *parent connect(ui->prevButton, SIGNAL(clicked()), this, SLOT(showPrev())); connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool))); - connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(createNewGxsId())); - // default sort method. mSortMethod = RsPosted::HotRankType; mLastSortMethod = RsPosted::TopRankType; // to be different. @@ -273,14 +270,6 @@ void PostedListWidget::submitVote(const RsGxsGrpMsgIdPair &msgId, bool up) mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, mTokenTypeVote); } -void PostedListWidget::createNewGxsId() -{ - IdEditDialog dlg(this); - dlg.setupNewId(false); - dlg.exec(); - ui->idChooser->setDefaultId(dlg.getLastIdName()); -} - void PostedListWidget::subscribeGroup(bool subscribe) { if (groupId().isNull()) { diff --git a/retroshare-gui/src/gui/Posted/PostedListWidget.h b/retroshare-gui/src/gui/Posted/PostedListWidget.h index a17d6014e..a82e87d05 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidget.h +++ b/retroshare-gui/src/gui/Posted/PostedListWidget.h @@ -67,7 +67,6 @@ protected: virtual bool navigatePostItem(const RsGxsMessageId& msgId); private slots: - void createNewGxsId(); void newPost(); void submitVote(const RsGxsGrpMsgIdPair& msgId, bool up); diff --git a/retroshare-gui/src/gui/Posted/PostedListWidget.ui b/retroshare-gui/src/gui/Posted/PostedListWidget.ui index 59c7808d1..a565255e8 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidget.ui +++ b/retroshare-gui/src/gui/Posted/PostedListWidget.ui @@ -175,38 +175,6 @@ - - - - - 0 - 0 - - - - Qt::NoFocus - - - Create new Identity - - - New ID - - - - :/images/identity/identity_create_32.png:/images/identity/identity_create_32.png - - - - 24 - 24 - - - - true - - - diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp index 242d444f3..39e1fe046 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp @@ -23,7 +23,6 @@ #include "gui/gxs/GxsCommentDialog.h" #include "ui_GxsCommentDialog.h" -#include "gui/Identity/IdDialog.h" #include #include @@ -48,7 +47,6 @@ GxsCommentDialog::GxsCommentDialog(QWidget *parent, RsTokenService *token_servic connect(ui->refreshButton, SIGNAL(clicked()), this, SLOT(refresh())); connect(ui->idChooser, SIGNAL(currentIndexChanged( int )), this, SLOT(voterSelectionChanged( int ))); - connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(createNewGxsId())); /* force voterId through - first time */ voterSelectionChanged( 0 ); @@ -143,11 +141,3 @@ void GxsCommentDialog::setCommentHeader(QWidget *header) ui->notesBrowser->setPlainText(QString::fromStdString(mCurrentPost.mNotes)); #endif } - -void GxsCommentDialog::createNewGxsId() -{ - IdEditDialog dlg(this); - dlg.setupNewId(false); - dlg.exec(); - ui->idChooser->setDefaultId(dlg.getLastIdName()); -} diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h index 3c76567f1..53f83464f 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h @@ -47,7 +47,6 @@ public: private slots: void refresh(); void voterSelectionChanged( int index ); - void createNewGxsId(); private: RsGxsGroupId mGrpId; diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.ui b/retroshare-gui/src/gui/gxs/GxsCommentDialog.ui index 0a7298e7b..8b91fc8ca 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.ui +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.ui @@ -102,38 +102,6 @@ - - - - - 0 - 0 - - - - Qt::NoFocus - - - Create new Identity - - - New ID - - - - :/images/identity/identity_create_32.png:/images/identity/identity_create_32.png - - - - 24 - 24 - - - - true - - - diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp index ae405519a..dea3deb7e 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp @@ -24,7 +24,6 @@ #include "GxsCreateCommentDialog.h" #include "ui_GxsCreateCommentDialog.h" -#include "gui/Identity/IdDialog.h" #include #include @@ -36,7 +35,6 @@ GxsCreateCommentDialog::GxsCreateCommentDialog(TokenQueue *tokQ, RsGxsCommentSer { ui->setupUi(this); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(createComment())); - connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(createNewGxsId())); /* fill in the available OwnIds for signing */ ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, RsGxsId()); @@ -60,17 +58,17 @@ void GxsCreateCommentDialog::createComment() RsGxsId authorId; - switch (ui->idChooser->getChosenId(authorId)) { - case GxsIdChooser::KnowId: - case GxsIdChooser::UnKnowId: + switch (ui->idChooser->getChosenId(authorId)) { + case GxsIdChooser::KnowId: + case GxsIdChooser::UnKnowId: comment.mMeta.mAuthorId = authorId; std::cerr << "AuthorId : " << comment.mMeta.mAuthorId << std::endl; std::cerr << std::endl; - - break; - case GxsIdChooser::NoId: - case GxsIdChooser::None: - default: + + break; + case GxsIdChooser::NoId: + case GxsIdChooser::None: + default: std::cerr << "GxsCreateCommentDialog::createComment() ERROR GETTING AuthorId!"; std::cerr << std::endl; @@ -78,9 +76,9 @@ void GxsCreateCommentDialog::createComment() tr("You need to create an Identity\n" "before you can comment"), QMessageBox::Ok); - Q_UNUSED(ret) + Q_UNUSED(ret) return; - }//switch (ui->idChooser->getChosenId(authorId)) + }//switch (ui->idChooser->getChosenId(authorId)) uint32_t token; mCommentService->createComment(token, comment); @@ -88,14 +86,6 @@ void GxsCreateCommentDialog::createComment() close(); } -void GxsCreateCommentDialog::createNewGxsId() -{ - IdEditDialog dlg(this); - dlg.setupNewId(false); - dlg.exec(); - ui->idChooser->setDefaultId(dlg.getLastIdName()); -} - GxsCreateCommentDialog::~GxsCreateCommentDialog() { delete ui; diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h index 32de8ae59..2c0100f50 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h @@ -38,13 +38,11 @@ class GxsCreateCommentDialog : public QDialog public: explicit GxsCreateCommentDialog(TokenQueue* tokQ, RsGxsCommentService *service, - const RsGxsGrpMsgIdPair& parentId, const RsGxsMessageId& threadId, QWidget *parent = 0); + const RsGxsGrpMsgIdPair& parentId, const RsGxsMessageId& threadId, QWidget *parent = 0); ~GxsCreateCommentDialog(); private slots: - void createComment(); - void createNewGxsId(); private: Ui::GxsCreateCommentDialog *ui; diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.ui b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.ui index e73a89142..374949716 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.ui +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.ui @@ -26,65 +26,37 @@ p, li { white-space: pre-wrap; } - - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Signed by + + + + + + + + + - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Signed by - - - - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - Create new Identity - - - New ID - - - - :/images/identity/identity_create_32.png:/images/identity/identity_create_32.png - - - - 24 - 24 - - - - true - - - diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp index c5c0135c2..a9f93584a 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp @@ -26,7 +26,6 @@ #include "util/misc.h" #include "GxsGroupDialog.h" #include "gui/common/PeerDefs.h" -#include "gui/Identity/IdDialog.h" #include "retroshare/rsgxsflags.h" #include @@ -93,8 +92,6 @@ void GxsGroupDialog::init() connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(cancelDialog())); connect(ui.pubKeyShare_cb, SIGNAL(clicked()), this, SLOT(setShareList())); - connect(ui.toolButton_NewId, SIGNAL(clicked()), this, SLOT(createNewGxsId())); - connect(ui.groupLogo, SIGNAL(clicked() ), this , SLOT(addGroupLogo())); connect(ui.addLogoButton, SIGNAL(clicked() ), this , SLOT(addGroupLogo())); @@ -189,14 +186,6 @@ void GxsGroupDialog::initMode() } } -void GxsGroupDialog::createNewGxsId() -{ - IdEditDialog dlg(this); - dlg.setupNewId(false); - dlg.exec(); - ui.idChooser->setDefaultId(dlg.getLastIdName()); -} - void GxsGroupDialog::clearForm() { ui.groupName->clear(); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h index ebd2c30c3..ab93a2038 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h @@ -154,7 +154,6 @@ private: void newGroup(); void init(); void initMode(); - void createNewGxsId(); // Functions that can be overloaded for specific stuff. diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.ui b/retroshare-gui/src/gui/gxs/GxsGroupDialog.ui index 02a7036c1..1d0a4ff93 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.ui +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.ui @@ -145,38 +145,6 @@ - - - - - 0 - 0 - - - - Qt::NoFocus - - - Create new Identity - - - New ID - - - - :/images/identity/identity_create_32.png:/images/identity/identity_create_32.png - - - - 24 - 24 - - - - true - - - diff --git a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp index e6bda5c61..3f488d5ec 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp @@ -53,6 +53,9 @@ GxsIdChooser::GxsIdChooser(QWidget *parent) mBase = new RsGxsUpdateBroadcastBase(rsIdentity, this); connect(mBase, SIGNAL(fillDisplay(bool)), this, SLOT(fillDisplay(bool))); + /* Initialize ui */ + setSizeAdjustPolicy(QComboBox::AdjustToContents); + mIdQueue = NULL; mFirstLoad = true; @@ -172,15 +175,6 @@ void GxsIdChooser::loadPrivateIds(uint32_t token) setItemData(count() - 1, QString("%1_%2").arg(TYPE_NO_ID).arg(str), ROLE_SORT); setItemData(count() - 1, TYPE_NO_ID, ROLE_TYPE); } - if (!(mFlags & IDCHOOSER_NO_CREATE)) { - /* add Create Identity option */ - QString str = tr("Create new Identity"); - QString id = ""; - - addItem(str, id); - setItemData(count() - 1, QString("%1_%2").arg(TYPE_CREATE_ID).arg(str), ROLE_SORT); - setItemData(count() - 1, TYPE_CREATE_ID, ROLE_TYPE); - } } else { for (int idx = 0; idx < count(); ++idx) { QVariant type = itemData(idx, ROLE_TYPE); @@ -203,9 +197,8 @@ void GxsIdChooser::loadPrivateIds(uint32_t token) } } - mFirstLoad = false; - if (ids.empty()) { + mFirstLoad = false; std::cerr << "GxsIdChooser::loadPrivateIds() ERROR no ids"; std::cerr << std::endl; return; @@ -216,6 +209,20 @@ void GxsIdChooser::loadPrivateIds(uint32_t token) GxsIdDetails::process(*it, loadPrivateIdsCallback, this); } + if (mFirstLoad) { + if (!(mFlags & IDCHOOSER_NO_CREATE)) { + /* add Create Identity option */ + QString str = tr("Create new Identity"); + QString id = ""; + + addItem(str, id); + setItemData(count() - 1, QString("%1_%2").arg(TYPE_CREATE_ID).arg(str), ROLE_SORT); + setItemData(count() - 1, TYPE_CREATE_ID, ROLE_TYPE); + } + } + + mFirstLoad = false; + setDefaultItem(); } @@ -226,8 +233,10 @@ void GxsIdChooser::setDefaultItem() if ((mFlags & IDCHOOSER_ANON_DEFAULT) && !(mFlags & IDCHOOSER_ID_REQUIRED)) { def = findData(TYPE_NO_ID, ROLE_TYPE); } else { - QString id = QString::fromStdString(mDefaultId.toStdString()); - def = findData(id); + if (!mDefaultId.isNull()) { + QString id = QString::fromStdString(mDefaultId.toStdString()); + def = findData(id); + } } if (def >= 0) { @@ -293,7 +302,7 @@ void GxsIdChooser::indexActivated(int index) IdEditDialog dlg(this); dlg.setupNewId(false); dlg.exec(); -// ui.idChooser->setDefaultId(dlg.getLastIdName()); + setDefaultId(dlg.getLastIdName()); } } diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp index 6d02938a4..e98d99fba 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp @@ -33,7 +33,6 @@ #include "gui/RetroShareLink.h" #include "gui/common/Emoticons.h" #include "gui/common/UIStateHelper.h" -#include "gui/Identity/IdDialog.h" #include "util/HandleRichText.h" #include "util/misc.h" @@ -90,7 +89,6 @@ CreateGxsForumMsg::CreateGxsForumMsg(const RsGxsGroupId &fId, const RsGxsMessage connect(ui.emoticonButton, SIGNAL(clicked()), this, SLOT(smileyWidgetForums())); connect(ui.attachFileButton, SIGNAL(clicked()), this, SLOT(addFile())); connect(ui.generateCheckBox, SIGNAL(toggled(bool)), ui.generateSpinBox, SLOT(setEnabled(bool))); - connect(ui.toolButton_NewId, SIGNAL(clicked()), this, SLOT(createNewGxsId())); setAcceptDrops(true); ui.hashBox->setDropWidget(this); @@ -337,14 +335,6 @@ void CreateGxsForumMsg::createMsg() close(); } -void CreateGxsForumMsg::createNewGxsId() -{ - IdEditDialog dlg(this); - dlg.setupNewId(false); - dlg.exec(); - ui.idChooser->setDefaultId(dlg.getLastIdName()); -} - void CreateGxsForumMsg::closeEvent (QCloseEvent * /*event*/) { Settings->saveWidgetInformation(this); diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.h b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.h index e752178f7..2447e02ba 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.h +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.h @@ -45,7 +45,6 @@ private slots: void fileHashingFinished(QList hashedFiles); /* actions to take.... */ void createMsg(); - void createNewGxsId(); void smileyWidgetForums(); void addSmileys(); diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui index 6b5405d20..0b95b8742 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui @@ -185,46 +185,7 @@ - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - Create new Identity - - - New ID - - - - :/images/identity/identity_create_32.png:/images/identity/identity_create_32.png - - - - 24 - 24 - - - - true - - +