Merge pull request #1479 from ctrlaltca/fix_autoconnect
Fix autoconnect
This commit is contained in:
commit
433c5703e7
3 changed files with 1 additions and 12 deletions
|
@ -206,8 +206,6 @@ SettingsCache::SettingsCache()
|
||||||
ignoreUnregisteredUsers = settings->value("chat/ignore_unregistered", false).toBool();
|
ignoreUnregisteredUsers = settings->value("chat/ignore_unregistered", false).toBool();
|
||||||
ignoreUnregisteredUserMessages = settings->value("chat/ignore_unregistered_messages", false).toBool();
|
ignoreUnregisteredUserMessages = settings->value("chat/ignore_unregistered_messages", false).toBool();
|
||||||
|
|
||||||
attemptAutoConnect = settings->value("server/auto_connect", 0).toBool();
|
|
||||||
|
|
||||||
scaleCards = settings->value("cards/scaleCards", true).toBool();
|
scaleCards = settings->value("cards/scaleCards", true).toBool();
|
||||||
showMessagePopups = settings->value("chat/showmessagepopups", true).toBool();
|
showMessagePopups = settings->value("chat/showmessagepopups", true).toBool();
|
||||||
showMentionPopups = settings->value("chat/showmentionpopups", true).toBool();
|
showMentionPopups = settings->value("chat/showmentionpopups", true).toBool();
|
||||||
|
@ -522,12 +520,6 @@ void SettingsCache::setMainWindowGeometry(const QByteArray &_mainWindowGeometry)
|
||||||
settings->setValue("interface/main_window_geometry", mainWindowGeometry);
|
settings->setValue("interface/main_window_geometry", mainWindowGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsCache::setAutoConnect(const bool &_autoConnect)
|
|
||||||
{
|
|
||||||
attemptAutoConnect = _autoConnect;
|
|
||||||
settings->setValue("server/auto_connect", attemptAutoConnect ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SettingsCache::setPixmapCacheSize(const int _pixmapCacheSize)
|
void SettingsCache::setPixmapCacheSize(const int _pixmapCacheSize)
|
||||||
{
|
{
|
||||||
pixmapCacheSize = _pixmapCacheSize;
|
pixmapCacheSize = _pixmapCacheSize;
|
||||||
|
|
|
@ -91,7 +91,6 @@ private:
|
||||||
QString picUrlFallback;
|
QString picUrlFallback;
|
||||||
QString picUrlHqFallback;
|
QString picUrlHqFallback;
|
||||||
QString clientID;
|
QString clientID;
|
||||||
bool attemptAutoConnect;
|
|
||||||
int pixmapCacheSize;
|
int pixmapCacheSize;
|
||||||
bool scaleCards;
|
bool scaleCards;
|
||||||
bool showMessagePopups;
|
bool showMessagePopups;
|
||||||
|
@ -163,7 +162,6 @@ public:
|
||||||
QString getPicUrlHq() const { return picUrlHq; }
|
QString getPicUrlHq() const { return picUrlHq; }
|
||||||
QString getPicUrlFallback() const { return picUrlFallback; }
|
QString getPicUrlFallback() const { return picUrlFallback; }
|
||||||
QString getPicUrlHqFallback() const { return picUrlHqFallback; }
|
QString getPicUrlHqFallback() const { return picUrlHqFallback; }
|
||||||
bool getAutoConnect() const { return attemptAutoConnect; }
|
|
||||||
int getPixmapCacheSize() const { return pixmapCacheSize; }
|
int getPixmapCacheSize() const { return pixmapCacheSize; }
|
||||||
bool getScaleCards() const { return scaleCards; }
|
bool getScaleCards() const { return scaleCards; }
|
||||||
bool getShowMessagePopup() const { return showMessagePopups; }
|
bool getShowMessagePopup() const { return showMessagePopups; }
|
||||||
|
@ -234,7 +232,6 @@ public slots:
|
||||||
void setPicUrlHq(const QString &_picUrlHq);
|
void setPicUrlHq(const QString &_picUrlHq);
|
||||||
void setPicUrlFallback(const QString &_picUrlFallback);
|
void setPicUrlFallback(const QString &_picUrlFallback);
|
||||||
void setPicUrlHqFallback(const QString &_picUrlHqFallback);
|
void setPicUrlHqFallback(const QString &_picUrlHqFallback);
|
||||||
void setAutoConnect(const bool &_autoConnect);
|
|
||||||
void setPixmapCacheSize(const int _pixmapCacheSize);
|
void setPixmapCacheSize(const int _pixmapCacheSize);
|
||||||
void setCardScaling(const int _scaleCards);
|
void setCardScaling(const int _scaleCards);
|
||||||
void setShowMessagePopups(const int _showMessagePopups);
|
void setShowMessagePopups(const int _showMessagePopups);
|
||||||
|
|
|
@ -685,7 +685,7 @@ void MainWindow::changeEvent(QEvent *event)
|
||||||
else if(event->type() == QEvent::ActivationChange) {
|
else if(event->type() == QEvent::ActivationChange) {
|
||||||
if(isActiveWindow() && !bHasActivated){
|
if(isActiveWindow() && !bHasActivated){
|
||||||
bHasActivated = true;
|
bHasActivated = true;
|
||||||
if(settingsCache->getAutoConnect()) {
|
if(settingsCache->servers().getAutoConnect()) {
|
||||||
qDebug() << "Attempting auto-connect...";
|
qDebug() << "Attempting auto-connect...";
|
||||||
DlgConnect dlg(this);
|
DlgConnect dlg(this);
|
||||||
client->connectToServer(dlg.getHost(), dlg.getPort(), dlg.getPlayerName(), dlg.getPassword());
|
client->connectToServer(dlg.getHost(), dlg.getPort(), dlg.getPlayerName(), dlg.getPassword());
|
||||||
|
|
Loading…
Reference in a new issue