summaryrefslogtreecommitdiffstats
path: root/kwin4/kwin4/kwin4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kwin4/kwin4/kwin4.cpp')
-rw-r--r--kwin4/kwin4/kwin4.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/kwin4/kwin4/kwin4.cpp b/kwin4/kwin4/kwin4.cpp
index fb66e687..16b37da5 100644
--- a/kwin4/kwin4/kwin4.cpp
+++ b/kwin4/kwin4/kwin4.cpp
@@ -16,13 +16,13 @@
***************************************************************************/
// include files for QT
-#include <qstring.h>
-#include <qlayout.h>
-#include <qhgroupbox.h>
-#include <qvbox.h>
-#include <qradiobutton.h>
-#include <qvbuttongroup.h>
-#include <qlcdnumber.h>
+#include <tqstring.h>
+#include <tqlayout.h>
+#include <tqhgroupbox.h>
+#include <tqvbox.h>
+#include <tqradiobutton.h>
+#include <tqvbuttongroup.h>
+#include <tqlcdnumber.h>
// include files for KDE
#include <kapplication.h>
@@ -35,7 +35,7 @@
#include <kdebug.h>
#include <kstdaction.h>
#include <kaction.h>
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
#include <kstatusbar.h>
#include <kconfigdialog.h>
@@ -63,26 +63,26 @@
* Constructor for the chat widget. This widget
* is derived from the libkdegames chat widget
*/
-ChatDlg::ChatDlg(KGame *game,QWidget *parent)
+ChatDlg::ChatDlg(KGame *game,TQWidget *parent)
: KDialogBase(Plain,i18n("Chat Dlg"),Ok,Ok,parent,0,false,true),mChat(0), mChatDlg(0)
{
- setMinimumSize(QSize(200,200));
+ setMinimumSize(TQSize(200,200));
- QGridLayout* mGridLayout=new QGridLayout(plainPage());
- QHBoxLayout* h = new QHBoxLayout(plainPage());
- QHGroupBox* b = new QHGroupBox(i18n("Chat"), plainPage());
+ TQGridLayout* mGridLayout=new TQGridLayout(plainPage());
+ TQHBoxLayout* h = new TQHBoxLayout(plainPage());
+ TQHGroupBox* b = new TQHGroupBox(i18n("Chat"), plainPage());
mChat = new KGameChat(game, 10000, b);
h->addWidget(b, 1);
h->addSpacing(10);
mGridLayout->addLayout(h,0,0);
- QPushButton *mButton=new QPushButton(i18n("Configure..."),plainPage());
+ TQPushButton *mButton=new TQPushButton(i18n("Configure..."),plainPage());
mGridLayout->addWidget(mButton,1,1);
adjustSize();
mChatDlg=new KChatDialog(mChat,plainPage(),true);
- connect(mButton,SIGNAL(clicked()),mChatDlg,SLOT(show()));
+ connect(mButton,TQT_SIGNAL(clicked()),mChatDlg,TQT_SLOT(show()));
}
/**
@@ -107,7 +107,7 @@ void ChatDlg::setPlayer(Kwin4Player *p)
/**
* Construct the main application window
*/
-Kwin4App::Kwin4App(QWidget *parent, const char *name) : KMainWindow(parent,name), view(0), doc(0), mChat(0), mMyChatDlg(0)
+Kwin4App::Kwin4App(TQWidget *parent, const char *name) : KMainWindow(parent,name), view(0), doc(0), mChat(0), mMyChatDlg(0)
{
initGUI();
initStatusBar();
@@ -188,50 +188,50 @@ void Kwin4App::checkMenus(CheckFlags menu)
*/
void Kwin4App::initGUI()
{
- KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection(), "new_game");
+ KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection(), "new_game");
ACTION("new_game")->setStatusText(i18n("Start a new game"));
- KStdGameAction::load(this, SLOT(slotOpenGame()), actionCollection(), "open");
+ KStdGameAction::load(this, TQT_SLOT(slotOpenGame()), actionCollection(), "open");
ACTION("open")->setStatusText(i18n("Open a saved game..."));
- KStdGameAction::save(this, SLOT(slotSaveGame()), actionCollection(), "save");
+ KStdGameAction::save(this, TQT_SLOT(slotSaveGame()), actionCollection(), "save");
ACTION("save")->setStatusText(i18n("Save a game..."));
- KStdGameAction::end(this, SLOT(endGame()), actionCollection(), "end_game");
+ KStdGameAction::end(this, TQT_SLOT(endGame()), actionCollection(), "end_game");
ACTION("end_game")->setStatusText(i18n("Ending the current game..."));
ACTION("end_game")->setWhatsThis(i18n("Aborts a currently played game. No winner will be declared."));
- new KAction(i18n("&Network Configuration..."),0, this, SLOT(slotInitNetwork()),
+ new KAction(i18n("&Network Configuration..."),0, this, TQT_SLOT(slotInitNetwork()),
actionCollection(), "network_conf");
- new KAction(i18n("Network Chat..."),0, this, SLOT(slotChat()),
+ new KAction(i18n("Network Chat..."),0, this, TQT_SLOT(slotChat()),
actionCollection(), "network_chat");
if (global_debug>0)
- new KAction(i18n("Debug KGame"), 0, this, SLOT(slotDebugKGame()),
+ new KAction(i18n("Debug KGame"), 0, this, TQT_SLOT(slotDebugKGame()),
actionCollection(), "file_debug");
new KAction(i18n("&Show Statistics"),"flag", 0, this,
- SLOT(showStatistics()), actionCollection(), "statistics");
+ TQT_SLOT(showStatistics()), actionCollection(), "statistics");
ACTION("statistics")->setStatusText(i18n("Show statistics."));
- KStdGameAction::hint(doc, SLOT(calcHint()), actionCollection(), "hint");
+ KStdGameAction::hint(doc, TQT_SLOT(calcHint()), actionCollection(), "hint");
ACTION("hint")->setStatusText(i18n("Shows a hint on how to move."));
- KStdGameAction::quit(this, SLOT(close()), actionCollection(), "game_exit");
+ KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection(), "game_exit");
ACTION("game_exit")->setStatusText(i18n("Quits the program."));
- KStdGameAction::undo(this, SLOT(slotUndo()), actionCollection(), "edit_undo");
+ KStdGameAction::undo(this, TQT_SLOT(slotUndo()), actionCollection(), "edit_undo");
ACTION("edit_undo")->setStatusText(i18n("Undo last move."));
- KStdGameAction::redo(this, SLOT(slotRedo()), actionCollection(), "edit_redo");
+ KStdGameAction::redo(this, TQT_SLOT(slotRedo()), actionCollection(), "edit_redo");
ACTION("edit_redo")->setStatusText(i18n("Redo last move."));
actionCollection()->setHighlightingEnabled(true);
- connect(actionCollection(), SIGNAL(actionStatusText(const QString &)), SLOT(slotStatusMsg(const QString &)));
- connect(actionCollection(), SIGNAL(clearStatusText()), SLOT(slotClearStatusText()));
+ connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)), TQT_SLOT(slotStatusMsg(const TQString &)));
+ connect(actionCollection(), TQT_SIGNAL(clearStatusText()), TQT_SLOT(slotClearStatusText()));
- KStdAction::preferences(this, SLOT(showSettings()), actionCollection());
+ KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection());
}
/**
@@ -263,17 +263,17 @@ void Kwin4App::initDocument()
{
doc = new Kwin4Doc(this);
// Game Over signal
- connect(doc,SIGNAL(signalGameOver(int, KPlayer *,KGame *)),
- this,SLOT(slotGameOver(int, KPlayer *,KGame *)));
- connect(doc,SIGNAL(signalMoveDone(int, int)),
- this,SLOT(slotMoveDone(int, int)));
- connect(doc,SIGNAL(signalClientLeftGame(int, int,KGame *)),
- this,SLOT(slotNetworkBroken(int, int, KGame *)));
- connect(doc,SIGNAL(signalNextPlayer()),
- this,SLOT(slotStatusNames()));
+ connect(doc,TQT_SIGNAL(signalGameOver(int, KPlayer *,KGame *)),
+ this,TQT_SLOT(slotGameOver(int, KPlayer *,KGame *)));
+ connect(doc,TQT_SIGNAL(signalMoveDone(int, int)),
+ this,TQT_SLOT(slotMoveDone(int, int)));
+ connect(doc,TQT_SIGNAL(signalClientLeftGame(int, int,KGame *)),
+ this,TQT_SLOT(slotNetworkBroken(int, int, KGame *)));
+ connect(doc,TQT_SIGNAL(signalNextPlayer()),
+ this,TQT_SLOT(slotStatusNames()));
- connect(doc,SIGNAL(signalGameRun()),
- this,SLOT(slotNewGame()));
+ connect(doc,TQT_SIGNAL(signalGameRun()),
+ this,TQT_SLOT(slotNewGame()));
}
void Kwin4App::changeAction(const char *action, bool enable){
@@ -290,7 +290,7 @@ void Kwin4App::changeAction(const char *action, bool enable){
*/
void Kwin4App::saveProperties(KConfig *cfg)
{
- QString tempfile = kapp->tempSaveName(QDir::currentDirPath()+"kwin4");
+ TQString tempfile = kapp->tempSaveName(TQDir::currentDirPath()+"kwin4");
cfg->writePathEntry("filename", tempfile );
doc->save(tempfile);
}
@@ -300,7 +300,7 @@ void Kwin4App::saveProperties(KConfig *cfg)
*/
void Kwin4App::readProperties(KConfig* cfg)
{
- QString filename = cfg->readPathEntry("filename");
+ TQString filename = cfg->readPathEntry("filename");
if(!filename.isEmpty())
doc->load(filename);
}
@@ -310,9 +310,9 @@ void Kwin4App::readProperties(KConfig* cfg)
*/
void Kwin4App::slotOpenGame()
{
- QString dir(":<kwin4>");
- QString filter("*");
- QString file("/tmp/kwin.save");
+ TQString dir(":<kwin4>");
+ TQString filter("*");
+ TQString file("/tmp/kwin.save");
if (global_debug < 10)
file=KFileDialog::getOpenFileName(dir,filter,this);
doc->load(file,true);
@@ -324,9 +324,9 @@ void Kwin4App::slotOpenGame()
*/
void Kwin4App::slotSaveGame()
{
- QString dir(":<kwin4>");
- QString filter("*");
- QString file("/tmp/kwin.save");
+ TQString dir(":<kwin4>");
+ TQString filter("*");
+ TQString file("/tmp/kwin.save");
if (global_debug < 10)
file=KFileDialog::getSaveFileName(dir,filter,this);
doc->save(file);
@@ -384,7 +384,7 @@ void Kwin4App::showStatistics()
dlg->p2_aborted->display(doc->QueryStat(Rot, TBrk));
dlg->p2_sum->display(doc->QueryStat(Rot, TSum));
- if(dlg->exec() == QDialog::Rejected)
+ if(dlg->exec() == TQDialog::Rejected)
doc->ResetStat();
}
@@ -419,7 +419,7 @@ void Kwin4App::slotRedo()
* Set the given text into the statusbar
* change status message permanently
*/
-void Kwin4App::slotStatusMsg(const QString &text)
+void Kwin4App::slotStatusMsg(const TQString &text)
{
statusBar()->clear();
statusBar()->changeItem(text, ID_STATUS_MSG);
@@ -430,7 +430,7 @@ void Kwin4App::slotStatusMsg(const QString &text)
* the player currently moving
* change status mover permanently
*/
-void Kwin4App::slotStatusMover(const QString &text)
+void Kwin4App::slotStatusMover(const TQString &text)
{
statusBar()->clear();
statusBar()->changeItem(text, ID_STATUS_MOVER);
@@ -452,13 +452,13 @@ void Kwin4App::EndGame(TABLE mode)
* Set the names in the mover field
*/
void Kwin4App::slotStatusNames(){
- QString msg;
+ TQString msg;
if (!(doc->gameStatus()==KGame::Run))
msg=i18n("No game ");
else if (doc->QueryCurrentPlayer()==Gelb)
- msg=QString(" ")+doc->QueryName(Gelb)+ i18n(" - Yellow ");
+ msg=TQString(" ")+doc->QueryName(Gelb)+ i18n(" - Yellow ");
else if (doc->QueryCurrentPlayer())
- msg=QString(" ")+doc->QueryName(Rot)+ i18n(" - Red ");
+ msg=TQString(" ")+doc->QueryName(Rot)+ i18n(" - Red ");
else
msg=i18n("Nobody ");
slotStatusMover(msg);
@@ -509,13 +509,13 @@ void Kwin4App::slotGameOver(int status, KPlayer * p, KGame * /*me*/)
EndGame(TWin);
else
EndGame(TLost);
- QString msg=i18n("%1 won the game. Please restart next round.").arg(doc->QueryName(((FARBE)p->userId())));
+ TQString msg=i18n("%1 won the game. Please restart next round.").arg(doc->QueryName(((FARBE)p->userId())));
slotStatusMsg(msg);
}
else if (status==2) // Abort
{
EndGame(TBrk);
- QString m=i18n(" Game aborted. Please restart next round.");
+ TQString m=i18n(" Game aborted. Please restart next round.");
slotStatusMsg(m);
}
else
@@ -529,7 +529,7 @@ void Kwin4App::slotInitNetwork()
{
if (doc->gameStatus()==Kwin4Doc::Intro) doc->setGameStatus(Kwin4Doc::Pause);
- QString host = Prefs::host();
+ TQString host = Prefs::host();
int port=Prefs::port();
// just for testing - should be non-modal
@@ -538,15 +538,15 @@ void Kwin4App::slotInitNetwork()
dlg.networkConfig()->setDefaultNetworkInfo(host, port);
dlg.networkConfig()->setDiscoveryInfo("_kwin4._tcp",Prefs::gamename());
- QVBox *box=dlg.configPage(KGameDialog::NetworkConfig);
- QVBoxLayout *l=(QVBoxLayout *)(box->layout());
+ TQVBox *box=dlg.configPage(KGameDialog::NetworkConfig);
+ TQVBoxLayout *l=(TQVBoxLayout *)(box->layout());
- mColorGroup=new QVButtonGroup(box);
- connect(mColorGroup, SIGNAL(clicked(int)), this, SLOT(slotRemoteChanged(int)));
- connect(dlg.networkConfig(), SIGNAL(signalServerTypeChanged(int)), this, SLOT(slotServerTypeChanged(int)));
+ mColorGroup=new TQVButtonGroup(box);
+ connect(mColorGroup, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(slotRemoteChanged(int)));
+ connect(dlg.networkConfig(), TQT_SIGNAL(signalServerTypeChanged(int)), this, TQT_SLOT(slotServerTypeChanged(int)));
- new QRadioButton(i18n("Yellow should be played by remote"), mColorGroup);
- new QRadioButton(i18n("Red should be played by remote"), mColorGroup);
+ new TQRadioButton(i18n("Yellow should be played by remote"), mColorGroup);
+ new TQRadioButton(i18n("Red should be played by remote"), mColorGroup);
l->addWidget(mColorGroup);
mColorGroup->setButton(0);
slotRemoteChanged(0);
@@ -590,8 +590,8 @@ void Kwin4App::slotChat()
mMyChatDlg->setPlayer(doc->getPlayer(Gelb));
else
mMyChatDlg->setPlayer(doc->getPlayer(Rot));
- connect(doc,SIGNAL(signalChatChanged(Kwin4Player *)),
- mMyChatDlg,SLOT(setPlayer(Kwin4Player *)));
+ connect(doc,TQT_SIGNAL(signalChatChanged(Kwin4Player *)),
+ mMyChatDlg,TQT_SLOT(setPlayer(Kwin4Player *)));
}
if (mMyChatDlg->isHidden())
@@ -619,7 +619,7 @@ void Kwin4App::showSettings(){
KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow);
Settings *general = new Settings(0, "General");
dialog->addPage(general, i18n("General"), "package_settings");
- connect(dialog, SIGNAL(settingsChanged()), doc, SLOT(loadSettings()));
+ connect(dialog, TQT_SIGNAL(settingsChanged()), doc, TQT_SLOT(loadSettings()));
dialog->show();
}