mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
* added context menu for Share Manager to can remove a Shared Directory
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@900 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
526a5c2cdb
commit
8ba3c2de28
3 changed files with 48 additions and 5 deletions
|
@ -22,10 +22,18 @@
|
|||
|
||||
#include "rsiface/rsfiles.h"
|
||||
|
||||
|
||||
#include <QContextMenuEvent>
|
||||
#include <QMenu>
|
||||
#include <QCursor>
|
||||
#include <QPoint>
|
||||
#include <QMouseEvent>
|
||||
#include <QPixmap>
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
/* Images for context menu icons */
|
||||
#define IMAGE_CANCEL ":/images/delete.png"
|
||||
|
||||
/** Default constructor */
|
||||
ShareManager::ShareManager(QWidget *parent, Qt::WFlags flags)
|
||||
: QDialog(parent, flags)
|
||||
|
@ -39,12 +47,31 @@ ShareManager::ShareManager(QWidget *parent, Qt::WFlags flags)
|
|||
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
|
||||
connect( ui.shareddirList, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( shareddirListCostumPopupMenu( QPoint ) ) );
|
||||
|
||||
|
||||
ui.addButton->setToolTip(tr("Add a Share Directory"));
|
||||
ui.removeButton->setToolTip(tr("Remove selected Shared Directory"));
|
||||
|
||||
load();
|
||||
|
||||
}
|
||||
|
||||
void ShareManager::shareddirListCostumPopupMenu( QPoint point )
|
||||
{
|
||||
|
||||
QMenu contextMnu( this );
|
||||
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
|
||||
|
||||
removeAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Remove" ), this );
|
||||
connect( removeAct , SIGNAL( triggered() ), this, SLOT( removeShareDirectory() ) );
|
||||
|
||||
|
||||
contextMnu.clear();
|
||||
contextMnu.addAction( removeAct );
|
||||
contextMnu.exec( mevent->globalPos() );
|
||||
}
|
||||
|
||||
/** Loads the settings for this page */
|
||||
void ShareManager::load()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue