Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
433c5703
Commit
433c5703
authored
Sep 08, 2015
by
Zach
Browse files
Merge pull request #1479 from ctrlaltca/fix_autoconnect
Fix autoconnect
parents
2a83f6dd
50aa6e3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/settingscache.cpp
View file @
433c5703
...
...
@@ -206,8 +206,6 @@ SettingsCache::SettingsCache()
ignoreUnregisteredUsers
=
settings
->
value
(
"chat/ignore_unregistered"
,
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
();
showMessagePopups
=
settings
->
value
(
"chat/showmessagepopups"
,
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
);
}
void
SettingsCache
::
setAutoConnect
(
const
bool
&
_autoConnect
)
{
attemptAutoConnect
=
_autoConnect
;
settings
->
setValue
(
"server/auto_connect"
,
attemptAutoConnect
?
1
:
0
);
}
void
SettingsCache
::
setPixmapCacheSize
(
const
int
_pixmapCacheSize
)
{
pixmapCacheSize
=
_pixmapCacheSize
;
...
...
cockatrice/src/settingscache.h
View file @
433c5703
...
...
@@ -91,7 +91,6 @@ private:
QString
picUrlFallback
;
QString
picUrlHqFallback
;
QString
clientID
;
bool
attemptAutoConnect
;
int
pixmapCacheSize
;
bool
scaleCards
;
bool
showMessagePopups
;
...
...
@@ -163,7 +162,6 @@ public:
QString
getPicUrlHq
()
const
{
return
picUrlHq
;
}
QString
getPicUrlFallback
()
const
{
return
picUrlFallback
;
}
QString
getPicUrlHqFallback
()
const
{
return
picUrlHqFallback
;
}
bool
getAutoConnect
()
const
{
return
attemptAutoConnect
;
}
int
getPixmapCacheSize
()
const
{
return
pixmapCacheSize
;
}
bool
getScaleCards
()
const
{
return
scaleCards
;
}
bool
getShowMessagePopup
()
const
{
return
showMessagePopups
;
}
...
...
@@ -234,7 +232,6 @@ public slots:
void
setPicUrlHq
(
const
QString
&
_picUrlHq
);
void
setPicUrlFallback
(
const
QString
&
_picUrlFallback
);
void
setPicUrlHqFallback
(
const
QString
&
_picUrlHqFallback
);
void
setAutoConnect
(
const
bool
&
_autoConnect
);
void
setPixmapCacheSize
(
const
int
_pixmapCacheSize
);
void
setCardScaling
(
const
int
_scaleCards
);
void
setShowMessagePopups
(
const
int
_showMessagePopups
);
...
...
cockatrice/src/window_main.cpp
View file @
433c5703
...
...
@@ -685,7 +685,7 @@ void MainWindow::changeEvent(QEvent *event)
else
if
(
event
->
type
()
==
QEvent
::
ActivationChange
)
{
if
(
isActiveWindow
()
&&
!
bHasActivated
){
bHasActivated
=
true
;
if
(
settingsCache
->
getAutoConnect
())
{
if
(
settingsCache
->
servers
().
getAutoConnect
())
{
qDebug
()
<<
"Attempting auto-connect..."
;
DlgConnect
dlg
(
this
);
client
->
connectToServer
(
dlg
.
getHost
(),
dlg
.
getPort
(),
dlg
.
getPlayerName
(),
dlg
.
getPassword
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment