Fixed crash when closing the settings dialog.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5605 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-09-25 23:51:13 +00:00
parent 29e44ddafa
commit 5726c1ec18
4 changed files with 38 additions and 36 deletions

View File

@ -60,14 +60,6 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WFlags flags)
#endif
}
AppearancePage::~AppearancePage()
{
if (wasLoaded()) {
/* reaload style sheet */
Rshare::loadStyleSheet(Settings->getSheetName());
}
}
/** Saves the changes on this page */
bool AppearancePage::save(QString &errmsg)
{

View File

@ -32,8 +32,6 @@ class AppearancePage : public ConfigPage
public:
/** Default Constructor */
AppearancePage(QWidget * parent = 0, Qt::WFlags flags = 0);
/** Default Destructor */
~AppearancePage();
/** Saves the changes on this page */
virtual bool save(QString &errmsg);

View File

@ -22,6 +22,7 @@
#include <QMessageBox>
#include <retroshare/rsplugin.h>
#include <rshare.h>
#include "GeneralPage.h"
#include "DirectoriesPage.h"
#include "ServerPage.h"
@ -37,6 +38,7 @@
#include "MessagePage.h"
#include "ForumPage.h"
#include "PluginsPage.h"
#include "rsharesettings.h"
#define IMAGE_GENERAL ":/images/kcmsystem24.png"
@ -57,6 +59,7 @@ RSettingsWin::RSettingsWin(QWidget * parent, Qt::WFlags flags)
connect(listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(setNewPage(int)));
connect(applyButton, SIGNAL(clicked( bool )), this, SLOT( saveChanges()) );
connect(this, SIGNAL(finished(int)), this, SLOT(dialogFinished(int)));
}
RSettingsWin::~RSettingsWin()
@ -65,6 +68,14 @@ RSettingsWin::~RSettingsWin()
_instance = NULL;
}
void RSettingsWin::dialogFinished(int result)
{
if (result == Rejected) {
/* reaload style sheet */
Rshare::loadStyleSheet(::Settings->getSheetName());
}
}
/*static*/ void RSettingsWin::showYourself(QWidget *parent, PageType page /* = LastPage*/)
{
if(_instance == NULL) {

View File

@ -26,7 +26,6 @@
#include <retroshare-gui/configpage.h>
#include "ui_settings.h"
class RSettingsWin: public QDialog, private Ui::Settings
{
Q_OBJECT
@ -43,6 +42,7 @@ class RSettingsWin: public QDialog, private Ui::Settings
~RSettingsWin();
void addPage(ConfigPage*) ;
public slots:
//! Go to a specific part of the control panel.
void setNewPage(int page);
@ -50,6 +50,7 @@ class RSettingsWin: public QDialog, private Ui::Settings
private slots:
/** Called when user clicks "Save Settings" */
void saveChanges();
void dialogFinished(int result);
private:
void initStackedWidget();