mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-23 22:49:37 -05:00
- The settings in the settings window are only loaded once.
- Saving the settings without changing the network settings doesn't shutdown the connections git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2786 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
78644a2441
commit
38e06135a4
@ -2603,6 +2603,8 @@ bool p3ConnectMgr::setLocalAddress(std::string id, struct sockaddr_in addr)
|
|||||||
|
|
||||||
if (id == AuthSSL::getAuthSSL()->OwnId())
|
if (id == AuthSSL::getAuthSSL()->OwnId())
|
||||||
{
|
{
|
||||||
|
if (ownState.currentlocaladdr.sin_addr.s_addr != addr.sin_addr.s_addr ||
|
||||||
|
ownState.currentlocaladdr.sin_port != addr.sin_port) {
|
||||||
{
|
{
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
ownState.currentlocaladdr = addr;
|
ownState.currentlocaladdr = addr;
|
||||||
@ -2619,6 +2621,7 @@ bool p3ConnectMgr::setLocalAddress(std::string id, struct sockaddr_in addr)
|
|||||||
(ownState.netMode & RS_NET_MODE_ACTUAL) == RS_NET_MODE_UDP) {
|
(ownState.netMode & RS_NET_MODE_ACTUAL) == RS_NET_MODE_UDP) {
|
||||||
netReset();
|
netReset();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ RSettingsWin::closeEvent (QCloseEvent * event)
|
|||||||
|
|
||||||
if (update_local) {
|
if (update_local) {
|
||||||
if (_instance->stackedWidget->currentIndex() == Directories) {
|
if (_instance->stackedWidget->currentIndex() == Directories) {
|
||||||
ConfigPage *Page = (ConfigPage*) _instance->stackedWidget->currentWidget();
|
ConfigPage *Page = dynamic_cast<ConfigPage *> (_instance->stackedWidget->currentWidget());
|
||||||
if (Page) {
|
if (Page) {
|
||||||
Page->load();
|
Page->load();
|
||||||
}
|
}
|
||||||
@ -110,6 +110,8 @@ RSettingsWin::initStackedWidget()
|
|||||||
stackedWidget->addWidget(new SoundPage() );
|
stackedWidget->addWidget(new SoundPage() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
loadSettings(); /* load saved settings */
|
||||||
|
|
||||||
setNewPage(General);
|
setNewPage(General);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +165,6 @@ RSettingsWin::setNewPage(int page)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pageName->setText(text);
|
pageName->setText(text);
|
||||||
loadSettings(); /* load saved settings */
|
|
||||||
stackedWidget->setCurrentIndex(page);
|
stackedWidget->setCurrentIndex(page);
|
||||||
listWidget->setCurrentRow(page);
|
listWidget->setCurrentRow(page);
|
||||||
}
|
}
|
||||||
@ -174,9 +175,11 @@ RSettingsWin::loadSettings()
|
|||||||
/* Call each config page's load() method to load its data */
|
/* Call each config page's load() method to load its data */
|
||||||
int i, count = stackedWidget->count();
|
int i, count = stackedWidget->count();
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
ConfigPage *page = (ConfigPage *) stackedWidget->widget(i);
|
ConfigPage *page = dynamic_cast<ConfigPage *> (stackedWidget->widget(i));
|
||||||
|
if (page) {
|
||||||
page->load();
|
page->load();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Saves changes made to settings. */
|
/** Saves changes made to settings. */
|
||||||
@ -191,7 +194,7 @@ RSettingsWin::saveChanges()
|
|||||||
{
|
{
|
||||||
ConfigPage *page = dynamic_cast<ConfigPage *>(stackedWidget->widget(i));
|
ConfigPage *page = dynamic_cast<ConfigPage *>(stackedWidget->widget(i));
|
||||||
|
|
||||||
if(!page->save(errmsg))
|
if(page && !page->save(errmsg))
|
||||||
{
|
{
|
||||||
/* Display the offending page */
|
/* Display the offending page */
|
||||||
stackedWidget->setCurrentWidget(page);
|
stackedWidget->setCurrentWidget(page);
|
||||||
|
Loading…
Reference in New Issue
Block a user