- 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:
thunder2 2010-04-25 23:28:10 +00:00
parent 78644a2441
commit 38e06135a4
2 changed files with 26 additions and 20 deletions

View file

@ -84,7 +84,7 @@ RSettingsWin::closeEvent (QCloseEvent * event)
if (update_local) {
if (_instance->stackedWidget->currentIndex() == Directories) {
ConfigPage *Page = (ConfigPage*) _instance->stackedWidget->currentWidget();
ConfigPage *Page = dynamic_cast<ConfigPage *> (_instance->stackedWidget->currentWidget());
if (Page) {
Page->load();
}
@ -110,6 +110,8 @@ RSettingsWin::initStackedWidget()
stackedWidget->addWidget(new SoundPage() );
#endif
loadSettings(); /* load saved settings */
setNewPage(General);
}
@ -163,7 +165,6 @@ RSettingsWin::setNewPage(int page)
}
pageName->setText(text);
loadSettings(); /* load saved settings */
stackedWidget->setCurrentIndex(page);
listWidget->setCurrentRow(page);
}
@ -171,12 +172,14 @@ RSettingsWin::setNewPage(int page)
void
RSettingsWin::loadSettings()
{
/* Call each config page's load() method to load its data */
int i, count = stackedWidget->count();
for (i = 0; i < count; i++) {
ConfigPage *page = (ConfigPage *) stackedWidget->widget(i);
page->load();
}
/* Call each config page's load() method to load its data */
int i, count = stackedWidget->count();
for (i = 0; i < count; i++) {
ConfigPage *page = dynamic_cast<ConfigPage *> (stackedWidget->widget(i));
if (page) {
page->load();
}
}
}
/** Saves changes made to settings. */
@ -191,7 +194,7 @@ RSettingsWin::saveChanges()
{
ConfigPage *page = dynamic_cast<ConfigPage *>(stackedWidget->widget(i));
if(!page->save(errmsg))
if(page && !page->save(errmsg))
{
/* Display the offending page */
stackedWidget->setCurrentWidget(page);