From 3ec3e4f53a458eba307081e7e75590065984870b Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 4 Mar 2010 15:42:50 +0000 Subject: [PATCH] added Copy link as html format git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2482 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/SharedFilesDialog.cpp | 30 ++++++++++++++------ retroshare-gui/src/gui/SharedFilesDialog.h | 2 ++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index 1b74ec1d3..482608051 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -290,7 +290,6 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote) QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(analyzer.getRetroShareLink ()); - //QMessageBox::warning(this, tr("RetroShare"), analyzer.getKommuteLink (), QMessageBox::Ok); } void SharedFilesDialog::copyLinkRemote() @@ -305,6 +304,17 @@ void SharedFilesDialog::copyLinkLocal() copyLink (lst, false); } +void SharedFilesDialog::copyLinkhtml( ) +{ + copyLinkLocal (); + + QString link = QApplication::clipboard()->text(); + + QClipboard *clipboard = QApplication::clipboard(); + clipboard->setText(" " + link + ""); + +} + void SharedFilesDialog::sendremoteLinkTo() { copyLinkRemote (); @@ -324,7 +334,7 @@ void SharedFilesDialog::sendremoteLinkTo() nMsgDialog->show(); } -void SharedFilesDialog::sendLinkTo( /*std::string rsid*/ ) +void SharedFilesDialog::sendLinkTo() { copyLinkLocal (); @@ -653,22 +663,25 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point ) } //#endif - copylinklocalAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this ); + copylinklocalAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this ); connect( copylinklocalAct , SIGNAL( triggered() ), this, SLOT( copyLinkLocal() ) ); + + copylinklocalhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this ); + connect( copylinklocalhtmlAct , SIGNAL( triggered() ), this, SLOT( copyLinkhtml() ) ); - sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), this ); + sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links" ), this ); connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) ); - sendhtmllinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link (html)" ), this ); + sendhtmllinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links (HTML)" ), this ); connect( sendhtmllinkAct , SIGNAL( triggered() ), this, SLOT( sendHtmlLinkTo( ) ) ); - sendchatlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link to Chat" ), this ); + sendchatlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links to Chat" ), this ); connect( sendchatlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinktoChat( ) ) ); - sendlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link to Cloud" ), this ); + sendlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links to Cloud" ), this ); connect( sendlinkCloudAct , SIGNAL( triggered() ), this, SLOT( sendLinkToCloud( ) ) ); - addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Link to Cloud" ), this ); + addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Links to Cloud" ), this ); connect( addlinkCloudAct , SIGNAL( triggered() ), this, SLOT( addLinkToCloud( ) ) ); openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this); @@ -691,6 +704,7 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point ) if(!localModel->isDir( midx ) ) { contextMnu2.addAction( copylinklocalAct); + contextMnu2.addAction( copylinklocalhtmlAct); contextMnu2.addAction( sendlinkAct); contextMnu2.addAction( sendhtmllinkAct); contextMnu2.addAction( sendchatlinkAct); diff --git a/retroshare-gui/src/gui/SharedFilesDialog.h b/retroshare-gui/src/gui/SharedFilesDialog.h index b7933f298..d5e669fd3 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.h +++ b/retroshare-gui/src/gui/SharedFilesDialog.h @@ -64,6 +64,7 @@ private slots: void copyLinkRemote(); void copyLinkLocal(); + void copyLinkhtml(); void sendLinkTo(); void sendremoteLinkTo(); void sendHtmlLinkTo(); @@ -116,6 +117,7 @@ private: QAction* sendlinkCloudAct; QAction* addlinkCloudAct; QAction* sendchatlinkAct; + QAction* copylinklocalhtmlAct; QTreeView *shareddirtreeview; QMovie *movie;