mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-07 05:38:09 -05:00
restored the copy link location feature on transfers.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@2668 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4333d9ecb9
commit
3c3d459e28
@ -228,10 +228,9 @@ TransfersDialog::TransfersDialog(QWidget *parent)
|
|||||||
clearcompletedAct = new QAction(QIcon(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this );
|
clearcompletedAct = new QAction(QIcon(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this );
|
||||||
connect( clearcompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) );
|
connect( clearcompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) );
|
||||||
|
|
||||||
#ifndef RS_RELEASE_VERSION
|
|
||||||
copylinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
|
copylinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
|
||||||
connect( copylinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
connect( copylinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
||||||
#endif
|
|
||||||
pastelinkAct = new QAction(QIcon(IMAGE_PASTELINK), tr( "Paste retroshare Link" ), this );
|
pastelinkAct = new QAction(QIcon(IMAGE_PASTELINK), tr( "Paste retroshare Link" ), this );
|
||||||
connect( pastelinkAct , SIGNAL( triggered() ), this, SLOT( pasteLink() ) );
|
connect( pastelinkAct , SIGNAL( triggered() ), this, SLOT( pasteLink() ) );
|
||||||
queueDownAct = new QAction(QIcon(":/images/go-down.png"), tr("Down"), this);
|
queueDownAct = new QAction(QIcon(":/images/go-down.png"), tr("Down"), this);
|
||||||
@ -368,14 +367,14 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
|||||||
contextMnu.addAction( pauseAct);
|
contextMnu.addAction( pauseAct);
|
||||||
if(!all_downld)
|
if(!all_downld)
|
||||||
contextMnu.addAction( resumeAct);
|
contextMnu.addAction( resumeAct);
|
||||||
|
|
||||||
if(single)
|
if(single)
|
||||||
{
|
{
|
||||||
if(info.downloadStatus == FT_STATE_PAUSED)
|
if(info.downloadStatus == FT_STATE_PAUSED)
|
||||||
contextMnu.addAction( resumeAct);
|
contextMnu.addAction( resumeAct);
|
||||||
else if(info.downloadStatus != FT_STATE_COMPLETE)
|
else if(info.downloadStatus != FT_STATE_COMPLETE)
|
||||||
contextMnu.addAction( pauseAct);
|
contextMnu.addAction( pauseAct);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(info.downloadStatus != FT_STATE_COMPLETE)
|
if(info.downloadStatus != FT_STATE_COMPLETE)
|
||||||
contextMnu.addAction( cancelAct);
|
contextMnu.addAction( cancelAct);
|
||||||
@ -399,10 +398,10 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
|||||||
|
|
||||||
contextMnu.addAction( clearcompletedAct);
|
contextMnu.addAction( clearcompletedAct);
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
#ifndef RS_RELEASE_VERSION
|
|
||||||
if(single)
|
if(!items.empty())
|
||||||
contextMnu.addAction( copylinkAct);
|
contextMnu.addAction( copylinkAct);
|
||||||
#endif
|
|
||||||
if(!RSLinkClipboard::empty())
|
if(!RSLinkClipboard::empty())
|
||||||
contextMnu.addAction( pastelinkAct);
|
contextMnu.addAction( pastelinkAct);
|
||||||
|
|
||||||
@ -912,6 +911,7 @@ void TransfersDialog::cancel()
|
|||||||
void TransfersDialog::copyLink ()
|
void TransfersDialog::copyLink ()
|
||||||
{
|
{
|
||||||
QModelIndexList lst = ui.downloadList->selectionModel ()->selectedIndexes ();
|
QModelIndexList lst = ui.downloadList->selectionModel ()->selectedIndexes ();
|
||||||
|
std::vector<RetroShareLink> links ;
|
||||||
|
|
||||||
for (int i = 0; i < lst.count (); i++)
|
for (int i = 0; i < lst.count (); i++)
|
||||||
if ( lst[i].column() == 0 )
|
if ( lst[i].column() == 0 )
|
||||||
@ -921,11 +921,10 @@ void TransfersDialog::copyLink ()
|
|||||||
qulonglong fsize= ind.model ()->data (ind.model ()->index (ind.row (), SIZE)).toULongLong() ;
|
qulonglong fsize= ind.model ()->data (ind.model ()->index (ind.row (), SIZE)).toULongLong() ;
|
||||||
QString fname= ind.model ()->data (ind.model ()->index (ind.row (), NAME)).toString() ;
|
QString fname= ind.model ()->data (ind.model ()->index (ind.row (), NAME)).toString() ;
|
||||||
|
|
||||||
RetroShareLink link(fname, fsize, fhash);
|
RetroShareLink link(fname, uint64_t(fsize), fhash);
|
||||||
|
links.push_back(link) ;
|
||||||
QApplication::clipboard()->setText(link.toString());
|
|
||||||
break ;
|
|
||||||
}
|
}
|
||||||
|
RSLinkClipboard::copyLinks(links) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransfersDialog::showDetailsDialog()
|
void TransfersDialog::showDetailsDialog()
|
||||||
|
Loading…
Reference in New Issue
Block a user