mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Added "Edit Share Permissions" Context Menu entry to My Directions, to edit easily share permissions for each directory
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5944 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bf70038ad2
commit
8cdefe9764
@ -35,7 +35,8 @@
|
|||||||
#include "AddLinksDialog.h"
|
#include "AddLinksDialog.h"
|
||||||
#endif
|
#endif
|
||||||
#include "RetroShareLink.h"
|
#include "RetroShareLink.h"
|
||||||
#include "RemoteDirModel.h"
|
#include "RemoteDirModel.h"
|
||||||
|
#include "ShareDialog.h"
|
||||||
#include "common/PeerDefs.h"
|
#include "common/PeerDefs.h"
|
||||||
|
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
@ -52,9 +53,10 @@
|
|||||||
#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"
|
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
||||||
#define IMAGE_OPENFOLDER ":/images/folderopen.png"
|
#define IMAGE_OPENFOLDER ":/images/folderopen.png"
|
||||||
#define IMAGE_OPENFILE ":/images/fileopen.png"
|
#define IMAGE_OPENFILE ":/images/fileopen.png"
|
||||||
#define IMAGE_COLLECTION ":/images/mimetypes/rscollection-16.png"
|
#define IMAGE_COLLECTION ":/images/mimetypes/rscollection-16.png"
|
||||||
|
#define IMAGE_EDITSHARE ":/images/edit_16.png"
|
||||||
|
|
||||||
// Define to avoid using the search in treeview, because it is really slow for now.
|
// Define to avoid using the search in treeview, because it is really slow for now.
|
||||||
//
|
//
|
||||||
@ -228,7 +230,9 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
|||||||
openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this);
|
openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this);
|
||||||
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openfile()));
|
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openfile()));
|
||||||
openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
|
openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
|
||||||
connect(openfolderAct, SIGNAL(triggered()), this, SLOT(openfolder()));
|
connect(openfolderAct, SIGNAL(triggered()), this, SLOT(openfolder()));
|
||||||
|
editshareAct = new QAction(QIcon(IMAGE_EDITSHARE), tr("Edit Share Permissions"), this);
|
||||||
|
connect(editshareAct, SIGNAL(triggered()), this, SLOT(editSharePermissions()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedFilesDialog::hideEvent(QHideEvent *)
|
void SharedFilesDialog::hideEvent(QHideEvent *)
|
||||||
@ -429,7 +433,8 @@ void SharedFilesDialog::createCollectionFile()
|
|||||||
std::cerr << "Creating a collection file!" << std::endl;
|
std::cerr << "Creating a collection file!" << std::endl;
|
||||||
QModelIndexList lst = getLocalSelected();
|
QModelIndexList lst = getLocalSelected();
|
||||||
localModel->createCollectionFile(this, lst);
|
localModel->createCollectionFile(this, lst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedFilesDialog::downloadRemoteSelected()
|
void SharedFilesDialog::downloadRemoteSelected()
|
||||||
{
|
{
|
||||||
/* call back to the model (which does all the interfacing? */
|
/* call back to the model (which does all the interfacing? */
|
||||||
@ -440,6 +445,24 @@ void SharedFilesDialog::downloadRemoteSelected()
|
|||||||
QModelIndexList lst = getRemoteSelected();
|
QModelIndexList lst = getRemoteSelected();
|
||||||
model -> downloadSelected(lst);
|
model -> downloadSelected(lst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SharedFilesDialog::editSharePermissions()
|
||||||
|
{
|
||||||
|
std::list<SharedDirInfo> dirs;
|
||||||
|
rsFiles->getSharedDirectories(dirs);
|
||||||
|
|
||||||
|
std::list<SharedDirInfo>::const_iterator it;
|
||||||
|
for (it = dirs.begin(); it != dirs.end(); it++) {
|
||||||
|
if (currentFile == currentFile) {
|
||||||
|
/* file name found, show dialog */
|
||||||
|
ShareDialog sharedlg (it->filename, this);
|
||||||
|
sharedlg.setWindowTitle(tr("Edit Shared Folder"));
|
||||||
|
sharedlg.exec();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
|
void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
|
||||||
{
|
{
|
||||||
@ -736,9 +759,11 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DIR_TYPE_DIR:
|
case DIR_TYPE_DIR:
|
||||||
contextMnu.addAction(openfolderAct);
|
contextMnu.addAction(openfolderAct);
|
||||||
|
contextMnu.addSeparator();
|
||||||
|
contextMnu.addAction(editshareAct) ;
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
contextMnu.addAction(createcollectionfileAct) ;
|
contextMnu.addAction(createcollectionfileAct) ;
|
||||||
break;
|
break;
|
||||||
case DIR_TYPE_FILE:
|
case DIR_TYPE_FILE:
|
||||||
contextMnu.addAction(openfileAct);
|
contextMnu.addAction(openfileAct);
|
||||||
|
@ -77,7 +77,8 @@ private slots:
|
|||||||
|
|
||||||
void playselectedfiles();
|
void playselectedfiles();
|
||||||
void openfile();
|
void openfile();
|
||||||
void openfolder();
|
void openfolder();
|
||||||
|
void editSharePermissions();
|
||||||
|
|
||||||
void recommendFilesToMsg();
|
void recommendFilesToMsg();
|
||||||
void runCommandForFile();
|
void runCommandForFile();
|
||||||
@ -119,7 +120,8 @@ private:
|
|||||||
QAction* openfolderAct;
|
QAction* openfolderAct;
|
||||||
QAction* copyremotelinkAct;
|
QAction* copyremotelinkAct;
|
||||||
QAction* copylinklocalAct;
|
QAction* copylinklocalAct;
|
||||||
QAction* sendlinkAct;
|
QAction* sendlinkAct;
|
||||||
|
QAction* editshareAct;
|
||||||
#ifdef RS_USE_LINKS
|
#ifdef RS_USE_LINKS
|
||||||
QAction* sendlinkCloudAct;
|
QAction* sendlinkCloudAct;
|
||||||
QAction* addlinkCloudAct;
|
QAction* addlinkCloudAct;
|
||||||
|
Loading…
Reference in New Issue
Block a user