Recreate the preferences dialog every time, to avoid displaying unsaved changes

This commit is contained in:
Olivier Teulière 2012-03-05 22:23:10 +01:00
parent cf6cec0527
commit ff21e64a7f
2 changed files with 5 additions and 12 deletions

View file

@ -73,7 +73,7 @@ const char *MainWindow::m_windowName = "MainWindow";
MainWindow::MainWindow(QWidget *iParent)
: QMainWindow(iParent), m_dic(NULL), m_game(NULL),
m_newGameDialog(NULL), m_prefsDialog(NULL),
m_newGameDialog(NULL),
m_playersWidget(NULL), m_trainingWidget(NULL),
m_arbitrationWidget(NULL), m_scoresWidget(NULL),
m_bagWindow(NULL), m_boardWindow(NULL),
@ -978,13 +978,10 @@ void MainWindow::onGameQuit()
void MainWindow::onSettingsPreferences()
{
if (m_prefsDialog == NULL)
{
m_prefsDialog = new PrefsDialog(this);
QObject::connect(m_prefsDialog, SIGNAL(prefsUpdated()),
this, SLOT(prefsUpdated()));
}
m_prefsDialog->exec();
PrefsDialog *prefsDialog = new PrefsDialog(this);
QObject::connect(prefsDialog, SIGNAL(prefsUpdated()),
this, SLOT(prefsUpdated()));
prefsDialog->exec();
}

View file

@ -34,7 +34,6 @@ class Board;
class History;
class PublicGame;
class NewGame;
class PrefsDialog;
class PlayerTabWidget;
class ScoreWidget;
class TrainingWidget;
@ -127,9 +126,6 @@ private:
/// Dialog for creating a new game
NewGame *m_newGameDialog;
/// Dialog for the preferences
PrefsDialog *m_prefsDialog;
/// Widget for the players
PlayerTabWidget *m_playersWidget;