Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Games
Knights
Commits
bbfca8e3
Commit
bbfca8e3
authored
Sep 27, 2020
by
Alexander Lohnau
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use QStringLiteral where appropriate
parent
72a13fdd
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
151 additions
and
151 deletions
+151
-151
src/board.cpp
src/board.cpp
+13
-13
src/clock.cpp
src/clock.cpp
+9
-9
src/clockwidget.cpp
src/clockwidget.cpp
+2
-2
src/core/pos.cpp
src/core/pos.cpp
+1
-1
src/enginesettings.cpp
src/enginesettings.cpp
+39
-39
src/externalcontrol.cpp
src/externalcontrol.cpp
+2
-2
src/gamedialog.cpp
src/gamedialog.cpp
+2
-2
src/gamemanager.cpp
src/gamemanager.cpp
+6
-6
src/knights.cpp
src/knights.cpp
+53
-53
src/offerwidget.cpp
src/offerwidget.cpp
+2
-2
src/proto/chatwidget.cpp
src/proto/chatwidget.cpp
+2
-2
src/proto/ficsdialog.cpp
src/proto/ficsdialog.cpp
+5
-5
src/proto/ficsprotocol.cpp
src/proto/ficsprotocol.cpp
+10
-10
src/proto/protocol.cpp
src/proto/protocol.cpp
+2
-2
src/proto/uciprotocol.cpp
src/proto/uciprotocol.cpp
+2
-2
src/proto/xboardprotocol.cpp
src/proto/xboardprotocol.cpp
+1
-1
No files found.
src/board.cpp
View file @
bbfca8e3
...
...
@@ -56,19 +56,19 @@ const qreal pieceZValue = 1.0;
const
qreal
legalMarkerZValue
=
3.0
;
const
qreal
dragZValue
=
4.0
;
const
QString
backgroundKey
=
Q
Latin1
String
(
"Background"
);
const
QString
whiteTileKey
=
Q
Latin1
String
(
"WhiteTile"
);
const
QString
blackTileKey
=
Q
Latin1
String
(
"BlackTile"
);
const
QString
legalMarkerKey
=
Q
Latin1
String
(
"Marker"
);
const
QString
motionMarkerKey
=
Q
Latin1
String
(
"Motion"
);
const
QString
dangerMarkerKey
=
Q
Latin1
String
(
"Danger"
);
const
QString
tbBorderKey
=
Q
Latin1
String
(
"TopBottomBorder"
);
const
QString
lrBorderKey
=
Q
Latin1
String
(
"LeftRightBorder"
);
const
QString
whiteLettersKey
=
Q
Latin1
String
(
"WhiteLetters"
);
const
QString
blackLettersKey
=
Q
Latin1
String
(
"BlackLetters"
);
const
QString
whiteNumbersKey
=
Q
Latin1
String
(
"WhiteNumbers"
);
const
QString
blackNumbersKey
=
Q
Latin1
String
(
"BlackNumbers"
);
const
QString
backgroundKey
=
QString
Literal
(
"Background"
);
const
QString
whiteTileKey
=
QString
Literal
(
"WhiteTile"
);
const
QString
blackTileKey
=
QString
Literal
(
"BlackTile"
);
const
QString
legalMarkerKey
=
QString
Literal
(
"Marker"
);
const
QString
motionMarkerKey
=
QString
Literal
(
"Motion"
);
const
QString
dangerMarkerKey
=
QString
Literal
(
"Danger"
);
const
QString
tbBorderKey
=
QString
Literal
(
"TopBottomBorder"
);
const
QString
lrBorderKey
=
QString
Literal
(
"LeftRightBorder"
);
const
QString
whiteLettersKey
=
QString
Literal
(
"WhiteLetters"
);
const
QString
blackLettersKey
=
QString
Literal
(
"BlackLetters"
);
const
QString
whiteNumbersKey
=
QString
Literal
(
"WhiteNumbers"
);
const
QString
blackNumbersKey
=
QString
Literal
(
"BlackNumbers"
);
Board
::
Board
(
KgThemeProvider
*
provider
,
QObject
*
parent
)
:
QGraphicsScene
(
parent
),
m_rules
(
nullptr
),
...
...
src/clock.cpp
View file @
bbfca8e3
...
...
@@ -39,7 +39,7 @@ Clock::Clock(QWidget* parent) : QWidget(parent),
m_repaintCache
(
RepaintNone
),
m_verticalTranslation
(
0.
)
{
m_theme
->
setImagePath
(
Q
Latin1
String
(
"widgets/clock"
)
);
m_theme
->
setImagePath
(
QString
Literal
(
"widgets/clock"
)
);
m_theme
->
setContainsMultipleImages
(
true
);
}
...
...
@@ -144,18 +144,18 @@ void Clock::paintInterface(QPainter *p, const QRect &rect) {
facePainter
.
setRenderHint
(
QPainter
::
SmoothPixmapTransform
);
glassPainter
.
setRenderHint
(
QPainter
::
SmoothPixmapTransform
);
m_theme
->
paint
(
&
facePainter
,
m_faceCache
.
rect
(),
Q
Latin1
String
(
"ClockFace"
)
);
m_theme
->
paint
(
&
facePainter
,
m_faceCache
.
rect
(),
QString
Literal
(
"ClockFace"
)
);
glassPainter
.
save
();
QRectF
elementRect
=
QRectF
(
QPointF
(
0
,
0
),
m_theme
->
elementSize
(
Q
Latin1
String
(
"HandCenterScrew"
)));
QRectF
elementRect
=
QRectF
(
QPointF
(
0
,
0
),
m_theme
->
elementSize
(
QString
Literal
(
"HandCenterScrew"
)));
glassPainter
.
translate
(
faceRect
.
width
()
/
2
-
elementRect
.
width
()
/
2
,
faceRect
.
height
()
/
2
-
elementRect
.
height
()
/
2
);
m_theme
->
paint
(
&
glassPainter
,
elementRect
,
Q
Latin1
String
(
"HandCenterScrew"
));
m_theme
->
paint
(
&
glassPainter
,
elementRect
,
QString
Literal
(
"HandCenterScrew"
));
glassPainter
.
restore
();
m_theme
->
paint
(
&
glassPainter
,
faceRect
,
Q
Latin1
String
(
"Glass"
));
m_theme
->
paint
(
&
glassPainter
,
faceRect
,
QString
Literal
(
"Glass"
));
// get vertical translation, see drawHand() for more details
m_verticalTranslation
=
m_theme
->
elementRect
(
Q
Latin1
String
(
"ClockFace"
)).
center
().
y
();
m_verticalTranslation
=
m_theme
->
elementRect
(
QString
Literal
(
"ClockFace"
)).
center
().
y
();
}
// paint hour and minute hands cache
...
...
@@ -166,8 +166,8 @@ void Clock::paintInterface(QPainter *p, const QRect &rect) {
handsPainter
.
drawPixmap
(
faceRect
,
m_faceCache
,
faceRect
);
handsPainter
.
setRenderHint
(
QPainter
::
SmoothPixmapTransform
);
drawHand
(
&
handsPainter
,
faceRect
,
m_verticalTranslation
,
hours
,
Q
Latin1
String
(
"Hour"
));
drawHand
(
&
handsPainter
,
faceRect
,
m_verticalTranslation
,
minutes
,
Q
Latin1
String
(
"Minute"
));
drawHand
(
&
handsPainter
,
faceRect
,
m_verticalTranslation
,
hours
,
QString
Literal
(
"Hour"
));
drawHand
(
&
handsPainter
,
faceRect
,
m_verticalTranslation
,
minutes
,
QString
Literal
(
"Minute"
));
}
// reset repaint cache flag
...
...
@@ -183,7 +183,7 @@ void Clock::paintInterface(QPainter *p, const QRect &rect) {
p
->
drawPixmap
(
targetRect
,
m_handsCache
,
faceRect
);
if
(
m_showSecondHand
)
{
p
->
setRenderHint
(
QPainter
::
SmoothPixmapTransform
);
drawHand
(
p
,
targetRect
,
m_verticalTranslation
,
seconds
,
Q
Latin1
String
(
"Second"
));
drawHand
(
p
,
targetRect
,
m_verticalTranslation
,
seconds
,
QString
Literal
(
"Second"
));
}
p
->
drawPixmap
(
targetRect
,
m_glassCache
,
faceRect
);
}
...
...
src/clockwidget.cpp
View file @
bbfca8e3
...
...
@@ -94,7 +94,7 @@ void ClockWidget::setTimeLimit ( Color color, const QTime& time ) {
void
ClockWidget
::
updateTimeFormat
()
{
if
(
m_timeLimit
[
White
]
>
QTime
(
1
,
0
)
||
m_timeLimit
[
Black
]
>
QTime
(
1
,
0
)
)
m_timeFormat
=
Q
Latin1
String
(
"h:mm:ss"
);
m_timeFormat
=
QString
Literal
(
"h:mm:ss"
);
else
m_timeFormat
=
Q
Latin1
String
(
"mm:ss"
);
m_timeFormat
=
QString
Literal
(
"mm:ss"
);
}
src/core/pos.cpp
View file @
bbfca8e3
...
...
@@ -25,7 +25,7 @@
#include <QDebug>
namespace
Knights
{
const
QString
Pos
::
rowNames
=
QString
::
fromLatin1
(
"abcdefgh"
);
const
QString
Pos
::
rowNames
=
QString
Literal
(
"abcdefgh"
);
QChar
Pos
::
row
(
int
num
)
{
...
...
src/enginesettings.cpp
View file @
bbfca8e3
...
...
@@ -62,9 +62,9 @@ const QString EngineConfiguration::toString() const {
EngineSettings
::
EngineSettings
(
QWidget
*
parent
,
Qt
::
WindowFlags
f
)
:
QWidget
(
parent
,
f
),
ui
(
new
Ui
::
EngineSettings
)
{
ui
->
setupUi
(
this
);
ui
->
autoDetectButton
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"tools-wizard"
))
);
ui
->
addButton
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"list-add"
))
);
ui
->
removeButton
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"list-remove"
))
);
ui
->
autoDetectButton
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"tools-wizard"
))
);
ui
->
addButton
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"list-add"
))
);
ui
->
removeButton
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"list-remove"
))
);
//add saved engines
int
row
=
0
;
...
...
@@ -129,42 +129,42 @@ void EngineSettings::autoDetectEngines() {
//keep the order within the three string lists in sync
QStringList
names
;
names
<<
Q
Latin1
String
(
"GNU Chess"
);
names
<<
Q
Latin1
String
(
"Crafty"
);
names
<<
Q
Latin1
String
(
"Stockfish"
);
names
<<
Q
Latin1
String
(
"Stockfish v1.4"
);
names
<<
Q
Latin1
String
(
"Stockfish v1.6"
);
names
<<
Q
Latin1
String
(
"Stockfish v1.7"
);
names
<<
Q
Latin1
String
(
"Stockfish v1.8"
);
names
<<
Q
Latin1
String
(
"Stockfish v1.9"
);
names
<<
Q
Latin1
String
(
"Stockfish v2.0"
);
names
<<
Q
Latin1
String
(
"Sjeng"
);
names
<<
Q
Latin1
String
(
"Phalanx"
);
names
<<
Q
Latin1
String
(
"Fruit"
);
names
<<
Q
Latin1
String
(
"Fruit v2.1"
);
names
<<
Q
Latin1
String
(
"TogaII"
);
names
<<
Q
Latin1
String
(
"TogaII v.1.4.2"
);
names
<<
Q
Latin1
String
(
"Glaurung"
);
names
<<
Q
Latin1
String
(
"HoiChess"
);
names
<<
QString
Literal
(
"GNU Chess"
);
names
<<
QString
Literal
(
"Crafty"
);
names
<<
QString
Literal
(
"Stockfish"
);
names
<<
QString
Literal
(
"Stockfish v1.4"
);
names
<<
QString
Literal
(
"Stockfish v1.6"
);
names
<<
QString
Literal
(
"Stockfish v1.7"
);
names
<<
QString
Literal
(
"Stockfish v1.8"
);
names
<<
QString
Literal
(
"Stockfish v1.9"
);
names
<<
QString
Literal
(
"Stockfish v2.0"
);
names
<<
QString
Literal
(
"Sjeng"
);
names
<<
QString
Literal
(
"Phalanx"
);
names
<<
QString
Literal
(
"Fruit"
);
names
<<
QString
Literal
(
"Fruit v2.1"
);
names
<<
QString
Literal
(
"TogaII"
);
names
<<
QString
Literal
(
"TogaII v.1.4.2"
);
names
<<
QString
Literal
(
"Glaurung"
);
names
<<
QString
Literal
(
"HoiChess"
);
QStringList
commands
;
commands
<<
Q
Latin1
String
(
"gnuchess"
);
commands
<<
Q
Latin1
String
(
"crafty"
);
commands
<<
Q
Latin1
String
(
"stockfish"
);
commands
<<
Q
Latin1
String
(
"stockfish14"
);
commands
<<
Q
Latin1
String
(
"stockfish16"
);
commands
<<
Q
Latin1
String
(
"stockfish17"
);
commands
<<
Q
Latin1
String
(
"stockfish18"
);
commands
<<
Q
Latin1
String
(
"stockfish19"
);
commands
<<
Q
Latin1
String
(
"stockfish20"
);
commands
<<
Q
Latin1
String
(
"sjeng"
);
commands
<<
Q
Latin1
String
(
"phalanx"
);
commands
<<
Q
Latin1
String
(
"fruit"
);
commands
<<
Q
Latin1
String
(
"fruit21"
);
commands
<<
Q
Latin1
String
(
"toga2"
);
commands
<<
Q
Latin1
String
(
"togaII-142"
);
//openSUSE naming convention
commands
<<
Q
Latin1
String
(
"glaurung"
);
commands
<<
Q
Latin1
String
(
"hoichess"
);
commands
<<
QString
Literal
(
"gnuchess"
);
commands
<<
QString
Literal
(
"crafty"
);
commands
<<
QString
Literal
(
"stockfish"
);
commands
<<
QString
Literal
(
"stockfish14"
);
commands
<<
QString
Literal
(
"stockfish16"
);
commands
<<
QString
Literal
(
"stockfish17"
);
commands
<<
QString
Literal
(
"stockfish18"
);
commands
<<
QString
Literal
(
"stockfish19"
);
commands
<<
QString
Literal
(
"stockfish20"
);
commands
<<
QString
Literal
(
"sjeng"
);
commands
<<
QString
Literal
(
"phalanx"
);
commands
<<
QString
Literal
(
"fruit"
);
commands
<<
QString
Literal
(
"fruit21"
);
commands
<<
QString
Literal
(
"toga2"
);
commands
<<
QString
Literal
(
"togaII-142"
);
//openSUSE naming convention
commands
<<
QString
Literal
(
"glaurung"
);
commands
<<
QString
Literal
(
"hoichess"
);
QVector
<
EngineConfiguration
::
Interface
>
interfaces
;
interfaces
<<
EngineConfiguration
::
XBoard
;
//gnuchess
...
...
@@ -209,14 +209,14 @@ void EngineSettings::autoDetectEngines() {
item
->
setFlags
(
item
->
flags
()
&
(
~
Qt
::
ItemIsEditable
));
//interface
const
QString
interface
=
(
interfaces
.
at
(
i
)
==
EngineConfiguration
::
XBoard
)
?
Q
Latin1
String
(
"XBoard"
)
:
Q
Latin1
String
(
"UCI"
);
const
QString
interface
=
(
interfaces
.
at
(
i
)
==
EngineConfiguration
::
XBoard
)
?
QString
Literal
(
"XBoard"
)
:
QString
Literal
(
"UCI"
);
item
=
new
QTableWidgetItem
(
interface
);
ui
->
tableWidget
->
setItem
(
row
,
ProtocolColumn
,
item
);
item
->
setFlags
(
item
->
flags
()
&
(
~
Qt
::
ItemIsEditable
));
//icon
QLabel
*
label
=
new
QLabel
(
this
);
label
->
setPixmap
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"dialog-ok"
)).
pixmap
(
32
,
32
)
);
label
->
setPixmap
(
QIcon
::
fromTheme
(
QString
Literal
(
"dialog-ok"
)).
pixmap
(
32
,
32
)
);
ui
->
tableWidget
->
setCellWidget
(
row
,
InstalledColumn
,
label
);
}
}
...
...
src/externalcontrol.cpp
View file @
bbfca8e3
...
...
@@ -33,8 +33,8 @@ using namespace Knights;
ExternalControl
::
ExternalControl
(
QObject
*
parent
)
:
QObject
(
parent
)
{
connect
(
Manager
::
self
(),
&
Manager
::
pieceMoved
,
this
,
&
ExternalControl
::
slotMoveMade
);
new
KnightsAdaptor
(
this
);
qCDebug
(
LOG_KNIGHTS
)
<<
QDBusConnection
::
sessionBus
().
registerObject
(
Q
Latin1
String
(
"/Knights"
),
this
);
qCDebug
(
LOG_KNIGHTS
)
<<
QDBusConnection
::
sessionBus
().
registerService
(
Q
Latin1
String
(
"org.kde.Knights"
));
qCDebug
(
LOG_KNIGHTS
)
<<
QDBusConnection
::
sessionBus
().
registerObject
(
QString
Literal
(
"/Knights"
),
this
);
qCDebug
(
LOG_KNIGHTS
)
<<
QDBusConnection
::
sessionBus
().
registerService
(
QString
Literal
(
"org.kde.Knights"
));
}
ExternalControl
::~
ExternalControl
()
=
default
;
...
...
src/gamedialog.cpp
View file @
bbfca8e3
...
...
@@ -52,8 +52,8 @@ GameDialog::GameDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f),
QFrame
*
mainFrame
=
new
QFrame
(
this
);
ui
->
setupUi
(
mainFrame
);
ui
->
pbPlayer1Engine
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"configure"
)));
ui
->
pbPlayer2Engine
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"configure"
)));
ui
->
pbPlayer1Engine
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"configure"
)));
ui
->
pbPlayer2Engine
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"configure"
)));
ui
->
cbTimeControl
->
setChecked
(
Settings
::
timeEnabled
());
ui
->
sbTimeLimit
->
setValue
(
Settings
::
timeLimit
());
ui
->
sbTimeIncrement
->
setValue
(
Settings
::
timeIncrement
());
...
...
src/gamemanager.cpp
View file @
bbfca8e3
...
...
@@ -116,11 +116,11 @@ GameManagerPrivate::GameManagerPrivate()
initComplete
(
false
),
loading
(
false
)
{
const
QDir
dir
=
QStandardPaths
::
locate
(
QStandardPaths
::
AppDataLocation
,
Q
Latin1
String
(
"sounds"
),
QStandardPaths
::
LocateDirectory
);
captureWhiteSound
=
std
::
unique_ptr
<
KgSound
>
(
new
KgSound
(
dir
.
filePath
(
Q
Latin1
String
(
"capture_white.ogg"
)))
);
captureBlackSound
=
std
::
unique_ptr
<
KgSound
>
(
new
KgSound
(
dir
.
filePath
(
Q
Latin1
String
(
"capture_black.ogg"
)))
);
moveWhiteSound
=
std
::
unique_ptr
<
KgSound
>
(
new
KgSound
(
dir
.
filePath
(
Q
Latin1
String
(
"move_white.ogg"
)))
)
;
moveBlackSound
=
std
::
unique_ptr
<
KgSound
>
(
new
KgSound
(
dir
.
filePath
(
Q
Latin1
String
(
"move_black.ogg"
)))
);
const
QDir
dir
=
QStandardPaths
::
locate
(
QStandardPaths
::
AppDataLocation
,
QString
Literal
(
"sounds"
),
QStandardPaths
::
LocateDirectory
);
captureWhiteSound
=
std
::
unique_ptr
<
KgSound
>
(
new
KgSound
(
dir
.
filePath
(
QString
Literal
(
"capture_white.ogg"
)))
);
captureBlackSound
=
std
::
unique_ptr
<
KgSound
>
(
new
KgSound
(
dir
.
filePath
(
QString
Literal
(
"capture_black.ogg"
)))
);
moveWhiteSound
=
std
::
unique_ptr
<
KgSound
>
(
new
KgSound
(
dir
.
filePath
(
QString
Literal
(
"move_white.ogg"
)))
)
;
moveBlackSound
=
std
::
unique_ptr
<
KgSound
>
(
new
KgSound
(
dir
.
filePath
(
QString
Literal
(
"move_black.ogg"
)))
);
}
int
GameManagerPrivate
::
nextOfferId
()
{
...
...
@@ -867,7 +867,7 @@ void Manager::saveGameHistoryAs(const QString& filename) {
stream
<<
"[Event
\"
Casual Game
\"
]"
<<
"
\n
"
;
stream
<<
"[Site
\"
?
\"
]"
<<
"
\n
"
;
stream
<<
"[Date
\"
"
<<
QDate
::
currentDate
().
toString
(
Q
Latin1
String
(
"yyyy.MM.dd"
)
)
<<
"
\"
]"
<<
"
\n
"
;
stream
<<
"[Date
\"
"
<<
QDate
::
currentDate
().
toString
(
QString
Literal
(
"yyyy.MM.dd"
)
)
<<
"
\"
]"
<<
"
\n
"
;
stream
<<
"[Round
\"
-
\"
]"
<<
"
\n
"
;
stream
<<
"[White
\"
"
<<
Protocol
::
white
()
->
playerName
()
<<
"
\"
]"
<<
"
\n
"
;
stream
<<
"[Black
\"
"
<<
Protocol
::
black
()
->
playerName
()
<<
"
\"
]"
<<
"
\n
"
;
...
...
src/knights.cpp
View file @
bbfca8e3
...
...
@@ -111,7 +111,7 @@ MainWindow::MainWindow() : KXmlGuiWindow(),
connect
(
Manager
::
self
(),
&
Manager
::
winnerNotify
,
this
,
&
MainWindow
::
gameOver
);
connect
(
qApp
,
&
QGuiApplication
::
lastWindowClosed
,
this
,
&
MainWindow
::
exitKnights
);
m_themeProvider
->
discoverThemes
(
"appdata"
,
Q
Latin1
String
(
"themes"
));
m_themeProvider
->
discoverThemes
(
"appdata"
,
QString
Literal
(
"themes"
));
m_view
->
drawBoard
(
m_themeProvider
);
}
...
...
@@ -139,7 +139,7 @@ void MainWindow::activePlayerChanged() {
void
MainWindow
::
setupDocks
()
{
// clock dock
m_clockDock
=
new
QDockWidget
(
i18n
(
"Clock"
),
this
);
m_clockDock
->
setObjectName
(
Q
Latin1
String
(
"ClockDockWidget"
));
// for QMainWindow::saveState()
m_clockDock
->
setObjectName
(
QString
Literal
(
"ClockDockWidget"
));
// for QMainWindow::saveState()
m_playerClock
=
new
ClockWidget
(
this
);
m_clockDock
->
setWidget
(
m_playerClock
);
m_clockDock
->
setFeatures
(
QDockWidget
::
DockWidgetMovable
|
QDockWidget
::
DockWidgetFloatable
);
...
...
@@ -149,25 +149,25 @@ void MainWindow::setupDocks() {
// console dock for black
m_bconsoleDock
=
new
QDockWidget
();
m_bconsoleDock
->
setObjectName
(
Q
Latin1
String
(
"BlackConsoleDockWidget"
));
m_bconsoleDock
->
setObjectName
(
QString
Literal
(
"BlackConsoleDockWidget"
));
m_bconsoleDock
->
setFeatures
(
QDockWidget
::
DockWidgetMovable
|
QDockWidget
::
DockWidgetFloatable
);
addDockWidget
(
Qt
::
LeftDockWidgetArea
,
m_bconsoleDock
);
// console dock for white
m_wconsoleDock
=
new
QDockWidget
();
m_wconsoleDock
->
setObjectName
(
Q
Latin1
String
(
"WhiteConsoleDockWidget"
));
m_wconsoleDock
->
setObjectName
(
QString
Literal
(
"WhiteConsoleDockWidget"
));
m_wconsoleDock
->
setFeatures
(
QDockWidget
::
DockWidgetMovable
|
QDockWidget
::
DockWidgetFloatable
);
addDockWidget
(
Qt
::
LeftDockWidgetArea
,
m_wconsoleDock
);
// chat dock
m_chatDock
=
new
QDockWidget
();
m_chatDock
->
setObjectName
(
Q
Latin1
String
(
"ChatDockWidget"
));
m_chatDock
->
setObjectName
(
QString
Literal
(
"ChatDockWidget"
));
m_chatDock
->
setFeatures
(
QDockWidget
::
DockWidgetMovable
|
QDockWidget
::
DockWidgetFloatable
);
addDockWidget
(
Qt
::
LeftDockWidgetArea
,
m_chatDock
);
// history dock
m_historyDock
=
new
QDockWidget
();
m_historyDock
->
setObjectName
(
Q
Latin1
String
(
"HistoryDockWidget"
));
m_historyDock
->
setObjectName
(
QString
Literal
(
"HistoryDockWidget"
));
m_historyDock
->
setFeatures
(
QDockWidget
::
DockWidgetMovable
|
QDockWidget
::
DockWidgetFloatable
);
m_historyDock
->
setWindowTitle
(
i18n
(
"Move History"
));
m_historyDock
->
setWidget
(
new
HistoryWidget
);
...
...
@@ -187,72 +187,72 @@ void MainWindow::setupActions() {
m_saveAsAction
->
setEnabled
(
false
);
KStandardGameAction
::
load
(
this
,
SLOT
(
fileLoad
()),
actionCollection
());
m_resignAction
=
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"resign"
),
this
,
SLOT
(
resign
()));
m_resignAction
=
actionCollection
()
->
addAction
(
QString
Literal
(
"resign"
),
this
,
SLOT
(
resign
()));
m_resignAction
->
setText
(
i18n
(
"Resign"
));
m_resignAction
->
setToolTip
(
i18n
(
"Admit your inevitable defeat"
));
m_resignAction
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"flag-red"
)));
m_resignAction
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"flag-red"
)));
m_resignAction
->
setEnabled
(
false
);
m_undoAction
=
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"move_undo"
),
this
,
SLOT
(
undo
()));
m_undoAction
=
actionCollection
()
->
addAction
(
QString
Literal
(
"move_undo"
),
this
,
SLOT
(
undo
()));
m_undoAction
->
setText
(
i18n
(
"Undo"
));
m_undoAction
->
setToolTip
(
i18n
(
"Take back your last move"
));
m_undoAction
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"edit-undo"
)));
m_undoAction
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"edit-undo"
)));
connect
(
Manager
::
self
(),
&
Manager
::
undoPossible
,
m_undoAction
,
&
QAction
::
setEnabled
);
m_undoAction
->
setEnabled
(
false
);
m_redoAction
=
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"move_redo"
),
this
,
SLOT
(
redo
()));
m_redoAction
=
actionCollection
()
->
addAction
(
QString
Literal
(
"move_redo"
),
this
,
SLOT
(
redo
()));
m_redoAction
->
setText
(
i18n
(
"Redo"
));
m_redoAction
->
setToolTip
(
i18n
(
"Repeat your last move"
));
m_redoAction
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"edit-redo"
)));
m_redoAction
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"edit-redo"
)));
connect
(
Manager
::
self
(),
&
Manager
::
redoPossible
,
m_redoAction
,
&
QAction
::
setEnabled
);
m_redoAction
->
setEnabled
(
false
);
m_redoAction
->
setVisible
(
false
);
m_drawAction
=
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"propose_draw"
),
Manager
::
self
(),
SLOT
(
offerDraw
()));
m_drawAction
=
actionCollection
()
->
addAction
(
QString
Literal
(
"propose_draw"
),
Manager
::
self
(),
SLOT
(
offerDraw
()));
m_drawAction
->
setText
(
i18n
(
"Offer &Draw"
));
m_drawAction
->
setToolTip
(
i18n
(
"Offer a draw to your opponent"
));
m_drawAction
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"flag-blue"
)));
m_drawAction
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"flag-blue"
)));
m_drawAction
->
setEnabled
(
false
);
m_adjournAction
=
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"adjourn"
),
Manager
::
self
(),
SLOT
(
adjourn
()));
m_adjournAction
=
actionCollection
()
->
addAction
(
QString
Literal
(
"adjourn"
),
Manager
::
self
(),
SLOT
(
adjourn
()));
m_adjournAction
->
setText
(
i18n
(
"Adjourn"
));
m_adjournAction
->
setToolTip
(
i18n
(
"Continue this game at a later time"
));
m_adjournAction
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"document-save"
)));
m_adjournAction
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"document-save"
)));
m_adjournAction
->
setEnabled
(
false
);
QAction
*
abortAction
=
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"abort"
),
Manager
::
self
(),
SLOT
(
abort
()));
QAction
*
abortAction
=
actionCollection
()
->
addAction
(
QString
Literal
(
"abort"
),
Manager
::
self
(),
SLOT
(
abort
()));
abortAction
->
setText
(
i18n
(
"Abort"
));
abortAction
->
setToolTip
(
i18n
(
"End the game immediately"
));
abortAction
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"dialog-cancel"
)));
abortAction
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"dialog-cancel"
)));
abortAction
->
setEnabled
(
false
);
KToggleAction
*
clockAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"clock"
)),
i18n
(
"Show Clock"
),
actionCollection
());
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"show_clock"
),
clockAction
);
KToggleAction
*
clockAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"clock"
)),
i18n
(
"Show Clock"
),
actionCollection
());
actionCollection
()
->
addAction
(
QString
Literal
(
"show_clock"
),
clockAction
);
connect
(
clockAction
,
&
KToggleAction
::
triggered
,
m_clockDock
,
&
QDockWidget
::
setVisible
);
connect
(
clockAction
,
&
KToggleAction
::
triggered
,
this
,
&
MainWindow
::
setShowClockSetting
);
clockAction
->
setVisible
(
false
);
KToggleAction
*
historyAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"view-history"
)),
i18n
(
"Show History"
),
actionCollection
());
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"show_history"
),
historyAction
);
KToggleAction
*
historyAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"view-history"
)),
i18n
(
"Show History"
),
actionCollection
());
actionCollection
()
->
addAction
(
QString
Literal
(
"show_history"
),
historyAction
);
connect
(
historyAction
,
&
KToggleAction
::
triggered
,
m_historyDock
,
&
QDockWidget
::
setVisible
);
connect
(
historyAction
,
&
KToggleAction
::
triggered
,
this
,
&
MainWindow
::
setShowHistorySetting
);
historyAction
->
setVisible
(
true
);
historyAction
->
setChecked
(
Settings
::
showHistory
());
KToggleAction
*
wconsoleAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"utilities-terminal"
)),
i18n
(
"Show White Console"
),
actionCollection
());
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"show_console_white"
),
wconsoleAction
);
KToggleAction
*
wconsoleAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"utilities-terminal"
)),
i18n
(
"Show White Console"
),
actionCollection
());
actionCollection
()
->
addAction
(
QString
Literal
(
"show_console_white"
),
wconsoleAction
);
connect
(
wconsoleAction
,
&
KToggleAction
::
triggered
,
m_wconsoleDock
,
&
QDockWidget
::
setVisible
);
connect
(
wconsoleAction
,
&
KToggleAction
::
triggered
,
this
,
&
MainWindow
::
setShowConsoleSetting
);
wconsoleAction
->
setVisible
(
false
);
KToggleAction
*
bconsoleAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"utilities-terminal"
)),
i18n
(
"Show Black Console"
),
actionCollection
());
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"show_console_black"
),
bconsoleAction
);
KToggleAction
*
bconsoleAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"utilities-terminal"
)),
i18n
(
"Show Black Console"
),
actionCollection
());
actionCollection
()
->
addAction
(
QString
Literal
(
"show_console_black"
),
bconsoleAction
);
connect
(
bconsoleAction
,
&
KToggleAction
::
triggered
,
m_bconsoleDock
,
&
QDockWidget
::
setVisible
);
connect
(
bconsoleAction
,
&
KToggleAction
::
triggered
,
this
,
&
MainWindow
::
setShowConsoleSetting
);
bconsoleAction
->
setVisible
(
false
);
KToggleAction
*
chatAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"meeting-attending"
)),
i18n
(
"Show Chat"
),
actionCollection
());
actionCollection
()
->
addAction
(
Q
Latin1
String
(
"show_chat"
),
chatAction
);
KToggleAction
*
chatAction
=
new
KToggleAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"meeting-attending"
)),
i18n
(
"Show Chat"
),
actionCollection
());
actionCollection
()
->
addAction
(
QString
Literal
(
"show_chat"
),
chatAction
);
connect
(
chatAction
,
&
KToggleAction
::
triggered
,
m_chatDock
,
&
QDockWidget
::
setVisible
);
connect
(
chatAction
,
&
KToggleAction
::
triggered
,
this
,
&
MainWindow
::
setShowChatSetting
);
chatAction
->
setVisible
(
false
);
...
...
@@ -324,7 +324,7 @@ void MainWindow::protocolInitSuccesful() {
// show clock dock widget if timer active and configuration file entry has visible = true
bool
showClock
=
false
;
if
(
Manager
::
self
()
->
timeControlEnabled
(
White
)
||
Manager
::
self
()
->
timeControlEnabled
(
Black
))
{
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_clock"
))
->
setVisible
(
true
);
actionCollection
()
->
action
(
QString
Literal
(
"show_clock"
))
->
setVisible
(
true
);
m_playerClock
->
setPlayerName
(
White
,
Protocol
::
white
()
->
playerName
());
m_playerClock
->
setPlayerName
(
Black
,
Protocol
::
black
()
->
playerName
());
m_playerClock
->
setTimeLimit
(
White
,
Manager
::
self
()
->
timeLimit
(
White
));
...
...
@@ -332,12 +332,12 @@ void MainWindow::protocolInitSuccesful() {
showClock
=
Settings
::
showClock
();
}
m_clockDock
->
setVisible
(
showClock
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_clock"
))
->
setChecked
(
showClock
);
actionCollection
()
->
action
(
QString
Literal
(
"show_clock"
))
->
setChecked
(
showClock
);
//history dock
bool
showHistory
=
Settings
::
showHistory
();
m_historyDock
->
setVisible
(
showHistory
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_history"
))
->
setChecked
(
showHistory
);
actionCollection
()
->
action
(
QString
Literal
(
"show_history"
))
->
setChecked
(
showHistory
);
if
(
!
(
Protocol
::
white
()
->
supportedFeatures
()
&
Protocol
::
Undo
&&
Protocol
::
black
()
->
supportedFeatures
()
&
Protocol
::
Undo
)
)
{
...
...
@@ -367,9 +367,9 @@ void MainWindow::protocolInitSuccesful() {
// show console action button if protocol allows a console
// show console dock widget if protocol allows and configuration file entry has visible = true
// finally, hide any dock widget not needed - in case it is still active from previous game
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_white"
))
->
setVisible
(
false
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_black"
))
->
setVisible
(
false
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_chat"
))
->
setVisible
(
false
);
actionCollection
()
->
action
(
QString
Literal
(
"show_console_white"
))
->
setVisible
(
false
);
actionCollection
()
->
action
(
QString
Literal
(
"show_console_black"
))
->
setVisible
(
false
);
actionCollection
()
->
action
(
QString
Literal
(
"show_chat"
))
->
setVisible
(
false
);
QList
<
Protocol
::
ToolWidgetData
>
list
;
list
<<
Protocol
::
black
()
->
toolWidgets
();
list
<<
Protocol
::
white
()
->
toolWidgets
();
...
...
@@ -379,24 +379,24 @@ void MainWindow::protocolInitSuccesful() {
if
(
data
.
owner
==
White
)
{
m_wconsoleDock
->
setWindowTitle
(
data
.
title
);
m_wconsoleDock
->
setWidget
(
data
.
widget
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_white"
))
->
setVisible
(
true
);
actionCollection
()
->
action
(
QString
Literal
(
"show_console_white"
))
->
setVisible
(
true
);
if
(
Settings
::
showConsole
())
{
m_wconsoleDock
->
setVisible
(
true
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_white"
))
->
setChecked
(
true
);
actionCollection
()
->
action
(
QString
Literal
(
"show_console_white"
))
->
setChecked
(
true
);
}
else
{
m_wconsoleDock
->
setVisible
(
false
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_white"
))
->
setChecked
(
false
);
actionCollection
()
->
action
(
QString
Literal
(
"show_console_white"
))
->
setChecked
(
false
);
}
}
else
{
m_bconsoleDock
->
setWindowTitle
(
data
.
title
);
m_bconsoleDock
->
setWidget
(
data
.
widget
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_black"
))
->
setVisible
(
true
);
actionCollection
()
->
action
(
QString
Literal
(
"show_console_black"
))
->
setVisible
(
true
);
if
(
Settings
::
showConsole
())
{
m_bconsoleDock
->
setVisible
(
true
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_black"
))
->
setChecked
(
true
);
actionCollection
()
->
action
(
QString
Literal
(
"show_console_black"
))
->
setChecked
(
true
);
}
else
{
m_bconsoleDock
->
setVisible
(
false
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_black"
))
->
setChecked
(
false
);
actionCollection
()
->
action
(
QString
Literal
(
"show_console_black"
))
->
setChecked
(
false
);
}
}
break
;
...
...
@@ -404,13 +404,13 @@ void MainWindow::protocolInitSuccesful() {
case
Protocol
::
ChatToolWidget
:
m_chatDock
->
setWindowTitle
(
data
.
title
);
m_chatDock
->
setWidget
(
data
.
widget
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_chat"
))
->
setVisible
(
true
);
actionCollection
()
->
action
(
QString
Literal
(
"show_chat"
))
->
setVisible
(
true
);
if
(
Settings
::
showChat
())
{
m_chatDock
->
setVisible
(
true
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_chat"
))
->
setChecked
(
true
);
actionCollection
()
->
action
(
QString
Literal
(
"show_chat"
))
->
setChecked
(
true
);
}
else
{
m_chatDock
->
setVisible
(
false
);
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_chat"
))
->
setChecked
(
false
);
actionCollection
()
->
action
(
QString
Literal
(
"show_chat"
))
->
setChecked
(
false
);
}
break
;
...
...
@@ -418,11 +418,11 @@ void MainWindow::protocolInitSuccesful() {
break
;
}
}
if
(
!
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_white"
))
->
isVisible
())
if
(
!
actionCollection
()
->
action
(
QString
Literal
(
"show_console_white"
))
->
isVisible
())
m_wconsoleDock
->
hide
();
if
(
!
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_black"
))
->
isVisible
())
if
(
!
actionCollection
()
->
action
(
QString
Literal
(
"show_console_black"
))
->
isVisible
())
m_bconsoleDock
->
hide
();
if
(
!
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_chat"
))
->
isVisible
())
if
(
!
actionCollection
()
->
action
(
QString
Literal
(
"show_chat"
))
->
isVisible
())
m_chatDock
->
hide
();
Manager
::
self
()
->
startGame
();
...
...
@@ -450,17 +450,17 @@ void MainWindow::protocolError(Protocol::ErrorCode errorCode, const QString& err
}
void
MainWindow
::
optionsPreferences
()
{
if
(
KConfigDialog
::
showDialog
(
Q
Latin1
String
(
"settings"
)))
if
(
KConfigDialog
::
showDialog
(
QString
Literal
(
"settings"
)))
return
;
KConfigDialog
*
dialog
=
new
KConfigDialog
(
this
,
Q
Latin1
String
(
"settings"
),
Settings
::
self
());
KConfigDialog
*
dialog
=
new
KConfigDialog
(
this
,
QString
Literal
(
"settings"
),
Settings
::
self
());
QWidget
*
generalSettingsDlg
=
new
QWidget
;
ui_prefs_base
.
setupUi
(
generalSettingsDlg
);
dialog
->
addPage
(
generalSettingsDlg
,
i18n
(
"General"
),
Q
Latin1
String
(
"games-config-options"
));
dialog
->
addPage
(
generalSettingsDlg
,
i18n
(
"General"
),
QString
Literal
(
"games-config-options"
));
connect
(
dialog
,
&
KConfigDialog
::
settingsChanged
,
m_view
,
&
KnightsView
::
settingsChanged
);
EngineSettings
*
engineSettings
=
new
EngineSettings
(
this
);
dialog
->
addPage
(
engineSettings
,
i18n
(
"Computer Engines"
),
Q
Latin1
String
(
"computer"
));
dialog
->
addPage
(
engineSettings
,
i18n
(
"Computer Engines"
),
QString
Literal
(
"computer"
));
connect
(
dialog
,
&
KConfigDialog
::
accepted
,
engineSettings
,
&
EngineSettings
::
save
);
//FIXME: the accessibility page doesn't seem to be used at the moment.
...
...
@@ -470,7 +470,7 @@ void MainWindow::optionsPreferences() {
// dialog->addPage(accessDlg, i18n("Accessibility"), QLatin1String("preferences-desktop-accessibility"));
QWidget
*
themeDlg
=
new
KgThemeSelector
(
m_themeProvider
,
KgThemeSelector
::
EnableNewStuffDownload
,
dialog
);
dialog
->
addPage
(
themeDlg
,
i18n
(
"Theme"
),
Q
Latin1
String
(
"games-config-theme"
));
dialog
->
addPage
(
themeDlg
,
i18n
(
"Theme"
),
QString
Literal
(
"games-config-theme"
));
dialog
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
dialog
->
show
();
...
...
@@ -590,9 +590,9 @@ void MainWindow::setShowHistorySetting(bool value) {
}
void
MainWindow
::
setShowConsoleSetting
()
{
if
((
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_white"
))
->
isChecked
())
&&
(
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_white"
))
->
isVisible
()))
if
((
actionCollection
()
->
action
(
QString
Literal
(
"show_console_white"
))
->
isChecked
())
&&
(
actionCollection
()
->
action
(
QString
Literal
(
"show_console_white"
))
->
isVisible
()))
Settings
::
setShowConsole
(
true
);
else
if
((
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_black"
))
->
isChecked
())
&&
(
actionCollection
()
->
action
(
Q
Latin1
String
(
"show_console_black"
))
->
isVisible
()))
else
if
((
actionCollection
()
->
action
(
QString
Literal
(
"show_console_black"
))
->
isChecked
())
&&
(
actionCollection
()
->
action
(
QString
Literal
(
"show_console_black"
))
->
isVisible
()))
Settings
::
setShowConsole
(
true
);
else
Settings
::
setShowConsole
(
false
);
...
...
src/offerwidget.cpp
View file @
bbfca8e3
...
...
@@ -32,10 +32,10 @@ OfferWidget::OfferWidget(const Knights::Offer& offer, QWidget* parent, Qt::Windo
offerId
=
offer
.
id
;
if
(
offer
.
action
!=
ActionNone
)
{
QAction
*
action
;
action
=
new
QAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"dialog-ok"
)),
i18n
(
"Accept"
),
this
);
action
=
new
QAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"dialog-ok"
)),
i18n
(
"Accept"
),
this
);
connect
(
action
,
&
QAction
::
triggered
,
this
,
&
OfferWidget
::
acceptClicked
);
addAction
(
action
);
action
=
new
QAction
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"edit-delete"
)),
i18n
(
"Decline"
),
this
);
action
=
new
QAction
(
QIcon
::
fromTheme
(
QString
Literal
(
"edit-delete"
)),
i18n
(
"Decline"
),
this
);
connect
(
action
,
&
QAction
::
triggered
,
this
,
&
OfferWidget
::
declineClicked
);
addAction
(
action
);
}
...
...
src/proto/chatwidget.cpp
View file @
bbfca8e3
...
...
@@ -50,7 +50,7 @@ ChatWidget::ChatWidget ( QWidget* parent, Qt::WindowFlags f ) : QWidget ( parent
ui
->
setupUi
(
this
);
connect
(
ui
->
sendButton
,
&
QPushButton
::
clicked
,
this
,
&
ChatWidget
::
sendButtonClicked
);
ui
->
sendButton
->
setIcon
(
QIcon
::
fromTheme
(
Q
Latin1
String
(
"mail-send"
))
);
ui
->
sendButton
->
setIcon
(
QIcon
::
fromTheme
(
QString
Literal
(
"mail-send"
))
);
m_terminal
=
new
Terminal
;
ui
->
consoleLayout
->
addWidget
(
m_terminal
);
...
...
@@ -87,7 +87,7 @@ void ChatWidget::addText ( const QString& text, ChatWidget::MessageType type ) {
cursor
.
setCharFormat
(
format
);
cursor
.
insertText
(
text
);
}
cursor
.
insertText
(
Q
Latin1
String
(
"
\n
"
));
cursor
.
insertText
(
QString
Literal
(
"
\n
"
));
}
void
ChatWidget
::
addText
(
const
QByteArray
&
text
,
ChatWidget
::
MessageType
type
)
{
...
...
src/proto/ficsdialog.cpp