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
713ebece
Commit
713ebece
authored
Feb 15, 2011
by
Max-Wilhelm Bruker
Browse files
server version bump, minor chat view fix
parent
d4f60039
Changes
3
Show whitespace changes
Inline
Side-by-side
cockatrice/src/chatview.cpp
View file @
713ebece
...
@@ -10,7 +10,7 @@ ChatView::ChatView(const QString &_ownName, QWidget *parent)
...
@@ -10,7 +10,7 @@ ChatView::ChatView(const QString &_ownName, QWidget *parent)
setTextInteractionFlags
(
Qt
::
TextSelectableByMouse
);
setTextInteractionFlags
(
Qt
::
TextSelectableByMouse
);
}
}
void
ChatView
::
appendMessage
(
const
QString
&
sender
,
const
QString
&
message
)
void
ChatView
::
appendMessage
(
QString
sender
,
const
QString
&
message
)
{
{
QTextCursor
cursor
(
document
()
->
lastBlock
());
QTextCursor
cursor
(
document
()
->
lastBlock
());
cursor
.
movePosition
(
QTextCursor
::
End
);
cursor
.
movePosition
(
QTextCursor
::
End
);
...
@@ -31,7 +31,9 @@ void ChatView::appendMessage(const QString &sender, const QString &message)
...
@@ -31,7 +31,9 @@ void ChatView::appendMessage(const QString &sender, const QString &message)
}
else
}
else
senderFormat
.
setForeground
(
Qt
::
blue
);
senderFormat
.
setForeground
(
Qt
::
blue
);
cursor
.
setCharFormat
(
senderFormat
);
cursor
.
setCharFormat
(
senderFormat
);
cursor
.
insertText
(
sender
+
" "
);
if
(
!
sender
.
isEmpty
())
sender
.
append
(
" "
);
cursor
.
insertText
(
sender
);
QTextCharFormat
messageFormat
;
QTextCharFormat
messageFormat
;
if
(
sender
.
isEmpty
())
if
(
sender
.
isEmpty
())
...
@@ -39,6 +41,5 @@ void ChatView::appendMessage(const QString &sender, const QString &message)
...
@@ -39,6 +41,5 @@ void ChatView::appendMessage(const QString &sender, const QString &message)
cursor
.
setCharFormat
(
messageFormat
);
cursor
.
setCharFormat
(
messageFormat
);
cursor
.
insertText
(
message
);
cursor
.
insertText
(
message
);
verticalScrollBar
()
->
setValue
(
verticalScrollBar
()
->
maximum
());
verticalScrollBar
()
->
setValue
(
verticalScrollBar
()
->
maximum
());
}
}
cockatrice/src/chatview.h
View file @
713ebece
...
@@ -12,7 +12,7 @@ private:
...
@@ -12,7 +12,7 @@ private:
QString
ownName
;
QString
ownName
;
public:
public:
ChatView
(
const
QString
&
_ownName
,
QWidget
*
parent
=
0
);
ChatView
(
const
QString
&
_ownName
,
QWidget
*
parent
=
0
);
void
appendMessage
(
const
QString
&
sender
,
const
QString
&
message
);
void
appendMessage
(
QString
sender
,
const
QString
&
message
);
};
};
#endif
#endif
\ No newline at end of file
servatrice/src/servatrice.cpp
View file @
713ebece
...
@@ -235,4 +235,4 @@ void Servatrice::statusUpdate()
...
@@ -235,4 +235,4 @@ void Servatrice::statusUpdate()
execSqlQuery
(
query
);
execSqlQuery
(
query
);
}
}
const
QString
Servatrice
::
versionString
=
"Servatrice 0.20110
127
"
;
const
QString
Servatrice
::
versionString
=
"Servatrice 0.20110
215
"
;
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