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
62ccd51f
Commit
62ccd51f
authored
Jan 03, 2011
by
Max-Wilhelm Bruker
Browse files
minor fix
parent
55d493e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/tab_server.cpp
View file @
62ccd51f
...
@@ -85,13 +85,14 @@ void RoomSelector::processListRoomsEvent(Event_ListRooms *event)
...
@@ -85,13 +85,14 @@ void RoomSelector::processListRoomsEvent(Event_ListRooms *event)
twi
->
setTextAlignment
(
3
,
Qt
::
AlignRight
);
twi
->
setTextAlignment
(
3
,
Qt
::
AlignRight
);
roomList
->
addTopLevelItem
(
twi
);
roomList
->
addTopLevelItem
(
twi
);
if
(
room
->
getAutoJoin
())
if
(
room
->
getAutoJoin
())
joinRoom
(
room
->
getRoomId
());
joinRoom
(
room
->
getRoomId
()
,
false
);
}
}
}
}
void
RoomSelector
::
joinRoom
(
int
id
)
void
RoomSelector
::
joinRoom
(
int
id
,
bool
setCurrent
)
{
{
Command_JoinRoom
*
command
=
new
Command_JoinRoom
(
id
);
Command_JoinRoom
*
command
=
new
Command_JoinRoom
(
id
);
command
->
setExtraData
(
setCurrent
);
connect
(
command
,
SIGNAL
(
finished
(
ProtocolResponse
*
)),
this
,
SLOT
(
joinFinished
(
ProtocolResponse
*
)));
connect
(
command
,
SIGNAL
(
finished
(
ProtocolResponse
*
)),
this
,
SLOT
(
joinFinished
(
ProtocolResponse
*
)));
client
->
sendCommand
(
command
);
client
->
sendCommand
(
command
);
}
}
...
@@ -102,7 +103,7 @@ void RoomSelector::joinClicked()
...
@@ -102,7 +103,7 @@ void RoomSelector::joinClicked()
if
(
!
twi
)
if
(
!
twi
)
return
;
return
;
joinRoom
(
twi
->
data
(
0
,
Qt
::
UserRole
).
toInt
());
joinRoom
(
twi
->
data
(
0
,
Qt
::
UserRole
).
toInt
()
,
true
);
}
}
void
RoomSelector
::
joinFinished
(
ProtocolResponse
*
r
)
void
RoomSelector
::
joinFinished
(
ProtocolResponse
*
r
)
...
@@ -113,7 +114,7 @@ void RoomSelector::joinFinished(ProtocolResponse *r)
...
@@ -113,7 +114,7 @@ void RoomSelector::joinFinished(ProtocolResponse *r)
if
(
!
resp
)
if
(
!
resp
)
return
;
return
;
emit
roomJoined
(
resp
->
getRoomInfo
());
emit
roomJoined
(
resp
->
getRoomInfo
()
,
static_cast
<
Command
*>
(
sender
())
->
getExtraData
().
toBool
()
);
}
}
UserInfoBox
::
UserInfoBox
(
ServerInfo_User
*
userInfo
,
QWidget
*
parent
)
UserInfoBox
::
UserInfoBox
(
ServerInfo_User
*
userInfo
,
QWidget
*
parent
)
...
@@ -185,7 +186,7 @@ TabServer::TabServer(AbstractClient *_client, ServerInfo_User *userInfo, QWidget
...
@@ -185,7 +186,7 @@ TabServer::TabServer(AbstractClient *_client, ServerInfo_User *userInfo, QWidget
userInfoBox
=
new
UserInfoBox
(
userInfo
);
userInfoBox
=
new
UserInfoBox
(
userInfo
);
userList
=
new
UserList
(
true
);
userList
=
new
UserList
(
true
);
connect
(
roomSelector
,
SIGNAL
(
roomJoined
(
ServerInfo_Room
*
)),
this
,
SIGNAL
(
roomJoined
(
ServerInfo_Room
*
)));
connect
(
roomSelector
,
SIGNAL
(
roomJoined
(
ServerInfo_Room
*
,
bool
)),
this
,
SIGNAL
(
roomJoined
(
ServerInfo_Room
*
,
bool
)));
connect
(
userList
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)),
this
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)));
connect
(
userList
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)),
this
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)));
connect
(
client
,
SIGNAL
(
userJoinedEventReceived
(
Event_UserJoined
*
)),
this
,
SLOT
(
processUserJoinedEvent
(
Event_UserJoined
*
)));
connect
(
client
,
SIGNAL
(
userJoinedEventReceived
(
Event_UserJoined
*
)),
this
,
SLOT
(
processUserJoinedEvent
(
Event_UserJoined
*
)));
...
...
cockatrice/src/tab_server.h
View file @
62ccd51f
...
@@ -27,13 +27,13 @@ private:
...
@@ -27,13 +27,13 @@ private:
QPushButton
*
joinButton
;
QPushButton
*
joinButton
;
AbstractClient
*
client
;
AbstractClient
*
client
;
void
joinRoom
(
int
id
);
void
joinRoom
(
int
id
,
bool
setCurrent
);
private
slots
:
private
slots
:
void
processListRoomsEvent
(
Event_ListRooms
*
event
);
void
processListRoomsEvent
(
Event_ListRooms
*
event
);
void
joinClicked
();
void
joinClicked
();
void
joinFinished
(
ProtocolResponse
*
resp
);
void
joinFinished
(
ProtocolResponse
*
resp
);
signals:
signals:
void
roomJoined
(
ServerInfo_Room
*
info
);
void
roomJoined
(
ServerInfo_Room
*
info
,
bool
setCurrent
);
public:
public:
RoomSelector
(
AbstractClient
*
_client
,
QWidget
*
parent
=
0
);
RoomSelector
(
AbstractClient
*
_client
,
QWidget
*
parent
=
0
);
void
retranslateUi
();
void
retranslateUi
();
...
@@ -52,7 +52,7 @@ public:
...
@@ -52,7 +52,7 @@ public:
class
TabServer
:
public
Tab
{
class
TabServer
:
public
Tab
{
Q_OBJECT
Q_OBJECT
signals:
signals:
void
roomJoined
(
ServerInfo_Room
*
info
);
void
roomJoined
(
ServerInfo_Room
*
info
,
bool
setCurrent
);
void
openMessageDialog
(
const
QString
&
userName
,
bool
focus
);
void
openMessageDialog
(
const
QString
&
userName
,
bool
focus
);
void
userLeft
(
const
QString
&
userName
);
void
userLeft
(
const
QString
&
userName
);
private
slots
:
private
slots
:
...
...
cockatrice/src/tab_supervisor.cpp
View file @
62ccd51f
...
@@ -63,7 +63,7 @@ void TabSupervisor::start(AbstractClient *_client, ServerInfo_User *userInfo)
...
@@ -63,7 +63,7 @@ void TabSupervisor::start(AbstractClient *_client, ServerInfo_User *userInfo)
connect
(
client
,
SIGNAL
(
maxPingTime
(
int
,
int
)),
this
,
SLOT
(
updatePingTime
(
int
,
int
)));
connect
(
client
,
SIGNAL
(
maxPingTime
(
int
,
int
)),
this
,
SLOT
(
updatePingTime
(
int
,
int
)));
tabServer
=
new
TabServer
(
client
,
userInfo
);
tabServer
=
new
TabServer
(
client
,
userInfo
);
connect
(
tabServer
,
SIGNAL
(
roomJoined
(
ServerInfo_Room
*
)),
this
,
SLOT
(
addRoomTab
(
ServerInfo_Room
*
)));
connect
(
tabServer
,
SIGNAL
(
roomJoined
(
ServerInfo_Room
*
,
bool
)),
this
,
SLOT
(
addRoomTab
(
ServerInfo_Room
*
,
bool
)));
connect
(
tabServer
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)),
this
,
SLOT
(
addMessageTab
(
const
QString
&
,
bool
)));
connect
(
tabServer
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)),
this
,
SLOT
(
addMessageTab
(
const
QString
&
,
bool
)));
connect
(
tabServer
,
SIGNAL
(
userLeft
(
const
QString
&
)),
this
,
SLOT
(
processUserLeft
(
const
QString
&
)));
connect
(
tabServer
,
SIGNAL
(
userLeft
(
const
QString
&
)),
this
,
SLOT
(
processUserLeft
(
const
QString
&
)));
myAddTab
(
tabServer
);
myAddTab
(
tabServer
);
...
@@ -162,13 +162,14 @@ void TabSupervisor::gameLeft(TabGame *tab)
...
@@ -162,13 +162,14 @@ void TabSupervisor::gameLeft(TabGame *tab)
stop
();
stop
();
}
}
void
TabSupervisor
::
addRoomTab
(
ServerInfo_Room
*
info
)
void
TabSupervisor
::
addRoomTab
(
ServerInfo_Room
*
info
,
bool
setCurrent
)
{
{
TabRoom
*
tab
=
new
TabRoom
(
client
,
userName
,
info
);
TabRoom
*
tab
=
new
TabRoom
(
client
,
userName
,
info
);
connect
(
tab
,
SIGNAL
(
roomClosing
(
TabRoom
*
)),
this
,
SLOT
(
roomLeft
(
TabRoom
*
)));
connect
(
tab
,
SIGNAL
(
roomClosing
(
TabRoom
*
)),
this
,
SLOT
(
roomLeft
(
TabRoom
*
)));
myAddTab
(
tab
);
myAddTab
(
tab
);
roomTabs
.
insert
(
info
->
getRoomId
(),
tab
);
roomTabs
.
insert
(
info
->
getRoomId
(),
tab
);
setCurrentWidget
(
tab
);
if
(
setCurrent
)
setCurrentWidget
(
tab
);
}
}
void
TabSupervisor
::
roomLeft
(
TabRoom
*
tab
)
void
TabSupervisor
::
roomLeft
(
TabRoom
*
tab
)
...
...
cockatrice/src/tab_supervisor.h
View file @
62ccd51f
...
@@ -49,7 +49,7 @@ private slots:
...
@@ -49,7 +49,7 @@ private slots:
void
gameJoined
(
Event_GameJoined
*
event
);
void
gameJoined
(
Event_GameJoined
*
event
);
void
localGameJoined
(
Event_GameJoined
*
event
);
void
localGameJoined
(
Event_GameJoined
*
event
);
void
gameLeft
(
TabGame
*
tab
);
void
gameLeft
(
TabGame
*
tab
);
void
addRoomTab
(
ServerInfo_Room
*
info
);
void
addRoomTab
(
ServerInfo_Room
*
info
,
bool
setCurrent
);
void
roomLeft
(
TabRoom
*
tab
);
void
roomLeft
(
TabRoom
*
tab
);
TabMessage
*
addMessageTab
(
const
QString
&
userName
,
bool
focus
);
TabMessage
*
addMessageTab
(
const
QString
&
userName
,
bool
focus
);
void
processUserLeft
(
const
QString
&
userName
);
void
processUserLeft
(
const
QString
&
userName
);
...
...
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