Commit 4f18d950 authored by Andrius Štikonas's avatar Andrius Štikonas
Browse files

Port status bar to QStatusBar.

parent 79cc7025
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
// #include <qnamespace.h> // #include <qnamespace.h>
#define IDS_PAUSE 1 #define IDS_PAUSE 0
#define IDS_MAIN 2 #define IDS_MAIN 1
#define PlayerKeyLeft 0 #define PlayerKeyLeft 0
#define PlayerKeyRight 1 #define PlayerKeyRight 1
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <QWidget> #include <QWidget>
#include <krandomsequence.h> #include <KRandomSequence>
class KToggleAction; class KToggleAction;
class KActionCollection; class KActionCollection;
class QGraphicsSimpleTextItem; class QGraphicsSimpleTextItem;
......
...@@ -18,20 +18,20 @@ ...@@ -18,20 +18,20 @@
#include "topwidget.h" #include "topwidget.h"
#include <QBoxLayout>
#include <QIcon> #include <QIcon>
#include <kshortcutsdialog.h> #include <QStatusBar>
#include <KActionCollection>
#include <KLocalizedString> #include <KLocalizedString>
#include <kstandardaction.h> #include <KShortcutsDialog>
#include <kstandardgameaction.h> #include <KStandardAction>
#include <qstatusbar.h> #include <KStandardGameAction>
#include <ktoggleaction.h> #include <KToggleAction>
#include <kactioncollection.h>
#include "mainview.h" #include "mainview.h"
#include "playerinfo.h" #include "playerinfo.h"
#include <QBoxLayout>
MyTopLevelWidget::MyTopLevelWidget() MyTopLevelWidget::MyTopLevelWidget()
{ {
...@@ -163,9 +163,16 @@ void MyTopLevelWidget::setupActions() ...@@ -163,9 +163,16 @@ void MyTopLevelWidget::setupActions()
void MyTopLevelWidget::initStatusBar( ) void MyTopLevelWidget::initStatusBar( )
{ {
//QT5 statusBar( )->insertItem(i18n(" paused "),IDS_PAUSE); for (auto &label : m_statusBarLabel)
//QT5 statusBar( )->insertItem(QLatin1String( " " ),IDS_MAIN ,1); {
//QT5 statusBar( )->insertItem(QLatin1String( "" ),42); label = new QLabel(this);
label->setAlignment(Qt::AlignCenter);
statusBar()->addWidget(label, 1);
}
m_statusBarLabel[IDS_PAUSE]->setText(i18n(" paused "));
m_statusBarLabel[IDS_MAIN]->setText(QLatin1String());
m_statusBarLabel[2]->setText(QLatin1String());
} }
void MyTopLevelWidget::start() void MyTopLevelWidget::start()
...@@ -175,7 +182,7 @@ void MyTopLevelWidget::start() ...@@ -175,7 +182,7 @@ void MyTopLevelWidget::start()
void MyTopLevelWidget::setStatusText(const QString & str,int id) void MyTopLevelWidget::setStatusText(const QString & str,int id)
{ {
//QT5 statusBar( )->changeItem(str,id); m_statusBarLabel[id]->setText(str);
} }
void MyTopLevelWidget::keySetup() void MyTopLevelWidget::keySetup()
...@@ -183,5 +190,3 @@ void MyTopLevelWidget::keySetup() ...@@ -183,5 +190,3 @@ void MyTopLevelWidget::keySetup()
playfield->pause(); playfield->pause();
KShortcutsDialog::configure( actionCollection( ), KShortcutsEditor::LetterShortcutsAllowed, this, true ); KShortcutsDialog::configure( actionCollection( ), KShortcutsEditor::LetterShortcutsAllowed, this, true );
} }
...@@ -19,10 +19,11 @@ ...@@ -19,10 +19,11 @@
#ifndef __MY_TOP_WIDGET_H #ifndef __MY_TOP_WIDGET_H
#define __MY_TOP_WIDGET_H #define __MY_TOP_WIDGET_H
#include <kxmlguiwindow.h> #include <KXmlGuiWindow>
class PlayerInfo; class PlayerInfo;
class MyMainView; class MyMainView;
class QLabel;
class MyTopLevelWidget:public KXmlGuiWindow class MyTopLevelWidget:public KXmlGuiWindow
{ {
...@@ -46,6 +47,8 @@ protected: ...@@ -46,6 +47,8 @@ protected:
private: private:
PlayerInfo *playerinfo[2]; PlayerInfo *playerinfo[2];
MyMainView *playfield; MyMainView *playfield;
QLabel *m_statusBarLabel[3];
}; };
#endif #endif
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