Added a "add new link" button, for use the external popup dialog for add a link.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3745 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-11-03 23:28:17 +00:00
parent 0e41211f3c
commit 630b46cbfd
5 changed files with 35 additions and 2 deletions

View File

@ -48,7 +48,6 @@ AddLinksDialog::AddLinksDialog(QString url, QWidget *parent)
connect( ui.anonBox, SIGNAL( stateChanged ( int ) ), this, SLOT( load ( void ) ) );
ui.linkLineEdit->setReadOnly(true);
ui.linkLineEdit->setText(url);
RetroShareLink link(url);

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>614</width>
<height>429</height>
<height>415</height>
</rect>
</property>
<property name="windowTitle">

View File

@ -27,6 +27,7 @@
#include "LinksDialog.h"
#include "RetroShareLink.h"
#include "AddLinksDialog.h"
#include <retroshare/rspeers.h>
#include <retroshare/rsrank.h>
#include <retroshare/rsfiles.h>
@ -67,6 +68,8 @@ LinksDialog::LinksDialog(QWidget *parent)
/* add button */
connect( ui.addButton, SIGNAL( clicked( void ) ), this, SLOT( addLinkComment( void ) ) );
connect( ui.expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggleWindows( void ) ) );
connect( ui.pushButton, SIGNAL( clicked( ) ), this, SLOT( addNewLink( ) ) );
connect( ui.linkTreeWidget, SIGNAL( currentItemChanged ( QTreeWidgetItem *, QTreeWidgetItem * ) ),
this, SLOT( changedItem ( QTreeWidgetItem *, QTreeWidgetItem * ) ) );
@ -1043,3 +1046,13 @@ void LinksDialog::anchorClicked (const QUrl& link )
QDesktopServices::openUrl(QUrl(newAddress));
}
}
void LinksDialog::addNewLink()
{
AddLinksDialog *nAddLinksDialog = new AddLinksDialog("");
nAddLinksDialog->show();
/* window will destroy itself! */
}

View File

@ -66,6 +66,8 @@ private slots:
void checkUpdate();
void anchorClicked (const QUrl &);
void addNewLink();
private:

View File

@ -556,6 +556,25 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="pushButton">
<property name="styleSheet">
<string notr="true">QPushButton:hover {
border: 1px solid #CCCCCC;
}</string>
</property>
<property name="text">
<string>Add new link</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>