Commit 71a57fd6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix statusbar

parent 9b5d7ee6
......@@ -24,6 +24,7 @@
#include <KStandardGameAction>
#include <QStatusBar>
#include <QAction>
#include <QLabel>
//generated
#include "settings.h"
......@@ -57,7 +58,8 @@ void KSquaresWindow::initObject()
m_view->setRenderHints(QPainter::Antialiasing);
m_view->setFrameStyle(QFrame::NoFrame);
setupActions();
//QT5 statusBar()->insertPermanentItem(i18n("Current Player"), statusplayer);
m_player = new QLabel(i18n("Current Player"));
statusBar()->addPermanentWidget(m_player);
statusBar()->show();
setAutoSaveSettings();
......@@ -265,14 +267,9 @@ void KSquaresWindow::gameOver(const QVector<KSquaresPlayer> &_playerList)
void KSquaresWindow::playerTakeTurn(KSquaresPlayer* currentPlayer)
{
////qDebug() << "void KSquares::playerTakeTurn(KSquaresPlayer* currentPlayer)";
#if 0 //QT5
statusBar()->changeItem(
QString::fromLatin1("<font color=\"%1\">%2</font>")
.arg(currentPlayer->colour().name())
.arg(currentPlayer->name()),
statusplayer
);
#endif
m_player->setText(QString::fromLatin1("<font color=\"%1\">%2</font>")
.arg(currentPlayer->colour().name())
.arg(currentPlayer->name()));
if(currentPlayer->isHuman())
{
//Let the human player interact with the board through the GameBoardView
......
......@@ -16,10 +16,9 @@
#include "ui_prefs_ai.h"
#include "ui_prefs_display.h"
class KToggleAction;
class GameBoardView;
class GameBoardScene;
class QLabel;
/**
* @short Mainwindow class
*
......@@ -53,11 +52,6 @@ class KSquaresWindow : public KXmlGuiWindow
void gameOver(const QVector<KSquaresPlayer> &_playerList); //when KSquaresGame says the game is over. Display score board
private:
enum StatusBarItem
{
statusplayer,
statusnetwork
};
//void setupAccel();
void setupActions();
......@@ -71,9 +65,7 @@ class KSquaresWindow : public KXmlGuiWindow
KSquaresGame* sGame;
// Remember last network move
int m_lastx1, m_lasty1, m_lastx2, m_lasty2;
//KToggleAction *m_toolbarAction;
//KToggleAction *m_statusbarAction;
QLabel *m_player;
};
#endif // KSQUARESWINDOW_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment