From 4e2f454907ebe038bff90ce4ef18619d56282208 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 14 Nov 2012 22:56:25 +0000 Subject: [PATCH] reduced calls to flags/group update code to the minimum, to avoid sending file lists except when the share manager / share dialog gets closed git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5822 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/ShareDialog.cpp | 2 +- retroshare-gui/src/gui/ShareManager.cpp | 12 ++++++++++-- retroshare-gui/src/gui/ShareManager.h | 1 + retroshare-gui/src/gui/ShareManager.ui | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/ShareDialog.cpp b/retroshare-gui/src/gui/ShareDialog.cpp index 2b802dc5a..34f0c0398 100644 --- a/retroshare-gui/src/gui/ShareDialog.cpp +++ b/retroshare-gui/src/gui/ShareDialog.cpp @@ -77,7 +77,7 @@ ShareDialog::ShareDialog(std::string filename, QWidget *parent) updateInfoMessage() ; connect(groupselectionbox,SIGNAL(itemSelectionChanged()),this,SLOT(updateInfoMessage())) ; - connect(groupselectionbox,SIGNAL(itemSelectionChanged()),this,SLOT(groupSelectionChanged())) ; +// connect(groupselectionbox,SIGNAL(itemSelectionChanged()),this,SLOT(groupSelectionChanged())) ; connect(groupflagsbox,SIGNAL(flagsChanged(FileStorageFlags)),this,SLOT(updateInfoMessage())) ; if (!filename.empty()) diff --git a/retroshare-gui/src/gui/ShareManager.cpp b/retroshare-gui/src/gui/ShareManager.cpp index 509e8bcb7..5ba117d14 100644 --- a/retroshare-gui/src/gui/ShareManager.cpp +++ b/retroshare-gui/src/gui/ShareManager.cpp @@ -66,7 +66,7 @@ ShareManager::ShareManager() connect(ui.addButton, SIGNAL(clicked( bool ) ), this , SLOT( showShareDialog() ) ); connect(ui.editButton, SIGNAL(clicked( bool ) ), this , SLOT( editShareDirectory() ) ); connect(ui.removeButton, SIGNAL(clicked( bool ) ), this , SLOT( removeShareDirectory() ) ); - connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(close())); + connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(applyAndClose())); connect(ui.shareddirList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(shareddirListCostumPopupMenu(QPoint))); connect(ui.shareddirList, SIGNAL(currentCellChanged(int,int,int,int)), this, SLOT(shareddirListCurrentCellChanged(int,int,int,int))); @@ -95,6 +95,14 @@ ShareManager::~ShareManager() Settings->saveWidgetInformation(this); } +void ShareManager::applyAndClose() +{ + std::cerr << "ShareManager:::close(): updating!" << std::endl; + + updateFlags() ; + close() ; +} + void ShareManager::shareddirListCostumPopupMenu( QPoint /*point*/ ) { QMenu contextMnu( this ); @@ -141,7 +149,7 @@ void ShareManager::load() listWidget->setItem(row, COLUMN_GROUPS, new QTableWidgetItem()) ; listWidget->item(row,COLUMN_GROUPS)->setBackgroundColor(QColor(183,236,181)) ; - connect(widget,SIGNAL(flagsChanged(FileStorageFlags)),this,SLOT(updateFlags())) ; + //connect(widget,SIGNAL(flagsChanged(FileStorageFlags)),this,SLOT(updateFlags())) ; } listWidget->setColumnWidth(COLUMN_SHARE_FLAGS,132) ; diff --git a/retroshare-gui/src/gui/ShareManager.h b/retroshare-gui/src/gui/ShareManager.h index 79f284e58..93cce9aee 100644 --- a/retroshare-gui/src/gui/ShareManager.h +++ b/retroshare-gui/src/gui/ShareManager.h @@ -61,6 +61,7 @@ private slots: void removeShareDirectory(); void updateFlags(); void updateGroups(); + void applyAndClose() ; private: static ShareManager *_instance; diff --git a/retroshare-gui/src/gui/ShareManager.ui b/retroshare-gui/src/gui/ShareManager.ui index bb9b948ab..5673bcdc1 100644 --- a/retroshare-gui/src/gui/ShareManager.ui +++ b/retroshare-gui/src/gui/ShareManager.ui @@ -208,7 +208,7 @@ p, li { white-space: pre-wrap; } - Close + Apply and close