mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-06 21:34:22 -04:00
fixed popup menus is SharedFilesDialog (mainly create RsCollection and copy links)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ImprovedGUI@6133 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a3f7f604aa
commit
ed831b069e
2 changed files with 34 additions and 28 deletions
|
@ -144,10 +144,10 @@ SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareD
|
||||||
ui.dirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
ui.dirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
|
|
||||||
/* Hide platform specific features */
|
/* Hide platform specific features */
|
||||||
copylinklocalAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this );
|
copylinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this );
|
||||||
connect( copylinklocalAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
connect( copylinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
||||||
copylinklocalhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this );
|
copylinkhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this );
|
||||||
connect( copylinklocalhtmlAct , SIGNAL( triggered() ), this, SLOT( copyLinkhtml() ) );
|
connect( copylinkhtmlAct , SIGNAL( triggered() ), this, SLOT( copyLinkhtml() ) );
|
||||||
sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links" ), this );
|
sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links" ), this );
|
||||||
connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) );
|
connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) );
|
||||||
#ifdef RS_USE_LINKS
|
#ifdef RS_USE_LINKS
|
||||||
|
@ -156,14 +156,6 @@ SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareD
|
||||||
addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Links to Cloud" ), this );
|
addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Links to Cloud" ), this );
|
||||||
connect( addlinkCloudAct , SIGNAL( triggered() ), this, SLOT( addLinkToCloud( ) ) );
|
connect( addlinkCloudAct , SIGNAL( triggered() ), this, SLOT( addLinkToCloud( ) ) );
|
||||||
#endif
|
#endif
|
||||||
createcollectionfileAct = new QAction(QIcon(IMAGE_COLLECTION), tr("Create collection file"), this);
|
|
||||||
connect(createcollectionfileAct, SIGNAL(triggered()), this, SLOT(createCollectionFile()));
|
|
||||||
openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this);
|
|
||||||
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openfile()));
|
|
||||||
openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
|
|
||||||
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()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalSharedFilesDialog::LocalSharedFilesDialog(QWidget *parent)
|
LocalSharedFilesDialog::LocalSharedFilesDialog(QWidget *parent)
|
||||||
|
@ -181,6 +173,16 @@ LocalSharedFilesDialog::LocalSharedFilesDialog(QWidget *parent)
|
||||||
|
|
||||||
connect(ui.addShares_PB, SIGNAL(clicked()), this, SLOT(addShares()));
|
connect(ui.addShares_PB, SIGNAL(clicked()), this, SLOT(addShares()));
|
||||||
connect(ui.checkButton, SIGNAL(clicked()), this, SLOT(forceCheck()));
|
connect(ui.checkButton, SIGNAL(clicked()), this, SLOT(forceCheck()));
|
||||||
|
|
||||||
|
createcollectionfileAct = new QAction(QIcon(IMAGE_COLLECTION), tr("Create collection file"), this);
|
||||||
|
openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this);
|
||||||
|
openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
|
||||||
|
editshareAct = new QAction(QIcon(IMAGE_EDITSHARE), tr("Edit Share Permissions"), this);
|
||||||
|
|
||||||
|
connect(createcollectionfileAct, SIGNAL(triggered()), this, SLOT(createCollectionFile()));
|
||||||
|
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openfile()));
|
||||||
|
connect(openfolderAct, SIGNAL(triggered()), this, SLOT(openfolder()));
|
||||||
|
connect(editshareAct, SIGNAL(triggered()), this, SLOT(editSharePermissions()));
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent)
|
RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent)
|
||||||
|
@ -424,17 +426,17 @@ void RemoteSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
|
||||||
contextMnu.addAction( downloadAct);
|
contextMnu.addAction( downloadAct);
|
||||||
|
|
||||||
if (type == DIR_TYPE_FILE) {
|
if (type == DIR_TYPE_FILE) {
|
||||||
QAction *copyremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), &contextMnu );
|
//QAction *copyremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), &contextMnu );
|
||||||
connect( copyremotelinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
//connect( copyremotelinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
||||||
|
|
||||||
QAction *sendremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), &contextMnu );
|
//QAction *sendremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), &contextMnu );
|
||||||
connect( sendremotelinkAct , SIGNAL( triggered() ), this, SLOT( sendremoteLinkTo( ) ) );
|
//connect( sendremotelinkAct , SIGNAL( triggered() ), this, SLOT( sendremoteLinkTo( ) ) );
|
||||||
|
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
contextMnu.addAction( copyremotelinkAct);
|
contextMnu.addAction( copylinkAct);
|
||||||
contextMnu.addAction( sendremotelinkAct);
|
contextMnu.addAction( sendlinkAct);
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(addMsgRemoteSelected()));
|
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(recommendFilesToMsg()));
|
||||||
}
|
}
|
||||||
|
|
||||||
contextMnu.exec(QCursor::pos());
|
contextMnu.exec(QCursor::pos());
|
||||||
|
@ -533,7 +535,7 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
|
||||||
|
|
||||||
void SharedFilesDialog::copyLink()
|
void SharedFilesDialog::copyLink()
|
||||||
{
|
{
|
||||||
copyLink ( getSelected() , true);
|
copyLink ( getSelected() , isRemote());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedFilesDialog::copyLinkhtml( )
|
void SharedFilesDialog::copyLinkhtml( )
|
||||||
|
@ -713,7 +715,7 @@ void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
|
||||||
case DIR_TYPE_FILE:
|
case DIR_TYPE_FILE:
|
||||||
contextMnu.addAction(openfileAct);
|
contextMnu.addAction(openfileAct);
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
contextMnu.addAction(copylinklocalAct);
|
contextMnu.addAction(copylinkAct);
|
||||||
contextMnu.addAction(sendlinkAct);
|
contextMnu.addAction(sendlinkAct);
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
contextMnu.addAction(createcollectionfileAct) ;
|
contextMnu.addAction(createcollectionfileAct) ;
|
||||||
|
|
|
@ -45,6 +45,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
QTreeView *directoryView() ;
|
QTreeView *directoryView() ;
|
||||||
virtual void showProperColumns() = 0 ;
|
virtual void showProperColumns() = 0 ;
|
||||||
|
virtual bool isRemote() const = 0 ;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void spawnCustomPopupMenu(QPoint point) = 0;
|
virtual void spawnCustomPopupMenu(QPoint point) = 0;
|
||||||
|
@ -105,19 +106,14 @@ protected:
|
||||||
QModelIndexList getSelected();
|
QModelIndexList getSelected();
|
||||||
|
|
||||||
/** Defines the actions for the context menu for QTreeWidget */
|
/** Defines the actions for the context menu for QTreeWidget */
|
||||||
QAction* openfileAct;
|
QAction* copylinkAct;
|
||||||
QAction* createcollectionfileAct;
|
|
||||||
QAction* openfolderAct;
|
|
||||||
QAction* copyremotelinkAct;
|
|
||||||
QAction* copylinklocalAct;
|
|
||||||
QAction* sendlinkAct;
|
QAction* sendlinkAct;
|
||||||
QAction* editshareAct;
|
|
||||||
#ifdef RS_USE_LINKS
|
#ifdef RS_USE_LINKS
|
||||||
QAction* sendlinkCloudAct;
|
QAction* sendlinkCloudAct;
|
||||||
QAction* addlinkCloudAct;
|
QAction* addlinkCloudAct;
|
||||||
#endif
|
#endif
|
||||||
QAction* sendchatlinkAct;
|
QAction* sendchatlinkAct;
|
||||||
QAction* copylinklocalhtmlAct;
|
QAction* copylinkhtmlAct;
|
||||||
|
|
||||||
/* RetroshareDirModel */
|
/* RetroshareDirModel */
|
||||||
RetroshareDirModel *tree_model;
|
RetroshareDirModel *tree_model;
|
||||||
|
@ -147,6 +143,7 @@ class LocalSharedFilesDialog : public SharedFilesDialog
|
||||||
protected:
|
protected:
|
||||||
virtual void processSettings(bool bLoad) ;
|
virtual void processSettings(bool bLoad) ;
|
||||||
virtual void showProperColumns() ;
|
virtual void showProperColumns() ;
|
||||||
|
virtual bool isRemote() const { return false ; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addShares();
|
void addShares();
|
||||||
|
@ -161,6 +158,12 @@ class LocalSharedFilesDialog : public SharedFilesDialog
|
||||||
void forceCheck();
|
void forceCheck();
|
||||||
|
|
||||||
QAction* fileAssotiationAction(const QString fileName);
|
QAction* fileAssotiationAction(const QString fileName);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QAction* openfileAct;
|
||||||
|
QAction* createcollectionfileAct;
|
||||||
|
QAction* openfolderAct;
|
||||||
|
QAction* editshareAct;
|
||||||
};
|
};
|
||||||
class RemoteSharedFilesDialog : public SharedFilesDialog
|
class RemoteSharedFilesDialog : public SharedFilesDialog
|
||||||
{
|
{
|
||||||
|
@ -175,6 +178,7 @@ class RemoteSharedFilesDialog : public SharedFilesDialog
|
||||||
protected:
|
protected:
|
||||||
virtual void processSettings(bool bLoad) ;
|
virtual void processSettings(bool bLoad) ;
|
||||||
virtual void showProperColumns() ;
|
virtual void showProperColumns() ;
|
||||||
|
virtual bool isRemote() const { return true ; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void downloadRemoteSelected();
|
void downloadRemoteSelected();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue