diff --git a/retroshare-gui/src/gui/ShareManager.cpp b/retroshare-gui/src/gui/ShareManager.cpp index 32c532214..23bb87a61 100644 --- a/retroshare-gui/src/gui/ShareManager.cpp +++ b/retroshare-gui/src/gui/ShareManager.cpp @@ -32,7 +32,6 @@ #include #include "ShareManager.h" -#include "ShareDialog.h" #include "settings/rsharesettings.h" #include "gui/common/GroupFlagsWidget.h" #include "gui/common/GroupSelectionBox.h" @@ -109,9 +108,16 @@ void ShareManager::handleCellChange(int row,int column) void ShareManager::editShareDirectory() { QTableWidget *listWidget = ui.shareddirList; - int row = listWidget -> currentRow(); + int row = listWidget->currentRow(); + int col = listWidget->currentColumn(); - doubleClickedCell(row,COLUMN_PATH) ; + if(col == COLUMN_VIRTUALNAME) + { + QModelIndex index = ui.shareddirList->model()->index(row,col,QModelIndex()); + ui.shareddirList->edit(index); + } + else + doubleClickedCell(row,col) ; } void ShareManager::doubleClickedCell(int row,int column) @@ -170,7 +176,18 @@ void ShareManager::shareddirListCustomPopupMenu( QPoint /*point*/ ) { QMenu contextMnu( this ); - QAction *editAct = new QAction(QIcon(IMAGE_EDIT), tr( "Edit" ), &contextMnu ); + int col = ui.shareddirList->currentColumn(); + QString edit_text ; + + switch(col) + { + case COLUMN_GROUPS: edit_text = tr("Change group visibility...") ; break ; + case COLUMN_PATH: edit_text = tr("Choose directory to share...") ; break; + case COLUMN_VIRTUALNAME: edit_text = tr("Choose visible name...") ; break; + default: + case COLUMN_SHARE_FLAGS: return ; + } + QAction *editAct = new QAction(QIcon(IMAGE_EDIT), edit_text, &contextMnu ); connect( editAct , SIGNAL( triggered() ), this, SLOT( editShareDirectory() ) ); QAction *removeAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Remove" ), &contextMnu ); @@ -363,13 +380,6 @@ void ShareManager::addShare() load(); } -void ShareManager::showShareDialog() -{ - ShareDialog sharedlg ("", this); - sharedlg.exec(); - load(); -} - void ShareManager::shareddirListCurrentCellChanged(int /*currentRow*/, int /*currentColumn*/, int /*previousRow*/, int /*previousColumn*/) { } diff --git a/retroshare-gui/src/gui/ShareManager.h b/retroshare-gui/src/gui/ShareManager.h index 332f5fab2..8a601a837 100644 --- a/retroshare-gui/src/gui/ShareManager.h +++ b/retroshare-gui/src/gui/ShareManager.h @@ -61,7 +61,6 @@ private slots: void handleCellChange(int row,int column); void editShareDirectory(); - void showShareDialog(); void removeShareDirectory(); void updateFlags(); void applyAndClose() ; diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index 2914dce4b..fb68cba3d 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -41,7 +41,6 @@ #include "RetroShareLink.h" #include "ShareManager.h" #include "RemoteDirModel.h" -#include "ShareDialog.h" #include "common/PeerDefs.h" #include "util/QtVersion.h" #include "gui/common/RsCollectionFile.h" @@ -250,8 +249,6 @@ LocalSharedFilesDialog::LocalSharedFilesDialog(QWidget *parent) 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())) ; ui.titleBarPixmap->setPixmap(QPixmap(IMAGE_MYFILES)) ; @@ -578,24 +575,6 @@ void RemoteSharedFilesDialog::downloadRemoteSelected() model -> downloadSelected(lst) ; } -void LocalSharedFilesDialog::editSharePermissions() -{ - std::list dirs; - rsFiles->getSharedDirectories(dirs); - - std::list::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) { std::vector dirVec; diff --git a/retroshare-gui/src/gui/SharedFilesDialog.h b/retroshare-gui/src/gui/SharedFilesDialog.h index 3d199fe98..82dfc8d63 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.h +++ b/retroshare-gui/src/gui/SharedFilesDialog.h @@ -163,7 +163,6 @@ class LocalSharedFilesDialog : public SharedFilesDialog private slots: void addShares(); void checkUpdate() ; - void editSharePermissions(); void playselectedfiles(); void openfile(); void openfolder(); diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index f399f9603..295025c45 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -351,7 +351,7 @@ HEADERS += rshare.h \ gui/SearchTreeWidget.h \ gui/SharedFilesDialog.h \ gui/ShareManager.h \ - gui/ShareDialog.h \ +# gui/ShareDialog.h \ # gui/SFListDelegate.h \ gui/SoundManager.h \ gui/HelpDialog.h \ @@ -595,7 +595,7 @@ FORMS += gui/StartDialog.ui \ gui/FriendsDialog.ui \ gui/SharedFilesDialog.ui \ gui/ShareManager.ui \ - gui/ShareDialog.ui \ +# gui/ShareDialog.ui \ gui/MessagesDialog.ui \ gui/help/browser/helpbrowser.ui \ gui/HelpDialog.ui \ @@ -715,7 +715,7 @@ SOURCES += main.cpp \ gui/SearchTreeWidget.cpp \ gui/SharedFilesDialog.cpp \ gui/ShareManager.cpp \ - gui/ShareDialog.cpp \ +# gui/ShareDialog.cpp \ # gui/SFListDelegate.cpp \ gui/SoundManager.cpp \ gui/MessagesDialog.cpp \