Added a new page for user request to ConnectFriendWizard.

The page is shown instead of the conclusion page when the user clicks on the certificate link in a message of type user request.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5432 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-08-16 10:20:34 +00:00
parent aedac9738a
commit 21e97a47df
8 changed files with 325 additions and 82 deletions

View file

@ -124,10 +124,12 @@ MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WFlags flags)
isControlled = controlled;
isWindow = false;
currMsgFlags = 0;
connect(ui.msgList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(msgfilelistWidgetCostumPopupMenu(QPoint)));
connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended()));
connect(ui.msgText, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl)));
connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged()));
connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged()));
@ -452,6 +454,8 @@ void MessageWidget::fill(const std::string &msgId)
clearTagLabels();
currMsgFlags = 0;
return;
}
@ -562,6 +566,8 @@ void MessageWidget::fill(const std::string &msgId)
ui.filesText->setText(QString("(%1 %2)").arg(msgInfo.count).arg(msgInfo.count == 1 ? tr("File") : tr("Files")));
showTagLabels();
currMsgFlags = msgInfo.msgflags;
}
void MessageWidget::remove()
@ -690,3 +696,20 @@ void MessageWidget::forward()
/* window will destroy itself! */
}
void MessageWidget::anchorClicked(const QUrl &url)
{
RetroShareLink link(url);
if (link.valid() == false) {
return;
}
if (link.type() == RetroShareLink::TYPE_CERTIFICATE && currMsgFlags & RS_MSG_USER_REQUEST) {
link.setSubType(RSLINK_SUBTYPE_CERTIFICATE_USER_REQUEST);
}
QList<RetroShareLink> links;
links.append(link);
RetroShareLink::process(links);
}

View file

@ -76,6 +76,8 @@ private slots:
void getcurrentrecommended();
void getallrecommended();
void anchorClicked(const QUrl &url);
private:
void clearTagLabels();
void showTagLabels();
@ -83,6 +85,7 @@ private:
bool isControlled;
bool isWindow;
std::string currMsgId;
unsigned int currMsgFlags;
QList<QLabel*> tagLabels;

View file

@ -39,13 +39,16 @@
<widget class="QWidget" name="layoutWidget">
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="LinkTextBrowser" name="msgText">
<widget class="QTextBrowser" name="msgText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
@ -475,13 +478,6 @@ p, li { white-space: pre-wrap; }
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>LinkTextBrowser</class>
<extends>QTextBrowser</extends>
<header>gui/common/LinkTextBrowser.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
</resources>