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
This commit is contained in:
csoler 2012-11-14 22:56:25 +00:00
parent 7fa9dbb2b1
commit 4e2f454907
4 changed files with 13 additions and 4 deletions

View File

@ -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())

View File

@ -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) ;

View File

@ -61,6 +61,7 @@ private slots:
void removeShareDirectory();
void updateFlags();
void updateGroups();
void applyAndClose() ;
private:
static ShareManager *_instance;

View File

@ -208,7 +208,7 @@ p, li { white-space: pre-wrap; }
<item row="1" column="4">
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
<string>Apply and close</string>
</property>
</widget>
</item>