diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index 7ba890f6b..43f8f5ffa 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -32,14 +32,9 @@ #include "msgs/ChanMsgDialog.h" #include "Preferences/rsharesettings.h" -#ifndef RETROSHARE_LINK_ANALYZER -#include "RetroShareLinkAnalyzer.h" -#endif - #include #include -#include #include #include #include @@ -64,8 +59,6 @@ #define IMAGE_ATTACHMENT ":/images/attachment.png" #define IMAGE_FRIEND ":/images/peers_16x16.png" #define IMAGE_PROGRESS ":/images/browse-looking.gif" -#define IMAGE_COPYLINK ":/images/copyrslink.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 ); 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 ); // connect( addMsgAct , SIGNAL( triggered() ), this, SLOT( addMsgRemoteSelected() ) ); contextMnu.clear(); contextMnu.addAction( downloadAct); - contextMnu.addSeparator(); - contextMnu.addAction( copyremotelinkAct); - contextMnu.addAction( sendremotelinkAct); // contextMnu.addAction( addMsgAct); contextMnu.exec( mevent->globalPos() ); } @@ -233,106 +217,6 @@ void SharedFilesDialog::downloadRemoteSelected() } -void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote) -{ - std::vector 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::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() @@ -509,8 +393,8 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point ) { //=== at this moment we'll show menu only for files, not for folders QModelIndex midx = ui.localDirTreeView->indexAt(point); - //if (localModel->isDir( midx ) ) - // return; + if (localModel->isDir( midx ) ) + return; currentFile = localModel->data(midx, RemoteDirModel::FileNameRole).toString(); @@ -577,18 +461,10 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point ) } //#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( openfileAct); - contextMnu2.addAction( copylinklocalAct); - contextMnu2.addAction( sendlinkAct); contextMnu2.addSeparator(); contextMnu2.addMenu( recMenu); contextMnu2.addMenu( msgMenu); diff --git a/retroshare-gui/src/gui/SharedFilesDialog.h b/retroshare-gui/src/gui/SharedFilesDialog.h index 06699fbfb..bff9df0d6 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.h +++ b/retroshare-gui/src/gui/SharedFilesDialog.h @@ -61,11 +61,6 @@ private slots: void downloadRemoteSelected(); // void addMsgRemoteSelected(); - void copyLinkRemote(); - void copyLinkLocal(); - void sendLinkTo(); - void sendremoteLinkTo(); - //void showFrame(bool show); @@ -91,8 +86,6 @@ private: //QMenu* contextMnu2; - void copyLink (const QModelIndexList& lst, bool remote); - /** Defines the actions for the context menu for QTreeView */ QAction* downloadAct; QAction* addMsgAct; @@ -100,10 +93,6 @@ private: /** Defines the actions for the context menu for QTreeWidget */ QAction* openfileAct; QAction* openfolderAct; - QAction* copyremotelinkAct; - QAction* copylinklocalAct; - QAction* sendremotelinkAct; - QAction* sendlinkAct; QTreeView *shareddirtreeview; diff --git a/retroshare-gui/src/gui/TransfersDialog.cpp b/retroshare-gui/src/gui/TransfersDialog.cpp index 62af12666..555d879e0 100644 --- a/retroshare-gui/src/gui/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/TransfersDialog.cpp @@ -22,7 +22,6 @@ #include "rshare.h" #include "TransfersDialog.h" -#include "RetroShareLinkAnalyzer.h" #include "DLListDelegate.h" #include "ULListDelegate.h" @@ -44,9 +43,7 @@ #define IMAGE_INFO ":/images/fileinfo.png" #define IMAGE_CANCEL ":/images/delete.png" #define IMAGE_CLEARCOMPLETED ":/images/deleteall.png" -#define IMAGE_PLAY ":/images/player_play.png" -#define IMAGE_COPYLINK ":/images/copyrslink.png" -#define IMAGE_PASTELINK ":/images/pasterslink.png" +#define IMAGE_PLAY ":/images/player_play.png" /** Constructor */ TransfersDialog::TransfersDialog(QWidget *parent) @@ -191,15 +188,9 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point ) 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() ) ); - 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 ); connect( clearcompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) ); @@ -212,9 +203,6 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point ) contextMnu.addAction( cancelAct); contextMnu.addSeparator(); - contextMnu.addAction( copylinkAct); - contextMnu.addAction( pastelinkAct); - contextMnu.addSeparator(); contextMnu.addAction( clearcompletedAct); contextMnu.exec( mevent->globalPos() ); } @@ -639,72 +627,6 @@ void TransfersDialog::cancel() return; } -void TransfersDialog::handleDownloadRequest(const QString& url){ - - RetroShareLinkAnalyzer analyzer (url); - - if (!analyzer.isValid ()) - return; - - QVector linkList; - analyzer.getFileInformation (linkList); - - std::list 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 linkList; - analyzer.getFileInformation (linkList); - - std::list 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() { std::cerr << "TransfersDialog::clearcompleted()" << std::endl; diff --git a/retroshare-gui/src/gui/TransfersDialog.h b/retroshare-gui/src/gui/TransfersDialog.h index 21c8e693d..f301cb5c1 100644 --- a/retroshare-gui/src/gui/TransfersDialog.h +++ b/retroshare-gui/src/gui/TransfersDialog.h @@ -51,8 +51,6 @@ class TransfersDialog : public MainPage public slots: void insertTransfers(); - - void handleDownloadRequest(const QString& url); private slots: @@ -63,9 +61,6 @@ class TransfersDialog : public MainPage /** removes finished Downloads**/ void clearcompleted(); void playSelectedTransfer(); - - void copyLink(); - void pasteLink(); signals: void playFiles(QStringList files); @@ -92,8 +87,6 @@ class TransfersDialog : public MainPage QAction* showdowninfoAct; QAction* cancelAct; QAction* clearcompletedAct; - QAction* copylinkAct; - QAction* pastelinkAct; QTreeView *downloadList; diff --git a/retroshare-gui/src/retroshare.nsi b/retroshare-gui/src/retroshare.nsi index e0309b817..fba8820ac 100644 --- a/retroshare-gui/src/retroshare.nsi +++ b/retroshare-gui/src/retroshare.nsi @@ -2,7 +2,7 @@ ; Define your application name !define APPNAME "RetroShare" -!define VERSION "0.4.12c" +!define VERSION "0.4.13b" !define APPNAMEANDVERSION "${APPNAME} ${VERSION}" ; Main Install settings diff --git a/retroshare-gui/src/util/rsversion.cpp b/retroshare-gui/src/util/rsversion.cpp index d0a098b4e..6a3d178b1 100644 --- a/retroshare-gui/src/util/rsversion.cpp +++ b/retroshare-gui/src/util/rsversion.cpp @@ -23,7 +23,7 @@ //#define USE_SVN_VERSIONS 1 -#define VERSION "0.4.13a" +#define VERSION "0.4.13b" #if USE_SVN_VERSIONS #include "svn_revision.h"