#6538 Removed appconfig saveSettings calls from external classes, update serverconfig to derived class
This commit is contained in:
parent
73b9f40a44
commit
ad1429e9aa
6 changed files with 12 additions and 18 deletions
|
|
@ -54,7 +54,6 @@ void ActivationDialog::reject()
|
||||||
if (QDialog::Accepted == cancelActivationDialog.exec()) {
|
if (QDialog::Accepted == cancelActivationDialog.exec()) {
|
||||||
m_LicenseManager->skipActivation();
|
m_LicenseManager->skipActivation();
|
||||||
m_appConfig->activationHasRun(true);
|
m_appConfig->activationHasRun(true);
|
||||||
m_appConfig->saveSettings();
|
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -66,7 +65,6 @@ void ActivationDialog::accept()
|
||||||
{
|
{
|
||||||
QMessageBox message;
|
QMessageBox message;
|
||||||
m_appConfig->activationHasRun(true);
|
m_appConfig->activationHasRun(true);
|
||||||
m_appConfig->saveSettings();
|
|
||||||
|
|
||||||
std::pair<bool, QString> result;
|
std::pair<bool, QString> result;
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,6 @@ LicenseManager::setSerialKey(SerialKey serialKey, bool acceptExpired)
|
||||||
emit beginTrial(m_serialKey.isExpiring(currentTime));
|
emit beginTrial(m_serialKey.isExpiring(currentTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_AppConfig->saveSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -118,7 +116,6 @@ void LicenseManager::refresh()
|
||||||
setSerialKey(serialKey, true);
|
setSerialKey(serialKey, true);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
m_AppConfig->clearSerialKey();
|
m_AppConfig->clearSerialKey();
|
||||||
m_AppConfig->saveSettings();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m_serialKey.isExpired(::time(0))) {
|
if (m_serialKey.isExpired(::time(0))) {
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ static const struct
|
||||||
|
|
||||||
const int serverDefaultIndex = 7;
|
const int serverDefaultIndex = 7;
|
||||||
|
|
||||||
ServerConfig::ServerConfig(AppConfig* appConfig, int numColumns, int numRows ,
|
ServerConfig::ServerConfig(int numColumns, int numRows ,
|
||||||
QString serverName, MainWindow* mainWindow) :
|
QString serverName, MainWindow* mainWindow) :
|
||||||
m_pAppConfig(appConfig),
|
|
||||||
m_Screens(),
|
m_Screens(),
|
||||||
m_NumColumns(numColumns),
|
m_NumColumns(numColumns),
|
||||||
m_NumRows(numRows),
|
m_NumRows(numRows),
|
||||||
|
|
@ -56,8 +56,7 @@ ServerConfig::ServerConfig(AppConfig* appConfig, int numColumns, int numRows ,
|
||||||
m_ClipboardSharingSize(defaultClipboardSharingSize()),
|
m_ClipboardSharingSize(defaultClipboardSharingSize()),
|
||||||
m_pMainWindow(mainWindow)
|
m_pMainWindow(mainWindow)
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_pAppConfig);
|
GUI::Config::ConfigWriter::make()->registerClass(this);
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,6 +141,9 @@ void ServerConfig::saveSettings()
|
||||||
settings().endArray();
|
settings().endArray();
|
||||||
|
|
||||||
settings().endGroup();
|
settings().endGroup();
|
||||||
|
|
||||||
|
//Tell the config writer there are changes
|
||||||
|
GUI::Config::ConfigWriter::make()->markUnsaved();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerConfig::loadSettings()
|
void ServerConfig::loadSettings()
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
#include "BaseConfig.h"
|
#include "BaseConfig.h"
|
||||||
#include "Hotkey.h"
|
#include "Hotkey.h"
|
||||||
|
#include "ConfigBase.h"
|
||||||
|
|
||||||
class QTextStream;
|
class QTextStream;
|
||||||
class QSettings;
|
class QSettings;
|
||||||
|
|
@ -34,13 +35,13 @@ class ServerConfigDialog;
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class AppConfig;
|
class AppConfig;
|
||||||
|
|
||||||
class ServerConfig : public BaseConfig
|
class ServerConfig : public BaseConfig, public GUI::Config::ConfigBase
|
||||||
{
|
{
|
||||||
friend class ServerConfigDialog;
|
friend class ServerConfigDialog;
|
||||||
friend QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config);
|
friend QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ServerConfig(AppConfig* settings, int numColumns, int numRows,
|
ServerConfig(int numColumns, int numRows,
|
||||||
QString serverName, MainWindow* mainWindow);
|
QString serverName, MainWindow* mainWindow);
|
||||||
~ServerConfig();
|
~ServerConfig();
|
||||||
|
|
||||||
|
|
@ -68,8 +69,8 @@ class ServerConfig : public BaseConfig
|
||||||
size_t clipboardSharingSize() const { return m_ClipboardSharingSize; }
|
size_t clipboardSharingSize() const { return m_ClipboardSharingSize; }
|
||||||
static size_t defaultClipboardSharingSize();
|
static size_t defaultClipboardSharingSize();
|
||||||
|
|
||||||
void saveSettings();
|
void saveSettings() override;
|
||||||
void loadSettings();
|
void loadSettings() override;
|
||||||
bool save(const QString& fileName) const;
|
bool save(const QString& fileName) const;
|
||||||
void save(QFile& file) const;
|
void save(QFile& file) const;
|
||||||
int numScreens() const;
|
int numScreens() const;
|
||||||
|
|
@ -111,7 +112,6 @@ class ServerConfig : public BaseConfig
|
||||||
void addToFirstEmptyGrid(const QString& clientName);
|
void addToFirstEmptyGrid(const QString& clientName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AppConfig* m_pAppConfig;
|
|
||||||
ScreenList m_Screens;
|
ScreenList m_Screens;
|
||||||
int m_NumColumns;
|
int m_NumColumns;
|
||||||
int m_NumRows;
|
int m_NumRows;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ void SettingsDialog::accept()
|
||||||
|
|
||||||
//We only need to test the System scoped Radio as they are connected
|
//We only need to test the System scoped Radio as they are connected
|
||||||
appConfig().setLoadFromSystemScope(m_pRadioSystemScope->isChecked());
|
appConfig().setLoadFromSystemScope(m_pRadioSystemScope->isChecked());
|
||||||
appConfig().saveSettings();
|
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,7 +200,6 @@ void SettingsDialog::on_m_pComboLanguage_currentIndexChanged(int index)
|
||||||
void SettingsDialog::on_m_pCheckBoxEnableCrypto_toggled(bool checked)
|
void SettingsDialog::on_m_pCheckBoxEnableCrypto_toggled(bool checked)
|
||||||
{
|
{
|
||||||
m_appConfig.setCryptoEnabled(checked);
|
m_appConfig.setCryptoEnabled(checked);
|
||||||
m_appConfig.saveSettings();
|
|
||||||
if (checked) {
|
if (checked) {
|
||||||
SslCertificate sslCertificate;
|
SslCertificate sslCertificate;
|
||||||
sslCertificate.generateCertificate();
|
sslCertificate.generateCertificate();
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define TRAY_RETRY_COUNT 1
|
#define TRAY_RETRY_COUNT 10
|
||||||
#define TRAY_RETRY_WAIT 2000
|
#define TRAY_RETRY_WAIT 2000
|
||||||
|
|
||||||
#include "QSynergyApplication.h"
|
#include "QSynergyApplication.h"
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
#include <QSettings>
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue