mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-26 01:31:30 -05:00
* Disabled retroshare url links.
* Upgraded labels to v0.4.13b git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.4.x@1264 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9b6f009777
commit
272d15b748
@ -32,14 +32,9 @@
|
|||||||
#include "msgs/ChanMsgDialog.h"
|
#include "msgs/ChanMsgDialog.h"
|
||||||
#include "Preferences/rsharesettings.h"
|
#include "Preferences/rsharesettings.h"
|
||||||
|
|
||||||
#ifndef RETROSHARE_LINK_ANALYZER
|
|
||||||
#include "RetroShareLinkAnalyzer.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QContextMenuEvent>
|
#include <QContextMenuEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@ -64,8 +59,6 @@
|
|||||||
#define IMAGE_ATTACHMENT ":/images/attachment.png"
|
#define IMAGE_ATTACHMENT ":/images/attachment.png"
|
||||||
#define IMAGE_FRIEND ":/images/peers_16x16.png"
|
#define IMAGE_FRIEND ":/images/peers_16x16.png"
|
||||||
#define IMAGE_PROGRESS ":/images/browse-looking.gif"
|
#define IMAGE_PROGRESS ":/images/browse-looking.gif"
|
||||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
|
||||||
|
|
||||||
const QString Image_AddNewAssotiationForFile = ":/images/kcmsystem24.png";
|
const QString Image_AddNewAssotiationForFile = ":/images/kcmsystem24.png";
|
||||||
|
|
||||||
|
|
||||||
@ -200,21 +193,12 @@ void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point )
|
|||||||
downloadAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Download" ), this );
|
downloadAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Download" ), this );
|
||||||
connect( downloadAct , SIGNAL( triggered() ), this, SLOT( downloadRemoteSelected() ) );
|
connect( downloadAct , SIGNAL( triggered() ), this, SLOT( downloadRemoteSelected() ) );
|
||||||
|
|
||||||
copyremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
|
|
||||||
connect( copyremotelinkAct , SIGNAL( triggered() ), this, SLOT( copyLinkRemote() ) );
|
|
||||||
|
|
||||||
sendremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), this );
|
|
||||||
connect( sendremotelinkAct , SIGNAL( triggered() ), this, SLOT( sendremoteLinkTo( ) ) );
|
|
||||||
|
|
||||||
// addMsgAct = new QAction( tr( "Add to Message" ), this );
|
// addMsgAct = new QAction( tr( "Add to Message" ), this );
|
||||||
// connect( addMsgAct , SIGNAL( triggered() ), this, SLOT( addMsgRemoteSelected() ) );
|
// connect( addMsgAct , SIGNAL( triggered() ), this, SLOT( addMsgRemoteSelected() ) );
|
||||||
|
|
||||||
|
|
||||||
contextMnu.clear();
|
contextMnu.clear();
|
||||||
contextMnu.addAction( downloadAct);
|
contextMnu.addAction( downloadAct);
|
||||||
contextMnu.addSeparator();
|
|
||||||
contextMnu.addAction( copyremotelinkAct);
|
|
||||||
contextMnu.addAction( sendremotelinkAct);
|
|
||||||
// contextMnu.addAction( addMsgAct);
|
// contextMnu.addAction( addMsgAct);
|
||||||
contextMnu.exec( mevent->globalPos() );
|
contextMnu.exec( mevent->globalPos() );
|
||||||
}
|
}
|
||||||
@ -233,106 +217,6 @@ void SharedFilesDialog::downloadRemoteSelected()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
|
|
||||||
{
|
|
||||||
std::vector<DirDetails> dirVec;
|
|
||||||
|
|
||||||
if (remote)
|
|
||||||
model->getDirDetailsFromSelect(lst, dirVec);
|
|
||||||
else
|
|
||||||
localModel->getDirDetailsFromSelect(lst, dirVec);
|
|
||||||
|
|
||||||
RetroShareLinkAnalyzer analyzer;
|
|
||||||
|
|
||||||
for (int i = 0, n = dirVec.size(); i < n; ++i)
|
|
||||||
{
|
|
||||||
const DirDetails& details = dirVec[i];
|
|
||||||
|
|
||||||
if (details.type == DIR_TYPE_DIR)
|
|
||||||
{
|
|
||||||
for (std::list<DirStub>::const_iterator cit = details.children.begin();
|
|
||||||
cit != details.children.end(); ++cit)
|
|
||||||
{
|
|
||||||
const DirStub& dirStub = *cit;
|
|
||||||
|
|
||||||
DirDetails details;
|
|
||||||
uint32_t flags = DIR_FLAGS_DETAILS;
|
|
||||||
if (remote)
|
|
||||||
{
|
|
||||||
flags |= DIR_FLAGS_REMOTE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flags |= DIR_FLAGS_LOCAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// do not recursive copy sub dirs.
|
|
||||||
if (!rsFiles->RequestDirDetails(dirStub.ref, details, flags) || details.type != DIR_TYPE_FILE)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
analyzer.setRetroShareLink (details.name.c_str(), QString::number(details.count), details.hash.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
analyzer.setRetroShareLink (details.name.c_str(), QString::number(details.count), details.hash.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
QClipboard *clipboard = QApplication::clipboard();
|
|
||||||
clipboard->setText(analyzer.getRetroShareLink ());
|
|
||||||
//QMessageBox::warning(this, tr("RetroShare"), analyzer.getKommuteLink (), QMessageBox::Ok);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedFilesDialog::copyLinkRemote()
|
|
||||||
{
|
|
||||||
QModelIndexList lst = ui.remoteDirTreeView->selectionModel ()->selectedIndexes ();
|
|
||||||
copyLink (lst, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedFilesDialog::copyLinkLocal()
|
|
||||||
{
|
|
||||||
QModelIndexList lst = ui.localDirTreeView->selectionModel ()->selectedIndexes ();
|
|
||||||
copyLink (lst, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedFilesDialog::sendremoteLinkTo()
|
|
||||||
{
|
|
||||||
copyLinkRemote ();
|
|
||||||
|
|
||||||
/* create a message */
|
|
||||||
ChanMsgDialog *nMsgDialog = new ChanMsgDialog(true);
|
|
||||||
|
|
||||||
/* fill it in
|
|
||||||
* files are receommended already
|
|
||||||
* just need to set peers
|
|
||||||
*/
|
|
||||||
std::cerr << "SharedFilesDialog::sendremoteLinkTo()" << std::endl;
|
|
||||||
nMsgDialog->newMsg();
|
|
||||||
nMsgDialog->insertTitleText("RetroShare Link");
|
|
||||||
nMsgDialog->insertMsgText(QApplication::clipboard()->text().toStdString());
|
|
||||||
|
|
||||||
nMsgDialog->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedFilesDialog::sendLinkTo( /*std::string rsid*/ )
|
|
||||||
{
|
|
||||||
copyLinkLocal ();
|
|
||||||
|
|
||||||
/* create a message */
|
|
||||||
ChanMsgDialog *nMsgDialog = new ChanMsgDialog(true);
|
|
||||||
|
|
||||||
|
|
||||||
/* fill it in
|
|
||||||
* files are receommended already
|
|
||||||
* just need to set peers
|
|
||||||
*/
|
|
||||||
std::cerr << "SharedFilesDialog::sendLinkTo()" << std::endl;
|
|
||||||
nMsgDialog->newMsg();
|
|
||||||
nMsgDialog->insertTitleText("RetroShare Link");
|
|
||||||
nMsgDialog->insertMsgText(QApplication::clipboard()->text().toStdString());
|
|
||||||
|
|
||||||
nMsgDialog->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SharedFilesDialog::playselectedfiles()
|
void SharedFilesDialog::playselectedfiles()
|
||||||
@ -509,8 +393,8 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
|
|||||||
{
|
{
|
||||||
//=== at this moment we'll show menu only for files, not for folders
|
//=== at this moment we'll show menu only for files, not for folders
|
||||||
QModelIndex midx = ui.localDirTreeView->indexAt(point);
|
QModelIndex midx = ui.localDirTreeView->indexAt(point);
|
||||||
//if (localModel->isDir( midx ) )
|
if (localModel->isDir( midx ) )
|
||||||
// return;
|
return;
|
||||||
|
|
||||||
currentFile = localModel->data(midx,
|
currentFile = localModel->data(midx,
|
||||||
RemoteDirModel::FileNameRole).toString();
|
RemoteDirModel::FileNameRole).toString();
|
||||||
@ -577,18 +461,10 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
|
|||||||
|
|
||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
copylinklocalAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
|
|
||||||
connect( copylinklocalAct , SIGNAL( triggered() ), this, SLOT( copyLinkLocal() ) );
|
|
||||||
|
|
||||||
sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), this );
|
|
||||||
connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( /*std::string rsid*/ ) ) );
|
|
||||||
|
|
||||||
|
|
||||||
contextMnu2.addAction( menuAction );
|
contextMnu2.addAction( menuAction );
|
||||||
//contextMnu2.addAction( openfileAct);
|
//contextMnu2.addAction( openfileAct);
|
||||||
contextMnu2.addAction( copylinklocalAct);
|
|
||||||
contextMnu2.addAction( sendlinkAct);
|
|
||||||
contextMnu2.addSeparator();
|
contextMnu2.addSeparator();
|
||||||
contextMnu2.addMenu( recMenu);
|
contextMnu2.addMenu( recMenu);
|
||||||
contextMnu2.addMenu( msgMenu);
|
contextMnu2.addMenu( msgMenu);
|
||||||
|
@ -61,11 +61,6 @@ private slots:
|
|||||||
void downloadRemoteSelected();
|
void downloadRemoteSelected();
|
||||||
// void addMsgRemoteSelected();
|
// void addMsgRemoteSelected();
|
||||||
|
|
||||||
void copyLinkRemote();
|
|
||||||
void copyLinkLocal();
|
|
||||||
void sendLinkTo();
|
|
||||||
void sendremoteLinkTo();
|
|
||||||
|
|
||||||
//void showFrame(bool show);
|
//void showFrame(bool show);
|
||||||
|
|
||||||
|
|
||||||
@ -91,8 +86,6 @@ private:
|
|||||||
|
|
||||||
//QMenu* contextMnu2;
|
//QMenu* contextMnu2;
|
||||||
|
|
||||||
void copyLink (const QModelIndexList& lst, bool remote);
|
|
||||||
|
|
||||||
/** Defines the actions for the context menu for QTreeView */
|
/** Defines the actions for the context menu for QTreeView */
|
||||||
QAction* downloadAct;
|
QAction* downloadAct;
|
||||||
QAction* addMsgAct;
|
QAction* addMsgAct;
|
||||||
@ -100,10 +93,6 @@ private:
|
|||||||
/** Defines the actions for the context menu for QTreeWidget */
|
/** Defines the actions for the context menu for QTreeWidget */
|
||||||
QAction* openfileAct;
|
QAction* openfileAct;
|
||||||
QAction* openfolderAct;
|
QAction* openfolderAct;
|
||||||
QAction* copyremotelinkAct;
|
|
||||||
QAction* copylinklocalAct;
|
|
||||||
QAction* sendremotelinkAct;
|
|
||||||
QAction* sendlinkAct;
|
|
||||||
|
|
||||||
|
|
||||||
QTreeView *shareddirtreeview;
|
QTreeView *shareddirtreeview;
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "rshare.h"
|
#include "rshare.h"
|
||||||
#include "TransfersDialog.h"
|
#include "TransfersDialog.h"
|
||||||
#include "RetroShareLinkAnalyzer.h"
|
|
||||||
#include "DLListDelegate.h"
|
#include "DLListDelegate.h"
|
||||||
#include "ULListDelegate.h"
|
#include "ULListDelegate.h"
|
||||||
|
|
||||||
@ -44,9 +43,7 @@
|
|||||||
#define IMAGE_INFO ":/images/fileinfo.png"
|
#define IMAGE_INFO ":/images/fileinfo.png"
|
||||||
#define IMAGE_CANCEL ":/images/delete.png"
|
#define IMAGE_CANCEL ":/images/delete.png"
|
||||||
#define IMAGE_CLEARCOMPLETED ":/images/deleteall.png"
|
#define IMAGE_CLEARCOMPLETED ":/images/deleteall.png"
|
||||||
#define IMAGE_PLAY ":/images/player_play.png"
|
#define IMAGE_PLAY ":/images/player_play.png"
|
||||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
|
||||||
#define IMAGE_PASTELINK ":/images/pasterslink.png"
|
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
TransfersDialog::TransfersDialog(QWidget *parent)
|
TransfersDialog::TransfersDialog(QWidget *parent)
|
||||||
@ -191,15 +188,9 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
|||||||
connect( playAct , SIGNAL( triggered() ), this, SLOT( playSelectedTransfer() ) );
|
connect( playAct , SIGNAL( triggered() ), this, SLOT( playSelectedTransfer() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
cancelAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Cancel" ), this );
|
cancelAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Cancel" ), this );
|
||||||
connect( cancelAct , SIGNAL( triggered() ), this, SLOT( cancel() ) );
|
connect( cancelAct , SIGNAL( triggered() ), this, SLOT( cancel() ) );
|
||||||
|
|
||||||
copylinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
|
|
||||||
connect( copylinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
|
||||||
|
|
||||||
pastelinkAct = new QAction(QIcon(IMAGE_PASTELINK), tr( "Paste retroshare Link" ), this );
|
|
||||||
connect( pastelinkAct , SIGNAL( triggered() ), this, SLOT( pasteLink() ) );
|
|
||||||
|
|
||||||
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() ) );
|
||||||
|
|
||||||
@ -212,9 +203,6 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
|||||||
|
|
||||||
contextMnu.addAction( cancelAct);
|
contextMnu.addAction( cancelAct);
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
contextMnu.addAction( copylinkAct);
|
|
||||||
contextMnu.addAction( pastelinkAct);
|
|
||||||
contextMnu.addSeparator();
|
|
||||||
contextMnu.addAction( clearcompletedAct);
|
contextMnu.addAction( clearcompletedAct);
|
||||||
contextMnu.exec( mevent->globalPos() );
|
contextMnu.exec( mevent->globalPos() );
|
||||||
}
|
}
|
||||||
@ -639,72 +627,6 @@ void TransfersDialog::cancel()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransfersDialog::handleDownloadRequest(const QString& url){
|
|
||||||
|
|
||||||
RetroShareLinkAnalyzer analyzer (url);
|
|
||||||
|
|
||||||
if (!analyzer.isValid ())
|
|
||||||
return;
|
|
||||||
|
|
||||||
QVector<RetroShareLinkData> linkList;
|
|
||||||
analyzer.getFileInformation (linkList);
|
|
||||||
|
|
||||||
std::list<std::string> srcIds;
|
|
||||||
|
|
||||||
for (int i = 0, n = linkList.size (); i < n; ++i)
|
|
||||||
{
|
|
||||||
const RetroShareLinkData& linkData = linkList[i];
|
|
||||||
|
|
||||||
rsFiles->FileRequest (linkData.getName ().toStdString (), linkData.getHash ().toStdString (),
|
|
||||||
linkData.getSize ().toInt (), "", 0, srcIds);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransfersDialog::copyLink ()
|
|
||||||
{
|
|
||||||
QModelIndexList lst = ui.downloadList->selectionModel ()->selectedIndexes ();
|
|
||||||
RetroShareLinkAnalyzer analyzer;
|
|
||||||
|
|
||||||
for (int i = 0; i < lst.count (); i++)
|
|
||||||
{
|
|
||||||
if ( lst[i].column() == 0 )
|
|
||||||
{
|
|
||||||
QModelIndex & ind = lst[i];
|
|
||||||
QString fhash= ind.model ()->data (ind.model ()->index (ind.row (), ID )).toString() ;
|
|
||||||
QString fsize= ind.model ()->data (ind.model ()->index (ind.row (), SIZE)).toString() ;
|
|
||||||
QString fname= ind.model ()->data (ind.model ()->index (ind.row (), NAME)).toString() ;
|
|
||||||
|
|
||||||
analyzer.setRetroShareLink (fname, fsize, fhash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QClipboard *clipboard = QApplication::clipboard();
|
|
||||||
clipboard->setText(analyzer.getRetroShareLink ());
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransfersDialog::pasteLink()
|
|
||||||
{
|
|
||||||
QClipboard *clipboard = QApplication::clipboard();
|
|
||||||
RetroShareLinkAnalyzer analyzer (clipboard->text ());
|
|
||||||
|
|
||||||
if (!analyzer.isValid ())
|
|
||||||
return;
|
|
||||||
|
|
||||||
QVector<RetroShareLinkData> linkList;
|
|
||||||
analyzer.getFileInformation (linkList);
|
|
||||||
|
|
||||||
std::list<std::string> srcIds;
|
|
||||||
|
|
||||||
for (int i = 0, n = linkList.size (); i < n; ++i)
|
|
||||||
{
|
|
||||||
const RetroShareLinkData& linkData = linkList[i];
|
|
||||||
//downloadFileRequested(linkData.getName (), linkData.getSize ().toInt (),
|
|
||||||
// linkData.getHash (), "", -1, -1, -1, -1);
|
|
||||||
rsFiles->FileRequest (linkData.getName ().toStdString (), linkData.getHash ().toStdString (),
|
|
||||||
linkData.getSize ().toInt (), "", 0, srcIds);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransfersDialog::clearcompleted()
|
void TransfersDialog::clearcompleted()
|
||||||
{
|
{
|
||||||
std::cerr << "TransfersDialog::clearcompleted()" << std::endl;
|
std::cerr << "TransfersDialog::clearcompleted()" << std::endl;
|
||||||
|
@ -51,8 +51,6 @@ class TransfersDialog : public MainPage
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void insertTransfers();
|
void insertTransfers();
|
||||||
|
|
||||||
void handleDownloadRequest(const QString& url);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
@ -63,9 +61,6 @@ class TransfersDialog : public MainPage
|
|||||||
/** removes finished Downloads**/
|
/** removes finished Downloads**/
|
||||||
void clearcompleted();
|
void clearcompleted();
|
||||||
void playSelectedTransfer();
|
void playSelectedTransfer();
|
||||||
|
|
||||||
void copyLink();
|
|
||||||
void pasteLink();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void playFiles(QStringList files);
|
void playFiles(QStringList files);
|
||||||
@ -92,8 +87,6 @@ class TransfersDialog : public MainPage
|
|||||||
QAction* showdowninfoAct;
|
QAction* showdowninfoAct;
|
||||||
QAction* cancelAct;
|
QAction* cancelAct;
|
||||||
QAction* clearcompletedAct;
|
QAction* clearcompletedAct;
|
||||||
QAction* copylinkAct;
|
|
||||||
QAction* pastelinkAct;
|
|
||||||
|
|
||||||
QTreeView *downloadList;
|
QTreeView *downloadList;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
; Define your application name
|
; Define your application name
|
||||||
!define APPNAME "RetroShare"
|
!define APPNAME "RetroShare"
|
||||||
!define VERSION "0.4.12c"
|
!define VERSION "0.4.13b"
|
||||||
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
|
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
|
||||||
|
|
||||||
; Main Install settings
|
; Main Install settings
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
//#define USE_SVN_VERSIONS 1
|
//#define USE_SVN_VERSIONS 1
|
||||||
|
|
||||||
#define VERSION "0.4.13a"
|
#define VERSION "0.4.13b"
|
||||||
|
|
||||||
#if USE_SVN_VERSIONS
|
#if USE_SVN_VERSIONS
|
||||||
#include "svn_revision.h"
|
#include "svn_revision.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user