mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 23:36:59 -05:00
Removed buttons to create a new identity
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7789 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
810a5cacc0
commit
417f66a566
@ -258,38 +258,6 @@
|
||||
<item>
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_NewId">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create new Identity</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New ID</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/identity/identity_create_32.png</normaloff>:/images/identity/identity_create_32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "ui_PostedCreatePostDialog.h"
|
||||
|
||||
#include "util/TokenQueue.h"
|
||||
#include "gui/Identity/IdDialog.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -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());
|
||||
}
|
||||
|
@ -47,7 +47,6 @@ public:
|
||||
|
||||
private slots:
|
||||
void createPost();
|
||||
void createNewGxsId();
|
||||
|
||||
private:
|
||||
QString mLink;
|
||||
|
@ -171,38 +171,6 @@
|
||||
<item>
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_NewId">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create new Identity</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New ID</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/identity/identity_create_32.png</normaloff>:/images/identity/identity_create_32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
#include "PostedCreatePostDialog.h"
|
||||
#include "PostedItem.h"
|
||||
#include "gui/Identity/IdDialog.h"
|
||||
#include "gui/common/UIStateHelper.h"
|
||||
|
||||
#include <retroshare/rsposted.h>
|
||||
@ -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()) {
|
||||
|
@ -67,7 +67,6 @@ protected:
|
||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
||||
|
||||
private slots:
|
||||
void createNewGxsId();
|
||||
void newPost();
|
||||
|
||||
void submitVote(const RsGxsGrpMsgIdPair& msgId, bool up);
|
||||
|
@ -175,38 +175,6 @@
|
||||
<item>
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_NewId">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create new Identity</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New ID</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/identity/identity_create_32.png</normaloff>:/images/identity/identity_create_32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
#include "gui/gxs/GxsCommentDialog.h"
|
||||
#include "ui_GxsCommentDialog.h"
|
||||
#include "gui/Identity/IdDialog.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
@ -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());
|
||||
}
|
||||
|
@ -47,7 +47,6 @@ public:
|
||||
private slots:
|
||||
void refresh();
|
||||
void voterSelectionChanged( int index );
|
||||
void createNewGxsId();
|
||||
|
||||
private:
|
||||
RsGxsGroupId mGrpId;
|
||||
|
@ -102,38 +102,6 @@
|
||||
<item>
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_NewId">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create new Identity</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New ID</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/images/identity/identity_create_32.png</normaloff>:/images/identity/identity_create_32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshButton">
|
||||
<property name="text">
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
#include "GxsCreateCommentDialog.h"
|
||||
#include "ui_GxsCreateCommentDialog.h"
|
||||
#include "gui/Identity/IdDialog.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <iostream>
|
||||
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -26,65 +26,37 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="6">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="subjectLabel">
|
||||
<property name="text">
|
||||
<string>Signed by</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="commentTextEdit"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="subjectLabel">
|
||||
<property name="text">
|
||||
<string>Signed by</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QToolButton" name="toolButton_NewId">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create new Identity</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New ID</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/identity/identity_create_32.png</normaloff>:/images/identity/identity_create_32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -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 <algorithm>
|
||||
@ -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();
|
||||
|
@ -154,7 +154,6 @@ private:
|
||||
void newGroup();
|
||||
void init();
|
||||
void initMode();
|
||||
void createNewGxsId();
|
||||
|
||||
// Functions that can be overloaded for specific stuff.
|
||||
|
||||
|
@ -145,38 +145,6 @@
|
||||
<item>
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_NewId">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create new Identity</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New ID</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/identity/identity_create_32.png</normaloff>:/images/identity/identity_create_32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="pubKeyShare_cb">
|
||||
<property name="toolTip">
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -45,7 +45,6 @@ private slots:
|
||||
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||
/* actions to take.... */
|
||||
void createMsg();
|
||||
void createNewGxsId();
|
||||
|
||||
void smileyWidgetForums();
|
||||
void addSmileys();
|
||||
|
@ -185,46 +185,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="GxsIdChooser" name="idChooser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_NewId">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create new Identity</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New ID</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/identity/identity_create_32.png</normaloff>:/images/identity/identity_create_32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user