Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit df5971af authored by Nemanja Hirsl's avatar Nemanja Hirsl

Replace KDialog with QDialog (frameworks)

REVIEW:122963
parent 6f0decb7
......@@ -80,7 +80,7 @@
#include <KToolBar>
#include <QAction>
#include <QSvgRenderer>
#include <KDialog>
#include <QDialog>
#include <KAboutData>
#include <sys/utsname.h>
......@@ -104,13 +104,16 @@ InvasionSlider::InvasionSlider(KGameWindow* game, GameLogic::Country * attack, G
m_nbLArmies = new QLabel(QString::number(m_nbLArmy));
m_nbRArmies = new QLabel(QString::number(m_nbRArmy));
QVBoxLayout* dialogLayout = new QVBoxLayout(this);
QDialogButtonBox* buttonBox = NULL;
if (invasionType == Invasion)
{
setButtons( KDialog::Ok );
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
}
else if (invasionType == Moving)
{
setButtons( KDialog::Cancel | KDialog::Ok );
buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
}
QWidget* widget = new QWidget(this);
......@@ -171,15 +174,17 @@ InvasionSlider::InvasionSlider(KGameWindow* game, GameLogic::Country * attack, G
//val->setText(QString::number(invadeSlide->value()));
connect(m_invadeSlide,SIGNAL(valueChanged(int)),this,SLOT(slideMove(int)));
connect(m_invadeSlide,SIGNAL(sliderReleased()),this,SLOT(slideReleased()));
connect(this,SIGNAL(okClicked()),this,SLOT(slideClose()));
connect(buttonBox,SIGNAL(accepted()),this,SLOT(slideClose()));
if (invasionType == Moving)
{
connect(this,SIGNAL(cancelClicked()),this,SLOT(slideCancel()));
connect(buttonBox,SIGNAL(rejected()),this,SLOT(slideCancel()));
}
setMainWidget(widget);
widget->setLayout(wSlideLayout);
dialogLayout->addWidget(widget);
if (buttonBox)
dialogLayout->addWidget(buttonBox);
setWindowModality(Qt::ApplicationModal);
}
......@@ -215,11 +220,13 @@ void InvasionSlider::slideClose()
m_game->automaton()->currentPlayerPlayed(true);
QPointF point;
m_game->automaton()->gameEvent("actionNextPlayer", point);
accept();
}
void InvasionSlider::slideCancel()
{
kDebug() << "Move cancel";
reject();
}
} // closing namespace Ksirk
......
......@@ -19,7 +19,7 @@
#ifndef INVASIONSLIDER_H
#define INVASIONSLIDER_H
#include <KDialog>
#include <QDialog>
class QLabel;
class QSlider;
......@@ -37,7 +37,7 @@ namespace GameLogic
* @author Gael de Chalendar (aka Kleag)
* @version $Id: kgamewin.h 243 2007-02-24 00:22:58Z kleag $
*/
class InvasionSlider: public KDialog
class InvasionSlider: public QDialog
{
Q_OBJECT
......
......@@ -83,7 +83,8 @@
#include <KToolBar>
#include <QAction>
#include <QSvgRenderer>
#include <KDialog>
#include <QDialog>
#include <QVBoxLayout>
#include <KAboutData>
#include <QIcon>
#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
......@@ -1230,12 +1231,11 @@ void KGameWindow::createDefenseDialog()
{
kDebug();
// Create Window Dialog
m_defenseDialog = new KDialog ();
m_defenseDialog->setButtons( KDialog::None );
m_defenseDialog = new QDialog ();
QWidget* widget = new QWidget(m_defenseDialog);
QGridLayout * mainLayout = new QGridLayout(widget);
// Create the differents layout for buttons and label
QGridLayout * bottomLayout = new QGridLayout();
QGridLayout * topLayout = new QGridLayout();
......@@ -1279,7 +1279,8 @@ void KGameWindow::createDefenseDialog()
connect(def2, SIGNAL(clicked()), this, SLOT(slotWindowDef2()));
connect(defAuto, SIGNAL(clicked()), this, SLOT(slotDefAuto()));
m_defenseDialog->setMainWidget(widget);
QVBoxLayout *dialogLayout = new QVBoxLayout(m_defenseDialog);
dialogLayout->addWidget(widget);
}
void KGameWindow::displayDefenseWindow()
......
......@@ -60,7 +60,7 @@ class NewGameSetup;
class QAction;
class KGameChat;
class KGamePopupItem;
class KDialog;
class QDialog;
class QAction;
class QEvent;
......@@ -1077,7 +1077,7 @@ private: // Private members
GameLogic::Country* m_mouseLocalisation;
KDialog * m_defenseDialog;
QDialog * m_defenseDialog;
// components that will be re-used of the chat
QPixmap m_upChatFloatPix;
......
......@@ -68,7 +68,6 @@
#include <KToolBar>
#include <QAction>
#include <QSvgRenderer>
#include <KDialog>
#include <KAboutApplicationDialog>
#include <KRecentFilesAction>
......
......@@ -45,7 +45,6 @@
class QAction;
class KToolBar;
class KDialog;
class KRecentFilesAction;
class QEvent;
......
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