mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 06:09:09 -04:00
changed a few pages to not requiring to call save()
This commit is contained in:
parent
53a1993842
commit
bd379e6b89
23 changed files with 166 additions and 217 deletions
|
@ -141,7 +141,7 @@ SettingsPage::initStackedWidget()
|
|||
ui.stackedWidget->setCurrentIndex(-1);
|
||||
ui.stackedWidget->removeWidget(ui.stackedWidget->widget(0));
|
||||
|
||||
addPage(new GeneralPage(0));
|
||||
addPage(new GeneralPage());
|
||||
addPage(new ServerPage());
|
||||
addPage(new TransferPage());
|
||||
addPage(new RelayPage() );
|
||||
|
@ -211,39 +211,11 @@ SettingsPage::setNewPage(int page)
|
|||
}
|
||||
|
||||
/** Saves changes made to settings. */
|
||||
void
|
||||
SettingsPage::saveChanges()
|
||||
void SettingsPage::notifySettingsChanged()
|
||||
{
|
||||
QString errmsg;
|
||||
|
||||
/* Call each config page's save() method to save its data */
|
||||
int i, count = ui.stackedWidget->count();
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
ConfigPage *page = dynamic_cast<ConfigPage *>(ui.stackedWidget->widget(i));
|
||||
if (page && page->wasLoaded()) {
|
||||
if (!page->save(errmsg))
|
||||
{
|
||||
/* Display the offending page */
|
||||
ui.stackedWidget->setCurrentWidget(page);
|
||||
|
||||
/* Show the user what went wrong */
|
||||
QMessageBox::warning(this,
|
||||
tr("Error Saving Configuration on page")+" "+QString::number(i), errmsg,
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
|
||||
/* Don't process the rest of the pages */
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* call to RsIface save function.... */
|
||||
//rsicontrol -> ConfigSave();
|
||||
|
||||
if (NotifyQt::getInstance()) {
|
||||
if (NotifyQt::getInstance())
|
||||
NotifyQt::getInstance()->notifySettingsChanged();
|
||||
}
|
||||
|
||||
close();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue