mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-18 12:24:22 -05:00
added Past rs links from Button, and fixed not allow send blank Forum Messages
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2397 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4ed969a4cd
commit
451ede6fde
@ -61,7 +61,7 @@ CreateForumMsg::CreateForumMsg(std::string fId, std::string pId)
|
|||||||
connect( ui.close_action, SIGNAL( triggered (bool) ), this, SLOT( cancelMsg( ) ) );
|
connect( ui.close_action, SIGNAL( triggered (bool) ), this, SLOT( cancelMsg( ) ) );
|
||||||
connect( ui.emoticonButton, SIGNAL(clicked()), this, SLOT(smileyWidgetForums()));
|
connect( ui.emoticonButton, SIGNAL(clicked()), this, SLOT(smileyWidgetForums()));
|
||||||
connect( ui.attachFileButton, SIGNAL(clicked() ), this , SLOT(addFile()));
|
connect( ui.attachFileButton, SIGNAL(clicked() ), this , SLOT(addFile()));
|
||||||
|
connect( ui.pastersButton, SIGNAL(clicked() ), this , SLOT(pasteLink()));
|
||||||
|
|
||||||
newMsg();
|
newMsg();
|
||||||
|
|
||||||
@ -131,6 +131,14 @@ void CreateForumMsg::createMsg()
|
|||||||
{
|
{
|
||||||
QString name = ui.forumSubject->text();
|
QString name = ui.forumSubject->text();
|
||||||
QString desc = ui.forumMessage->toHtml();
|
QString desc = ui.forumMessage->toHtml();
|
||||||
|
|
||||||
|
if(name.isEmpty())
|
||||||
|
{ /* error message */
|
||||||
|
QMessageBox::warning(this, tr("RetroShare"),tr("Please set a Forum Subject and Forum Message"),
|
||||||
|
QMessageBox::Ok, QMessageBox::Ok);
|
||||||
|
|
||||||
|
return; //Don't add a empty Subject!!
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ForumMsgInfo msgInfo;
|
ForumMsgInfo msgInfo;
|
||||||
@ -376,4 +384,23 @@ void CreateForumMsg::fileHashingFinished(AttachFileItem* file) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CreateForumMsg::pasteLink()
|
||||||
|
{
|
||||||
|
|
||||||
|
QString link = QApplication::clipboard()->text();
|
||||||
|
|
||||||
|
if (link.startsWith("retroshare://", Qt::CaseInsensitive))
|
||||||
|
{
|
||||||
|
ui.forumMessage->setHtml("<a href='" + link + "'> " + link + "</a>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("RetroShare"),tr("Clipboard does not contains RetroShare link('s)"),
|
||||||
|
QMessageBox::Ok, QMessageBox::Ok);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,8 @@ private slots:
|
|||||||
/* actions to take.... */
|
/* actions to take.... */
|
||||||
void createMsg();
|
void createMsg();
|
||||||
void cancelMsg();
|
void cancelMsg();
|
||||||
|
void pasteLink();
|
||||||
|
|
||||||
|
|
||||||
void smileyWidgetForums();
|
void smileyWidgetForums();
|
||||||
void addSmileys();
|
void addSmileys();
|
||||||
|
@ -175,6 +175,20 @@ border: 1px solid #CCCCCC;}</string>
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pastersButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Paste retroshare link</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../images.qrc">
|
||||||
|
<normaloff>:/images/copyrslink.png</normaloff>:/images/copyrslink.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user