diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 02cb459f6..8ae3ec0f3 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -43,7 +43,7 @@ #include "SearchDialog.h" #include "TransfersDialog.h" #include "MessagesDialog.h" -#include "SharedFilesDialog.h" +//#include "SharedFilesDialog.h" #include "PluginsPage.h" #include "NewsFeed.h" #include "ShareManager.h" @@ -255,8 +255,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) action = createPageAction(QIcon(IMAGE_TRANSFERS), tr("Transfers"), grp)); notify.push_back(QPair(transfersDialog, action)); - ui->stackPages->add(sharedfilesDialog = new SharedFilesDialog(ui->stackPages), - createPageAction(QIcon(IMAGE_FILES), tr("Files"), grp)); +// ui->stackPages->add(sharedfilesDialog = new SharedFilesDialog(ui->stackPages), +// createPageAction(QIcon(IMAGE_FILES), tr("Files"), grp)); ui->stackPages->add(messagesDialog = new MessagesDialog(ui->stackPages), action = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp)); @@ -800,8 +800,8 @@ void SetForegroundWindowInternal(HWND hWnd) case Transfers: Page = _instance->transfersDialog; break; - case SharedDirectories: - Page = _instance->sharedfilesDialog; +// case SharedDirectories: +// Page = _instance->sharedfilesDialog; break; case Messages: Page = _instance->messagesDialog; @@ -849,9 +849,9 @@ void SetForegroundWindowInternal(HWND hWnd) if (page == _instance->transfersDialog) { return Transfers; } - if (page == _instance->sharedfilesDialog) { - return SharedDirectories; - } +// if (page == _instance->sharedfilesDialog) { +// return SharedDirectories; + // } if (page == _instance->messagesDialog) { return Messages; } @@ -891,8 +891,8 @@ void SetForegroundWindowInternal(HWND hWnd) // return _instance->searchDialog; case Transfers: return _instance->transfersDialog; - case SharedDirectories: - return _instance->sharedfilesDialog; +// case SharedDirectories: +// return _instance->sharedfilesDialog; case Messages: return _instance->messagesDialog; #ifdef RS_USE_LINKS diff --git a/retroshare-gui/src/gui/NetworkDialog.ui b/retroshare-gui/src/gui/NetworkDialog.ui index 1a6a2d54e..5b06bcc71 100644 --- a/retroshare-gui/src/gui/NetworkDialog.ui +++ b/retroshare-gui/src/gui/NetworkDialog.ui @@ -37,137 +37,140 @@ - Show keys that are not validated by the PGP web of trust + Show all accessible keys - - - - 0 - 0 - + + + Qt::Vertical - - Qt::CustomContextMenu - - - false - - - false - - - 20 - - - - 16 - 16 - - - - true - - - true - - - true - - - true - - - true - - - true - - - 200 - - - true - - - - + + + + 0 + 0 + - - - - Name + + Qt::CustomContextMenu - - - - Did I authenticated peer + + false - - Did I sign his PGP key + + false - - - - Did peer authenticated me + + 20 - - - - Cert Id + + + 16 + 16 + - - - - - - - Qt::CustomContextMenu - - - true - - - true - - - true - - - 200 - - - true - - - - + + true - - - - Name + + true - - - - Did I authenticated peer + + true - - - - Did peer authenticated me + + true - - - - Cert Id + + true - + + true + + + 200 + + + true + + + + + + + + + Name + + + + + Did I authenticated peer + + + Did I sign his PGP key + + + + + Did peer authenticated me + + + + + Cert Id + + + + + + Qt::CustomContextMenu + + + true + + + true + + + true + + + 200 + + + true + + + + + + + + + Name + + + + + Did I authenticated peer + + + + + Did peer authenticated me + + + + + Cert Id + + + diff --git a/retroshare-gui/src/gui/RemoteDirModel.cpp b/retroshare-gui/src/gui/RemoteDirModel.cpp index dd51bf15d..075fe414f 100644 --- a/retroshare-gui/src/gui/RemoteDirModel.cpp +++ b/retroshare-gui/src/gui/RemoteDirModel.cpp @@ -1307,8 +1307,9 @@ void FlatStyle_RDM::updateRefs() #endif _ref_stack.pop_back() ; DirDetails details ; + FileSearchFlags flags = (RemoteMode)?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL; - if (requestDirDetails(ref, details, RS_FILE_HINTS_REMOTE)) + if (requestDirDetails(ref, details, flags)) { if(details.type == DIR_TYPE_FILE) // only push files, not directories nor persons. _ref_entries.push_back(std::pair(ref,computeDirectoryPath(details))); diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index b5d400e30..6984e80cf 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -90,36 +90,24 @@ private: }; /** Constructor */ -SharedFilesDialog::SharedFilesDialog(QWidget *parent) +SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareDirModel *_flat_model,QWidget *parent) : RsAutoUpdatePage(1000,parent),model(NULL) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); connect(ui.checkButton, SIGNAL(clicked()), this, SLOT(forceCheck())); - connect(ui.localButton, SIGNAL(toggled(bool)), this, SLOT(showFrame(bool))); - connect(ui.remoteButton, SIGNAL(toggled(bool)), this, SLOT(showFrameRemote(bool))); - connect(ui.splittedButton, SIGNAL(toggled(bool)), this, SLOT(showFrameSplitted(bool))); +//== connect(ui.localButton, SIGNAL(toggled(bool)), this, SLOT(showFrame(bool))); +//== connect(ui.remoteButton, SIGNAL(toggled(bool)), this, SLOT(showFrameRemote(bool))); +//== connect(ui.splittedButton, SIGNAL(toggled(bool)), this, SLOT(showFrameSplitted(bool))); connect(ui.viewType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCurrentViewModel(int))); - connect( ui.localDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( sharedDirTreeWidgetContextMenu( QPoint ) ) ); - connect( ui.remoteDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( shareddirtreeviewCostumPopupMenu( QPoint ) ) ); - -// connect( ui.remoteDirTreeView, SIGNAL( doubleClicked(const QModelIndex&)), this, SLOT( downloadRemoteSelected())); - connect( ui.downloadButton, SIGNAL( clicked()), this, SLOT( downloadRemoteSelected())); + connect( ui.dirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( spawnCustomPopupMenu( QPoint ) ) ); connect(ui.indicatorCBox, SIGNAL(currentIndexChanged(int)), this, SLOT(indicatorChanged(int))); -/* - connect( ui.remoteDirTreeView, SIGNAL( itemExpanded( QTreeWidgetItem * ) ), - this, SLOT( checkForLocalDirRequest( QTreeWidgetItem * ) ) ); - - connect( ui.localDirTreeWidget, SIGNAL( itemExpanded( QTreeWidgetItem * ) ), - this, SLOT( checkForRemoteDirRequest( QTreeWidgetItem * ) ) ); -*/ - - tree_model = new TreeStyle_RDM(true); - flat_model = new FlatStyle_RDM(true); + tree_model = _tree_model ; + flat_model = _flat_model ; tree_proxyModel = new SFDSortFilterProxyModel(tree_model, this); tree_proxyModel->setDynamicSortFilter(true); @@ -135,22 +123,22 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent) flat_proxyModel->setSortRole(RetroshareDirModel::SortRole); flat_proxyModel->sort(0); - localModel = new TreeStyle_RDM(false); +//== localModel = new TreeStyle_RDM(false); +//== +//== localProxyModel = new SFDSortFilterProxyModel(localModel, this); +//== localProxyModel->setDynamicSortFilter(true); +//== localProxyModel->setSourceModel(localModel); +//== localProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); +//== localProxyModel->setSortRole(RetroshareDirModel::SortRole); +//== localProxyModel->sort(0); - localProxyModel = new SFDSortFilterProxyModel(localModel, this); - localProxyModel->setDynamicSortFilter(true); - localProxyModel->setSourceModel(localModel); - localProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); - localProxyModel->setSortRole(RetroshareDirModel::SortRole); - localProxyModel->sort(0); +//== ui.dirTreeView->setModel(localProxyModel); - ui.localDirTreeView->setModel(localProxyModel); +//== connect( ui.dirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), localModel, SLOT( collapsed(const QModelIndex & ) ) ); +//== connect( ui.dirTreeView, SIGNAL( expanded(const QModelIndex & ) ), localModel, SLOT( expanded(const QModelIndex & ) ) ); - connect( ui.localDirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), localModel, SLOT( collapsed(const QModelIndex & ) ) ); - connect( ui.localDirTreeView, SIGNAL( expanded(const QModelIndex & ) ), localModel, SLOT( expanded(const QModelIndex & ) ) ); - - connect( localModel, SIGNAL( layoutAboutToBeChanged() ), ui.localDirTreeView, SLOT( reset() ) ); - connect( localModel, SIGNAL( layoutChanged() ), ui.localDirTreeView, SLOT( update() ) ); +//== connect( localModel, SIGNAL( layoutAboutToBeChanged() ), ui.localDirTreeView, SLOT( reset() ) ); +//== connect( localModel, SIGNAL( layoutChanged() ), ui.localDirTreeView, SLOT( update() ) ); connect(ui.filterClearButton, SIGNAL(clicked()), this, SLOT(clearFilter())); connect(ui.filterStartButton, SIGNAL(clicked()), this, SLOT(startFilter())); @@ -158,61 +146,25 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent) connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged())); /* Set header resize modes and initial section sizes */ - QHeaderView * l_header = ui.localDirTreeView->header () ; + QHeaderView * header = ui.dirTreeView->header () ; + header->setResizeMode (0, QHeaderView::Interactive); - l_header->resizeSection ( 0, 490 ); - l_header->resizeSection ( 1, 70 ); - l_header->resizeSection ( 2, 100 ); - l_header->resizeSection ( 3, 100 ); - l_header->resizeSection ( 4, 100 ); + header->resizeSection ( 0, 490 ); + header->resizeSection ( 1, 70 ); + header->resizeSection ( 2, 100 ); + header->resizeSection ( 3, 100 ); + header->resizeSection ( 4, 100 ); - l_header->setStretchLastSection(false); -// l_header->setHighlightSections(false); + header->setStretchLastSection(false); // Setup the current view model. // changeCurrentViewModel(ui.viewType_CB->currentIndex()) ; - /* Set header resize modes and initial section sizes */ - QHeaderView * r_header = ui.remoteDirTreeView->header () ; - - r_header->setResizeMode (0, QHeaderView::Interactive); - r_header->setStretchLastSection(false); - -// r_header->setResizeMode (1, QHeaderView::Fixed); -// // r_header->setResizeMode (2, QHeaderView::Interactive); -// r_header->setResizeMode (3, QHeaderView::Fixed); -// // r_header->setResizeMode (4, QHeaderView::Interactive); - - r_header->resizeSection ( 0, 490 ); - r_header->resizeSection ( 1, 70 ); - r_header->resizeSection ( 2, 80 ); - r_header->resizeSection ( 3, 100 ); - r_header->resizeSection ( 4, 80 ); - -// r_header->setHighlightSections(false); - /* Set Multi Selection */ - ui.remoteDirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection); - ui.localDirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection); - -//#ifdef RS_RELEASE_VERSION -// ui.filterLabel->hide(); -// ui.filterPatternLineEdit->hide(); -//#endif - - // load settings - processSettings(true); - - // Hide columns after loading the settings - ui.remoteDirTreeView->setColumnHidden(3,false) ; - ui.remoteDirTreeView->setColumnHidden(4,true) ; - ui.localDirTreeView->setColumnHidden(4,false) ; + ui.dirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection); /* Hide platform specific features */ -#ifdef Q_WS_WIN - -#endif copylinklocalAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this ); connect( copylinklocalAct , SIGNAL( triggered() ), this, SLOT( copyLinkLocal() ) ); copylinklocalhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this ); @@ -235,11 +187,34 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent) connect(editshareAct, SIGNAL(triggered()), this, SLOT(editSharePermissions())); } +LocalSharedFilesDialog::LocalSharedFilesDialog(QWidget *parent) + : SharedFilesDialog(new TreeStyle_RDM(false),new FlatStyle_RDM(false),parent) +{ + // Hide columns after loading the settings + ui.dirTreeView->setColumnHidden(4,false) ; + ui.downloadButton->hide() ; + + // load settings + processSettings(true); +} + +RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent) + : SharedFilesDialog(new TreeStyle_RDM(true),new FlatStyle_RDM(true),parent) +{ + ui.dirTreeView->setColumnHidden(3,false) ; + ui.dirTreeView->setColumnHidden(4,true) ; + ui.checkButton->hide() ; + + connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(downloadRemoteSelected())); + + // load settings + processSettings(true); +} + void SharedFilesDialog::hideEvent(QHideEvent *) { if(model!=NULL) model->setVisible(false) ; - //std::cerr << "Hidden!"<< std::endl; } void SharedFilesDialog::showEvent(QShowEvent *) { @@ -248,15 +223,50 @@ void SharedFilesDialog::showEvent(QShowEvent *) model->setVisible(true) ; model->update() ; } - //std::cerr << "Shown!"<< std::endl; } -SharedFilesDialog::~SharedFilesDialog() +RemoteSharedFilesDialog::~RemoteSharedFilesDialog() { // save settings processSettings(false); } -void SharedFilesDialog::processSettings(bool bLoad) +LocalSharedFilesDialog::~LocalSharedFilesDialog() +{ + // save settings + processSettings(false); +} + +void LocalSharedFilesDialog::processSettings(bool bLoad) +{ + Settings->beginGroup("LocalSharedFilesDialog"); + + if (bLoad) { + // load settings + + // state of the trees + ui.dirTreeView->header()->restoreState(Settings->value("LocalDirTreeView").toByteArray()); + + // state of splitter + ui.splitter->restoreState(Settings->value("LocalSplitter").toByteArray()); + + // view type + ui.viewType_CB->setCurrentIndex(Settings->value("LocalViewType").toInt()); + } else { + // save settings + + // state of trees + Settings->setValue("LocalDirTreeView", ui.dirTreeView->header()->saveState()); + + // state of splitter + Settings->setValue("LocalSplitter", ui.splitter->saveState()); + + // view type + Settings->setValue("LocalViewType", ui.viewType_CB->currentIndex()); + } + + Settings->endGroup(); +} +void RemoteSharedFilesDialog::processSettings(bool bLoad) { Settings->beginGroup("SharedFilesDialog"); @@ -264,26 +274,24 @@ void SharedFilesDialog::processSettings(bool bLoad) // load settings // state of the trees - ui.localDirTreeView->header()->restoreState(Settings->value("LocalDirTreeView").toByteArray()); - ui.remoteDirTreeView->header()->restoreState(Settings->value("RemoteDirTreeView").toByteArray()); + ui.dirTreeView->header()->restoreState(Settings->value("RemoteDirTreeView").toByteArray()); // state of splitter - ui.splitter->restoreState(Settings->value("Splitter").toByteArray()); + ui.splitter->restoreState(Settings->value("RemoteSplitter").toByteArray()); // view type - ui.viewType_CB->setCurrentIndex(Settings->value("ViewType").toInt()); + ui.viewType_CB->setCurrentIndex(Settings->value("RemoteViewType").toInt()); } else { // save settings // state of trees - Settings->setValue("LocalDirTreeView", ui.localDirTreeView->header()->saveState()); - Settings->setValue("RemoteDirTreeView", ui.remoteDirTreeView->header()->saveState()); + Settings->setValue("RemoteDirTreeView", ui.dirTreeView->header()->saveState()); // state of splitter - Settings->setValue("Splitter", ui.splitter->saveState()); + Settings->setValue("RemoteSplitter", ui.splitter->saveState()); // view type - Settings->setValue("ViewType", ui.viewType_CB->currentIndex()); + Settings->setValue("RemoteViewType", ui.viewType_CB->currentIndex()); } Settings->endGroup(); @@ -291,8 +299,8 @@ void SharedFilesDialog::processSettings(bool bLoad) void SharedFilesDialog::changeCurrentViewModel(int c) { - disconnect( ui.remoteDirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), 0, 0 ); - disconnect( ui.remoteDirTreeView, SIGNAL( expanded(const QModelIndex & ) ), 0, 0 ); + disconnect( ui.dirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), 0, 0 ); + disconnect( ui.dirTreeView, SIGNAL( expanded(const QModelIndex & ) ), 0, 0 ); if(model!=NULL) model->setVisible(false) ; @@ -301,8 +309,8 @@ void SharedFilesDialog::changeCurrentViewModel(int c) { model = tree_model ; proxyModel = tree_proxyModel ; - ui.remoteDirTreeView->setColumnHidden(3,true) ; - ui.remoteDirTreeView->setColumnHidden(4,true) ; + ui.dirTreeView->setColumnHidden(3,true) ; + ui.dirTreeView->setColumnHidden(4,true) ; #ifdef DONT_USE_SEARCH_IN_TREE_VIEW ui.filterLabel->hide(); ui.filterPatternLineEdit->hide(); @@ -314,8 +322,8 @@ void SharedFilesDialog::changeCurrentViewModel(int c) { model = flat_model ; proxyModel = flat_proxyModel ; - ui.remoteDirTreeView->setColumnHidden(3,false) ; - ui.remoteDirTreeView->setColumnHidden(4,false) ; + ui.dirTreeView->setColumnHidden(3,false) ; + ui.dirTreeView->setColumnHidden(4,false) ; #ifdef DONT_USE_SEARCH_IN_TREE_VIEW ui.filterLabel->show(); ui.filterPatternLineEdit->show(); @@ -328,13 +336,13 @@ void SharedFilesDialog::changeCurrentViewModel(int c) model->update() ; } - connect( ui.remoteDirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), model, SLOT( collapsed(const QModelIndex & ) ) ); - connect( ui.remoteDirTreeView, SIGNAL( expanded(const QModelIndex & ) ), model, SLOT( expanded(const QModelIndex & ) ) ); + connect( ui.dirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), model, SLOT( collapsed(const QModelIndex & ) ) ); + connect( ui.dirTreeView, SIGNAL( expanded(const QModelIndex & ) ), model, SLOT( expanded(const QModelIndex & ) ) ); - ui.remoteDirTreeView->setModel(proxyModel); - ui.remoteDirTreeView->update(); + ui.dirTreeView->setModel(proxyModel); + ui.dirTreeView->update(); - ui.remoteDirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ; + ui.dirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ; #ifdef DONT_USE_SEARCH_IN_TREE_VIEW if(c == 1) @@ -342,16 +350,16 @@ void SharedFilesDialog::changeCurrentViewModel(int c) FilterItems(); } -void SharedFilesDialog::checkUpdate() +void LocalSharedFilesDialog::checkUpdate() { - /* update */ + /* update */ if (rsFiles->InDirectoryCheck()) { ui.checkButton->setText(tr("Checking...")); } else { - ui.checkButton->setText(tr("Check files")); + ui.checkButton->setText(tr("Check files")); ui.hashLabel->setPixmap(QPixmap(IMAGE_HASH_DONE)); ui.hashLabel->setToolTip("") ; } @@ -359,17 +367,15 @@ void SharedFilesDialog::checkUpdate() return; } - -void SharedFilesDialog::forceCheck() +void LocalSharedFilesDialog::forceCheck() { rsFiles->ForceDirectoryCheck(); return; } - -void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point ) +void RemoteSharedFilesDialog::spawnCustomPopupMenu( QPoint point ) { - QModelIndex idx = ui.remoteDirTreeView->indexAt(point); + QModelIndex idx = ui.dirTreeView->indexAt(point); if (!idx.isValid()) return; QModelIndex midx = proxyModel->mapToSource(idx); @@ -404,20 +410,9 @@ void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point ) contextMnu.exec(QCursor::pos()); } -QModelIndexList SharedFilesDialog::getLocalSelected() +QModelIndexList SharedFilesDialog::getSelected() { - QModelIndexList list = ui.localDirTreeView->selectionModel()->selectedIndexes(); - QModelIndexList proxyList; - for (QModelIndexList::iterator index = list.begin(); index != list.end(); index++) { - proxyList.append(localProxyModel->mapToSource(*index)); - } - - return proxyList; -} - -QModelIndexList SharedFilesDialog::getRemoteSelected() -{ - QModelIndexList list = ui.remoteDirTreeView->selectionModel()->selectedIndexes(); + QModelIndexList list = ui.dirTreeView->selectionModel()->selectedIndexes(); QModelIndexList proxyList; for (QModelIndexList::iterator index = list.begin(); index != list.end(); index++) { proxyList.append(proxyModel->mapToSource(*index)); @@ -426,27 +421,27 @@ QModelIndexList SharedFilesDialog::getRemoteSelected() return proxyList; } -void SharedFilesDialog::createCollectionFile() +void LocalSharedFilesDialog::createCollectionFile() { /* call back to the model (which does all the interfacing? */ std::cerr << "Creating a collection file!" << std::endl; - QModelIndexList lst = getLocalSelected(); - localModel->createCollectionFile(this, lst); + QModelIndexList lst = getSelected(); + model->createCollectionFile(this, lst); } -void SharedFilesDialog::downloadRemoteSelected() +void RemoteSharedFilesDialog::downloadRemoteSelected() { /* call back to the model (which does all the interfacing? */ std::cerr << "Downloading Files"; std::cerr << std::endl; - QModelIndexList lst = getRemoteSelected(); + QModelIndexList lst = getSelected(); model -> downloadSelected(lst); } -void SharedFilesDialog::editSharePermissions() +void LocalSharedFilesDialog::editSharePermissions() { std::list dirs; rsFiles->getSharedDirectories(dirs); @@ -468,10 +463,7 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote) { std::vector dirVec; - if (remote) - model->getDirDetailsFromSelect(lst, dirVec); - else - localModel->getDirDetailsFromSelect(lst, dirVec); + model->getDirDetailsFromSelect(lst, dirVec); QList urls ; @@ -509,55 +501,24 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote) RSLinkClipboard::copyLinks(urls) ; } -void SharedFilesDialog::copyLinkRemote() +void SharedFilesDialog::copyLink() { - QModelIndexList lst = getRemoteSelected(); - copyLink (lst, true); -} - -void SharedFilesDialog::copyLinkLocal() -{ - QModelIndexList lst = getLocalSelected(); - copyLink (lst, false); + copyLink ( getSelected() , true); } void SharedFilesDialog::copyLinkhtml( ) { - copyLinkLocal (); + copyLink(); QString link = QApplication::clipboard()->text(); QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(" " + link + ""); - -} - -void SharedFilesDialog::sendremoteLinkTo() -{ - copyLinkRemote (); - - /* create a message */ - MessageComposer *nMsgDialog = MessageComposer::newMsg(); - if (nMsgDialog == NULL) { - return; - } - - /* fill it in - * files are receommended already - * just need to set peers - */ - std::cerr << "SharedFilesDialog::sendremoteLinkTo()" << std::endl; - nMsgDialog->setTitleText(tr("RetroShare Link")); - nMsgDialog->setMsgText(RSLinkClipboard::toHtml(), true); - - nMsgDialog->show(); - - /* window will destroy itself! */ } void SharedFilesDialog::sendLinkTo() { - copyLinkLocal (); + copyLink(); /* create a message */ MessageComposer *nMsgDialog = MessageComposer::newMsg(); @@ -603,7 +564,7 @@ void SharedFilesDialog::addLinkToCloud() } #endif -void SharedFilesDialog::playselectedfiles() +void LocalSharedFilesDialog::playselectedfiles() { /* call back to the model (which does all the interfacing? */ @@ -611,19 +572,18 @@ void SharedFilesDialog::playselectedfiles() std::cerr << std::endl; std::list paths; - localModel -> getFilePaths(getLocalSelected(), paths); + model -> getFilePaths(getSelected(), paths); std::list::iterator it; QStringList fullpaths; for(it = paths.begin(); it != paths.end(); it++) { - std::string fullpath; - rsFiles->ConvertSharedFilePath(*it, fullpath); - fullpaths.push_back(QString::fromStdString(fullpath)); - - std::cerr << "Playing: " << fullpath; - std::cerr << std::endl; + std::string fullpath; + rsFiles->ConvertSharedFilePath(*it, fullpath); + fullpaths.push_back(QString::fromStdString(fullpath)); + std::cerr << "Playing: " << fullpath; + std::cerr << std::endl; } playFiles(fullpaths); @@ -632,35 +592,11 @@ void SharedFilesDialog::playselectedfiles() std::cerr << std::endl; } -void SharedFilesDialog::addMsgRemoteSelected() -{ - std::list files_info ; - - model->getFileInfoFromIndexList(getRemoteSelected(),files_info); - - if(files_info.empty()) - return ; - - /* create a message */ - - MessageComposer *nMsgDialog = MessageComposer::newMsg(); - if (nMsgDialog == NULL) { - return; - } - - nMsgDialog->setFileList(files_info) ; - nMsgDialog->setTitleText(tr("Recommendation(s)")); - nMsgDialog->setMsgText(tr("Recommendation(s)")); - nMsgDialog->show(); - - /* window will destroy itself! */ -} - void SharedFilesDialog::recommendFilesToMsg() { std::list files_info ; - localModel->getFileInfoFromIndexList(getLocalSelected(),files_info); + model->getFileInfoFromIndexList(getSelected(),files_info); if(files_info.empty()) return ; @@ -680,112 +616,89 @@ void SharedFilesDialog::recommendFilesToMsg() /* window will destroy itself! */ } -void SharedFilesDialog::openfile() +void LocalSharedFilesDialog::openfile() { - /* call back to the model (which does all the interfacing? */ + /* call back to the model (which does all the interfacing? */ - std::cerr << "SharedFilesDialog::openfile" << std::endl; + std::cerr << "SharedFilesDialog::openfile" << std::endl; - QModelIndexList qmil = getLocalSelected(); - localModel->openSelected(qmil); + QModelIndexList qmil = getSelected(); + model->openSelected(qmil); } -void SharedFilesDialog::openfolder() +void LocalSharedFilesDialog::openfolder() { std::cerr << "SharedFilesDialog::openfolder" << std::endl; - QModelIndexList qmil = getLocalSelected(); - localModel->openSelected(qmil); + QModelIndexList qmil = getSelected(); + model->openSelected(qmil); } -void SharedFilesDialog::preModDirectories(bool update_local) +void SharedFilesDialog::preModDirectories() { - //std::cerr << "SharedFilesDialog::preModDirectories called with update_local = " << update_local << std::endl ; - if (update_local) - localModel->preMods(); - else - model->preMods(); + model->preMods(); } - -void SharedFilesDialog::postModDirectories(bool update_local) +void SharedFilesDialog::postModDirectories() { - //std::cerr << "SharedFilesDialog::postModDirectories called with update_local = " << update_local << std::endl ; - if (update_local) - { - localModel->postMods(); - ui.localDirTreeView->update() ; - } - else - { - model->postMods(); - ui.remoteDirTreeView->update() ; + model->postMods(); + ui.dirTreeView->update() ; - if (ui.filterPatternLineEdit->text().isEmpty() == false) { - FilterItems(); - } - } + if (ui.filterPatternLineEdit->text().isEmpty() == false) + FilterItems(); QCoreApplication::flush(); } -void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point ) +void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point ) { - if (!rsPeers) { + if (!rsPeers) + { /* not ready yet! */ return; } - QModelIndex idx = ui.localDirTreeView->indexAt(point); + QModelIndex idx = ui.dirTreeView->indexAt(point); if (!idx.isValid()) return; - QModelIndex midx = localProxyModel->mapToSource(idx); + QModelIndex midx = proxyModel->mapToSource(idx); if (!midx.isValid()) return; - currentFile = localModel->data(midx, RetroshareDirModel::FileNameRole).toString(); + currentFile = model->data(midx, RetroshareDirModel::FileNameRole).toString(); - int type = localModel->getType(midx); + int type = model->getType(midx); QMenu contextMnu(this); -// QAction* menuAction = fileAssotiationAction(currentFile) ; -//new QAction(QIcon(IMAGE_PLAY), currentFile, this); -//tr( "111Play File(s)" ), this ); -// connect( openfolderAct , SIGNAL( triggered() ), this, -// SLOT( playselectedfiles() ) ); - - switch (type) { - case DIR_TYPE_DIR: - contextMnu.addAction(openfolderAct); - //contextMnu.addSeparator(); - //contextMnu.addAction(editshareAct) ; - contextMnu.addSeparator(); - contextMnu.addAction(createcollectionfileAct) ; - break; - case DIR_TYPE_FILE: - contextMnu.addAction(openfileAct); - contextMnu.addSeparator(); - contextMnu.addAction(copylinklocalAct); -// contextMnu.addAction(copylinklocalhtmlAct); - contextMnu.addAction(sendlinkAct); -// contextMnu.addAction(sendhtmllinkAct); - contextMnu.addSeparator(); - contextMnu.addAction(createcollectionfileAct) ; - contextMnu.addSeparator(); + switch (type) + { + case DIR_TYPE_DIR: + contextMnu.addAction(openfolderAct); + contextMnu.addSeparator() ; + contextMnu.addAction(createcollectionfileAct) ; + break; + case DIR_TYPE_FILE: + contextMnu.addAction(openfileAct); + contextMnu.addSeparator(); + contextMnu.addAction(copylinklocalAct); + contextMnu.addAction(sendlinkAct); + contextMnu.addSeparator(); + contextMnu.addAction(createcollectionfileAct) ; + contextMnu.addSeparator(); #ifdef RS_USE_LINKS - contextMnu.addAction(sendlinkCloudAct); - contextMnu.addAction(addlinkCloudAct); - contextMnu.addSeparator(); + contextMnu.addAction(sendlinkCloudAct); + contextMnu.addAction(addlinkCloudAct); + contextMnu.addSeparator(); #endif - contextMnu.addSeparator(); - contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(recommendFilesToMsg())); - break; - default: - return; - } + contextMnu.addSeparator(); + contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(recommendFilesToMsg())); + break; + default: + return; + } contextMnu.exec(QCursor::pos()); } @@ -793,7 +706,7 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point ) //============================================================================ QAction* -SharedFilesDialog::fileAssotiationAction(const QString /*fileName*/) +LocalSharedFilesDialog::fileAssotiationAction(const QString /*fileName*/) { QAction* result = 0; @@ -824,22 +737,17 @@ SharedFilesDialog::fileAssotiationAction(const QString /*fileName*/) //============================================================================ void -SharedFilesDialog::runCommandForFile() +LocalSharedFilesDialog::runCommandForFile() { QStringList tsl; tsl.append( currentFile ); QProcess::execute( currentCommand, tsl); - //QString("%1 %2").arg(currentCommand).arg(currentFile) ); - -// QString tmess = "Some command(%1) should be executed here for file %2"; -// tmess = tmess.arg(currentCommand).arg(currentFile); -// QMessageBox::warning(this, tr("RetroShare"), tmess, QMessageBox::Ok); } //============================================================================ void -SharedFilesDialog::tryToAddNewAssotiation() +LocalSharedFilesDialog::tryToAddNewAssotiation() { AddFileAssociationDialog afad(true, this);//'add file assotiations' dialog @@ -860,68 +768,62 @@ SharedFilesDialog::tryToAddNewAssotiation() /** Toggles the Splitted, Remote and Local View on and off*/ -void SharedFilesDialog::showFrame(bool show) -{ - if (show) { - ui.localframe->setVisible(true); - ui.remoteframe->setVisible(false); - - ui.localButton->setChecked(true); - - ui.remoteButton->setChecked(false); - ui.splittedButton->setChecked(false); - - ui.titleBarLabel->setText( tr("My Shared Files")); - } -} - -void SharedFilesDialog::showFrameRemote(bool show) -{ - if (show) { - ui.remoteframe->setVisible(true); - ui.localframe->setVisible(false); - - ui.remoteButton->setChecked(true); - ui.localButton->setChecked(false); - ui.splittedButton->setChecked(false); - - ui.titleBarLabel->setText( tr("Friends Files")); - } -} - -void SharedFilesDialog::showFrameSplitted(bool show) -{ - if (show) { - ui.remoteframe->setVisible(true); - ui.localframe->setVisible(true); - - ui.splittedButton->setChecked(true); - - ui.localButton->setChecked(false); - ui.remoteButton->setChecked(false); - - ui.titleBarLabel->setText( tr("Files")); - } -} +//== void SharedFilesDialog::showFrame(bool show) +//== { +//== if (show) { +//== ui.localframe->setVisible(true); +//== ui.remoteframe->setVisible(false); +//== +//== ui.localButton->setChecked(true); +//== +//== ui.remoteButton->setChecked(false); +//== ui.splittedButton->setChecked(false); +//== +//== ui.titleBarLabel->setText( tr("My Shared Files")); +//== } +//== } +//== +//== void SharedFilesDialog::showFrameRemote(bool show) +//== { +//== if (show) { +//== ui.remoteframe->setVisible(true); +//== ui.localframe->setVisible(false); +//== +//== ui.remoteButton->setChecked(true); +//== ui.localButton->setChecked(false); +//== ui.splittedButton->setChecked(false); +//== +//== ui.titleBarLabel->setText( tr("Friends Files")); +//== } +//== } +//== +//== void SharedFilesDialog::showFrameSplitted(bool show) +//== { +//== if (show) { +//== ui.remoteframe->setVisible(true); +//== ui.localframe->setVisible(true); +//== +//== ui.splittedButton->setChecked(true); +//== +//== ui.localButton->setChecked(false); +//== ui.remoteButton->setChecked(false); +//== +//== ui.titleBarLabel->setText( tr("Files")); +//== } +//== } void SharedFilesDialog::indicatorChanged(int index) { static uint32_t correct_indicator[4] = { IND_ALWAYS,IND_LAST_DAY,IND_LAST_WEEK,IND_LAST_MONTH } ; model->changeAgeIndicator(correct_indicator[index]); - localModel->changeAgeIndicator(correct_indicator[index]); - ui.remoteDirTreeView->update(ui.remoteDirTreeView->rootIndex()); - ui.localDirTreeView->update(ui.localDirTreeView->rootIndex()) ; + ui.dirTreeView->update(ui.dirTreeView->rootIndex()); if (correct_indicator[index] != IND_ALWAYS) - { - ui.remoteDirTreeView->sortByColumn(2, Qt::AscendingOrder); - } + ui.dirTreeView->sortByColumn(2, Qt::AscendingOrder); else - { - ui.remoteDirTreeView->sortByColumn(0, Qt::AscendingOrder); - } + ui.dirTreeView->sortByColumn(0, Qt::AscendingOrder); updateDisplay() ; } @@ -968,12 +870,12 @@ void SharedFilesDialog::FilterItems() setCursor(Qt::WaitCursor); QCoreApplication::processEvents() ; - int rowCount = ui.remoteDirTreeView->model()->rowCount(); + int rowCount = ui.dirTreeView->model()->rowCount(); for (int row = 0; row < rowCount; row++) if(proxyModel == tree_proxyModel) - tree_FilterItem(ui.remoteDirTreeView->model()->index(row, 0), text, 0); + tree_FilterItem(ui.dirTreeView->model()->index(row, 0), text, 0); else - flat_FilterItem(ui.remoteDirTreeView->model()->index(row, 0), text, 0); + flat_FilterItem(ui.dirTreeView->model()->index(row, 0), text, 0); setCursor(Qt::ArrowCursor); } @@ -982,12 +884,12 @@ bool SharedFilesDialog::flat_FilterItem(const QModelIndex &index, const QString { if(index.data(RetroshareDirModel::FileNameRole).toString().contains(text, Qt::CaseInsensitive)) { - ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), false); + ui.dirTreeView->setRowHidden(index.row(), index.parent(), false); return false ; } else { - ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), true); + ui.dirTreeView->setRowHidden(index.row(), index.parent(), true); return true ; } } @@ -1008,17 +910,17 @@ bool SharedFilesDialog::tree_FilterItem(const QModelIndex &index, const QString } int visibleChildCount = 0; - int rowCount = ui.remoteDirTreeView->model()->rowCount(index); + int rowCount = ui.dirTreeView->model()->rowCount(index); for (int row = 0; row < rowCount; row++) { - if (tree_FilterItem(ui.remoteDirTreeView->model()->index(row, index.column(), index), text, level + 1)) { + if (tree_FilterItem(ui.dirTreeView->model()->index(row, index.column(), index), text, level + 1)) { visibleChildCount++; } } if (visible || visibleChildCount) { - ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), false); + ui.dirTreeView->setRowHidden(index.row(), index.parent(), false); } else { - ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), true); + ui.dirTreeView->setRowHidden(index.row(), index.parent(), true); } return (visible || visibleChildCount); diff --git a/retroshare-gui/src/gui/SharedFilesDialog.h b/retroshare-gui/src/gui/SharedFilesDialog.h index 04f68d368..bc3352002 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.h +++ b/retroshare-gui/src/gui/SharedFilesDialog.h @@ -34,55 +34,40 @@ class SharedFilesDialog : public RsAutoUpdatePage public: /** Default Constructor */ - SharedFilesDialog(QWidget *parent = 0); - /** Default Destructor */ - ~SharedFilesDialog(); + SharedFilesDialog(RetroshareDirModel *tree_model,RetroshareDirModel *flat_model,QWidget *parent = 0); + + /** Default Destructor */ + ~SharedFilesDialog() {} - virtual void updatePage() { checkUpdate() ; } virtual void hideEvent(QHideEvent *) ; virtual void showEvent(QShowEvent *) ; +protected: + QTreeView *directoryView() ; private slots: + virtual void spawnCustomPopupMenu(QPoint point) = 0; /* For handling the model updates */ - void preModDirectories(bool update_local); - void postModDirectories(bool update_local); - - void checkUpdate(); - void forceCheck(); + void preModDirectories() ; + void postModDirectories() ; /** Create the context popup menu and it's submenus */ - void shareddirtreeviewCostumPopupMenu( QPoint point ); +// void customPopupMenu(QPoint point) ; - void sharedDirTreeWidgetContextMenu( QPoint point ); - - void downloadRemoteSelected(); - void createCollectionFile(); - void addMsgRemoteSelected(); - - void copyLinkRemote(); - void copyLinkLocal(); + void copyLink(); void copyLinkhtml(); void sendLinkTo(); - void sendremoteLinkTo(); #ifdef RS_USE_LINKS void sendLinkToCloud(); void addLinkToCloud(); #endif - void showFrame(bool show); - void showFrameRemote(bool show); - void showFrameSplitted(bool show); - - void playselectedfiles(); - void openfile(); - void openfolder(); - void editSharePermissions(); +//== void showFrame(bool show); +//== void showFrameRemote(bool show); +//== void showFrameSplitted(bool show); void recommendFilesToMsg(); - void runCommandForFile(); - void tryToAddNewAssotiation(); void indicatorChanged(int index); @@ -95,7 +80,12 @@ private slots: signals: void playFiles(QStringList files); -private: +protected: + /** Qt Designer generated object */ + Ui::SharedFilesDialog ui; + virtual void processSettings(bool bLoad) = 0; + +protected: //now context menu are created again every time theu are called ( in some //slots.. Maybe it's not good... //** Define the popup menus for the Context menu */ @@ -103,16 +93,13 @@ private: //QMenu* contextMnu2; - void processSettings(bool bLoad); - void copyLink (const QModelIndexList& lst, bool remote); void FilterItems(); bool tree_FilterItem(const QModelIndex &index, const QString &text, int level); bool flat_FilterItem(const QModelIndex &index, const QString &text, int level); - QModelIndexList getRemoteSelected(); - QModelIndexList getLocalSelected(); + QModelIndexList getSelected(); /** Defines the actions for the context menu for QTreeWidget */ QAction* openfileAct; @@ -129,9 +116,6 @@ private: QAction* sendchatlinkAct; QAction* copylinklocalhtmlAct; - /** Qt Designer generated object */ - Ui::SharedFilesDialog ui; - /* RetroshareDirModel */ RetroshareDirModel *tree_model; RetroshareDirModel *flat_model; @@ -140,15 +124,54 @@ private: QSortFilterProxyModel *flat_proxyModel; QSortFilterProxyModel *proxyModel; - RetroshareDirModel *localModel; - QSortFilterProxyModel *localProxyModel; - QString currentCommand; QString currentFile; QString lastFilterString; +}; - QAction* fileAssotiationAction(const QString fileName); +class LocalSharedFilesDialog : public SharedFilesDialog +{ + Q_OBJECT + + public: + LocalSharedFilesDialog(QWidget *parent=NULL) ; + virtual ~LocalSharedFilesDialog(); + + virtual void spawnCustomPopupMenu(QPoint point); + virtual void updatePage() { checkUpdate() ; } + + protected: + virtual void processSettings(bool bLoad) ; + + private slots: + void createCollectionFile(); + void checkUpdate() ; + void editSharePermissions(); + void playselectedfiles(); + void openfile(); + void openfolder(); + void runCommandForFile(); + void tryToAddNewAssotiation(); + void forceCheck(); + + QAction* fileAssotiationAction(const QString fileName); +}; +class RemoteSharedFilesDialog : public SharedFilesDialog +{ + Q_OBJECT + + public: + RemoteSharedFilesDialog(QWidget *parent=NULL) ; + virtual ~RemoteSharedFilesDialog() ; + + virtual void spawnCustomPopupMenu(QPoint point); + + protected: + virtual void processSettings(bool bLoad) ; + + private slots: + void downloadRemoteSelected(); }; #endif diff --git a/retroshare-gui/src/gui/SharedFilesDialog.ui b/retroshare-gui/src/gui/SharedFilesDialog.ui index ec0e3e49c..a9f804e10 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.ui +++ b/retroshare-gui/src/gui/SharedFilesDialog.ui @@ -14,167 +14,6 @@ 0 - - - - Qt::Vertical - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - - - - 4 - 0 - - - - Qt::CustomContextMenu - - - true - - - QAbstractItemView::DragOnly - - - false - - - 0 - - - true - - - true - - - false - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - - - - 0 - 0 - - - - Qt::CustomContextMenu - - - false - - - true - - - QAbstractItemView::DragOnly - - - false - - - QAbstractItemView::ContiguousSelection - - - true - - - false - - - - - - - - - - - 2 - - - - - - 140 - 0 - - - - - 16777215 - 28 - - - - Download selected - - - Download - - - - :/images/download16.png:/images/download16.png - - - - - - - Qt::Horizontal - - - - 391 - 20 - - - - - - - - check files - - - - - - - - - - - - @@ -297,8 +136,7 @@ - - + Qt::NoFocus @@ -330,8 +168,7 @@ - - + Qt::NoFocus @@ -416,89 +253,102 @@ border-image: url(:/images/closepressed.png) - - - - 24 - 24 - - - - Qt::NoFocus - - - Split View - - - - :/images/view_split_top_bottom.png:/images/view_split_top_bottom.png - - - true - - - true - - - true + + + - - - - 24 - 24 - - - - Qt::NoFocus - - - Friends Folders - - - - :/images/friendsfolder24.png:/images/friendsfolder24.png - - - true - - - true + + + check files - - + + - 24 - 24 + 140 + 0 - - Qt::NoFocus + + + 16777215 + 28 + - My Folders + Download selected + + + Download - :/images/folder16.png:/images/folder16.png - - - true - - - true + :/images/download16.png:/images/download16.png + + + + Qt::Vertical + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + + + + 4 + 0 + + + + Qt::CustomContextMenu + + + true + + + QAbstractItemView::DragOnly + + + false + + + 0 + + + true + + + true + + + false + + + + + + + diff --git a/retroshare-gui/src/gui/TransfersDialog.cpp b/retroshare-gui/src/gui/TransfersDialog.cpp index ff538c63e..c30cc2fb9 100644 --- a/retroshare-gui/src/gui/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/TransfersDialog.cpp @@ -43,6 +43,7 @@ #include "ULListDelegate.h" #include "FileTransferInfoWidget.h" #include "SearchDialog.h" +#include "SharedFilesDialog.h" #include "xprogressbar.h" #include "settings/rsharesettings.h" #include "util/misc.h" @@ -304,6 +305,9 @@ TransfersDialog::TransfersDialog(QWidget *parent) QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ; ui.tabWidget->insertTab(0,searchDialog = new SearchDialog(), QIcon(IMAGE_SEARCH), tr("Search")) ; + ui.tabWidget->insertTab(1,remoteSharedFiles = new RemoteSharedFilesDialog(), QIcon(IMAGE_SEARCH), tr("Friends files")) ; + + ui.tabWidget->addTab(localSharedFiles = new LocalSharedFilesDialog(), QIcon(IMAGE_SEARCH), tr("Your files")) ; //ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ; //ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ; diff --git a/retroshare-gui/src/gui/TransfersDialog.h b/retroshare-gui/src/gui/TransfersDialog.h index e74b3346c..3f493c641 100644 --- a/retroshare-gui/src/gui/TransfersDialog.h +++ b/retroshare-gui/src/gui/TransfersDialog.h @@ -37,6 +37,8 @@ class QStandardItem; class DetailsDialog; class FileProgressInfo; class SearchDialog; +class LocalSharedFilesDialog; +class RemoteSharedFilesDialog; class TransfersDialog : public RsAutoUpdatePage { @@ -56,6 +58,8 @@ public: static DetailsDialog *detailsdlg; SearchDialog *searchDialog ; + LocalSharedFilesDialog *localSharedFiles ; + RemoteSharedFilesDialog *remoteSharedFiles ; public slots: void insertTransfers(); diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index fc0ec2f30..29aadda49 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -325,9 +325,11 @@ int main(int argc, char *argv[]) std::cerr << "connecting signals and slots" << std::endl ; QObject::connect(notify,SIGNAL(gotTurtleSearchResult(qulonglong,FileDetail)),w->transfersDialog->searchDialog ,SLOT(updateFiles(qulonglong,FileDetail))) ; QObject::connect(notify,SIGNAL(diskFull(int,int)) ,w ,SLOT(displayDiskSpaceWarning(int,int))) ; - QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->sharedfilesDialog ,SLOT(preModDirectories(bool) )) ; - QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->sharedfilesDialog ,SLOT(postModDirectories(bool) )) ; - QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w ,SLOT(postModDirectories(bool) )) ; + QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->transfersDialog->localSharedFiles ,SLOT(preModDirectories(bool) )) ; + QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->transfersDialog->remoteSharedFiles ,SLOT(preModDirectories(bool) )) ; + QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->transfersDialog->localSharedFiles ,SLOT(postModDirectories(bool) )) ; + QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->transfersDialog->remoteSharedFiles ,SLOT(postModDirectories(bool) )) ; + QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w ,SLOT(postModDirectories(bool) )) ; QObject::connect(notify,SIGNAL(transfersChanged()) ,w->transfersDialog ,SLOT(insertTransfers() )) ; QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->friendsDialog ,SLOT(publicChatChanged(int) )); QObject::connect(notify,SIGNAL(neighboursChanged()) ,w->friendsDialog->networkDialog ,SLOT(insertConnect() )) ;