Commit 81c5145f authored by Matt Edman's avatar Matt Edman
Browse files

Check the appropriate config page action when we display that page if its save() fails.


svn:r534
parent 94d46294
Loading
Loading
Loading
Loading
+1 −1
Changes for src/gui/config/configdialog.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ ConfigDialog::saveChanges()
  foreach (ConfigPage *page, ui.stackPages->pages()) {
    if (!page->save(errmsg)) {
      /* Display the offending page */
      ui.stackPages->setCurrentWidget(page);
      ui.stackPages->setCurrentPage(page);
      
      /* Show the user what went wrong */
      QMessageBox::warning(this, 
+11 −0
Changes for src/gui/config/configpagestack.cpp: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
 * \version $Id$
 */

#include <QAction>
#include "configpagestack.h"

/** Default constructor. */
@@ -40,6 +41,16 @@ ConfigPageStack::add(ConfigPage *page, QAction *action)
  insertWidget(count(), page);
}

/** Sets the current config page and checks its action. */
void
ConfigPageStack::setCurrentPage(ConfigPage *page)
{
  foreach (QAction *action, _pages.keys(page)) {
    action->setChecked(true);
  }
  setCurrentWidget(page);
}

/** Shows the config page associated with the activated action. */
void
ConfigPageStack::showPage(QAction *pageAction)
+2 −0
Changes for src/gui/config/configpagestack.h: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ public:

  /** Adds a configuration page to the stack. */
  void add(ConfigPage *page, QAction *action);
  /** Sets the current config page and checks its action. */
  void setCurrentPage(ConfigPage *page);
  
  /** Returns a list of all pages in the stack. */
  QList<ConfigPage*> pages() { return _pages.values(); }