summaryrefslogtreecommitdiffstats
path: root/knights/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'knights/core.cpp')
-rw-r--r--knights/core.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/knights/core.cpp b/knights/core.cpp
index e0b09ce..69e59fd 100644
--- a/knights/core.cpp
+++ b/knights/core.cpp
@@ -19,8 +19,8 @@
#include <kfiledialog.h>
#include <kmessagebox.h>
-/* Qt */
-#include <qpushbutton.h>
+/* TQt */
+#include <tqpushbutton.h>
/* Local */
#include "core.moc"
@@ -39,7 +39,7 @@
// core::core
//
///////////////////////////////////////
-core::core(QWidget *parent, const char *name, resource *Rsrc ) : QWidget(parent,name)
+core::core(TQWidget *tqparent, const char *name, resource *Rsrc ) : TQWidget(tqparent,name)
{
myResource = Rsrc;
listPGN = NULL;
@@ -47,8 +47,8 @@ core::core(QWidget *parent, const char *name, resource *Rsrc ) : QWidget(parent,
myButtonGroup = new thinbuttons( this, "ButtonGroup", myResource );
myButtonGroup->show();
- connect( myButtonGroup, SIGNAL( leftClick(int) ), this, SLOT( setMatch(int) ) );
- connect( myButtonGroup, SIGNAL( menuItemSelected(int,int) ), this, SLOT( thinButtonMenu(int,int) ) );
+ connect( myButtonGroup, TQT_SIGNAL( leftClick(int) ), this, TQT_SLOT( setMatch(int) ) );
+ connect( myButtonGroup, TQT_SIGNAL( menuItemSelected(int,int) ), this, TQT_SLOT( thinButtonMenu(int,int) ) );
myCoreClock.start( 100, FALSE );
resize();
@@ -85,12 +85,12 @@ void core::createNewIO( int type, int ID, int side, int str )
internetioPtr = new io_internet( this, myResource );
myIOMap.add( ID, internetioPtr );
internetioPtr->setID( ID );
- connect( internetioPtr, SIGNAL( sendCMD( const Command& ) ), this, SLOT( command2Match( const Command& ) ) );
+ connect( internetioPtr, TQT_SIGNAL( sendCMD( const Command& ) ), this, TQT_SLOT( command2Match( const Command& ) ) );
}
else
{
/* Use an existing internetIO */
- internetioPtr = (io_internet*) myIOMap.find(Null);
+ internetioPtr = (io_internet*) myIOMap.tqfind(Null);
if( internetioPtr == NULL )
{
kdWarning() << "core::createNewIO: Trying to connect a match to an internetIO that doesn't exsist." << endl;
@@ -110,16 +110,16 @@ void core::createNewIO( int type, int ID, int side, int str )
internetioPtr = new io_internet( this, myResource );
myIOMap.add( ID, internetioPtr );
internetioPtr->setID( ID );
- connect( internetioPtr, SIGNAL( sendCMD( const Command& ) ), this, SLOT( command2Match( const Command& ) ) );
+ connect( internetioPtr, TQT_SIGNAL( sendCMD( const Command& ) ), this, TQT_SLOT( command2Match( const Command& ) ) );
}
else
{
- internetioPtr = (io_internet*) myIOMap.find(ID);
+ internetioPtr = (io_internet*) myIOMap.tqfind(ID);
if( internetioPtr == NULL )
{
/* no io mapped to the ID yet, use the internetio */
/* Use an existing internetIO */
- internetioPtr = (io_internet*) myIOMap.find(Null);
+ internetioPtr = (io_internet*) myIOMap.tqfind(Null);
if( internetioPtr == NULL )
{
kdWarning() << "core::createNewIO: Trying to connect a match to an internetIO that doesn't exsist." << endl;
@@ -137,16 +137,16 @@ void core::createNewIO( int type, int ID, int side, int str )
engineioPtr = new io_engine( this, myResource );
myIOMap.add( ID, engineioPtr );
engineioPtr->setID( ID );
- connect( engineioPtr, SIGNAL( sendCMD( const Command& ) ), this, SLOT( command2Match( const Command& ) ) );
+ connect( engineioPtr, TQT_SIGNAL( sendCMD( const Command& ) ), this, TQT_SLOT( command2Match( const Command& ) ) );
engineioPtr->Start( side );
- engineioPtr->recvCMD( Command( ID, CMD_Set_Difficulty, QString().setNum( 1 << str ) ) );
+ engineioPtr->recvCMD( Command( ID, CMD_Set_Difficulty, TQString().setNum( 1 << str ) ) );
break;
/* PLAYEREMAIL */
case PLAYEREMAIL:
// ioEmailPtr = new io_email( this, myResource );
// myIOMap.add( ID, ioEmailPtr );
// ioEmailPtr->setID( ID );
-// connect( ioEmailPtr, SIGNAL( sendCMD( const Command& ) ), this, SLOT( command2Match( const Command& ) ) );
+// connect( ioEmailPtr, TQT_SIGNAL( sendCMD( const Command& ) ), this, TQT_SLOT( command2Match( const Command& ) ) );
break;
default:
/* No IO needed */
@@ -180,8 +180,8 @@ match* core::newMatch( match_param* param )
createNewIO( param->type(BLACK), newID, BLACK, param->strength(BLACK) );
/* Connect Signals */
- connect( match_ptr, SIGNAL( sendCMD( const Command& ) ), this, SLOT( command2IO( const Command& ) ) );
- connect( &myCoreClock, SIGNAL( timeout() ), match_ptr, SLOT( tick() ) );
+ connect( match_ptr, TQT_SIGNAL( sendCMD( const Command& ) ), this, TQT_SLOT( command2IO( const Command& ) ) );
+ connect( &myCoreClock, TQT_SIGNAL( timeout() ), match_ptr, TQT_SLOT( tick() ) );
/* Set this new match as the current match */
setMatch( newID );
@@ -206,20 +206,20 @@ void core::setMatch( int ID )
if( currentMatch != NULL )
{
currentMatch->setCurrent( FALSE );
- disconnect( currentMatch, SIGNAL( setClocks() ), this, SLOT( slot_setClocks() ) );
- disconnect( currentMatch, SIGNAL( setStatusBar( const int&, const QString& ) ), this, SLOT( slot_setStatusBar( const int&, const QString& ) ) );
- disconnect( currentMatch, SIGNAL( setNotation() ), this, SLOT( slot_setNotation() ) );
+ disconnect( currentMatch, TQT_SIGNAL( setClocks() ), this, TQT_SLOT( slot_setClocks() ) );
+ disconnect( currentMatch, TQT_SIGNAL( setStatusBar( const int&, const TQString& ) ), this, TQT_SLOT( slot_setStatusBar( const int&, const TQString& ) ) );
+ disconnect( currentMatch, TQT_SIGNAL( setNotation() ), this, TQT_SLOT( slot_setNotation() ) );
currentMatch->setVisibility( FALSE );
}
/*
Now display the new match, and connect it's signals to the GUI
*/
- currentMatch = myMatchMap.find( ID );
+ currentMatch = myMatchMap.tqfind( ID );
currentMatch->setVisibility( TRUE );
myButtonGroup->setButton( ID );
- connect( currentMatch, SIGNAL( setClocks() ), this, SLOT( slot_setClocks() ) );
- connect( currentMatch, SIGNAL( setStatusBar( const int&, const QString& ) ), this, SLOT( slot_setStatusBar( const int&, const QString& ) ) );
- connect( currentMatch, SIGNAL( setNotation() ), this, SLOT( slot_setNotation() ) );
+ connect( currentMatch, TQT_SIGNAL( setClocks() ), this, TQT_SLOT( slot_setClocks() ) );
+ connect( currentMatch, TQT_SIGNAL( setStatusBar( const int&, const TQString& ) ), this, TQT_SLOT( slot_setStatusBar( const int&, const TQString& ) ) );
+ connect( currentMatch, TQT_SIGNAL( setNotation() ), this, TQT_SLOT( slot_setNotation() ) );
currentMatch->setCurrent( TRUE );
emit requestResize();
emit initMatch();
@@ -227,7 +227,7 @@ void core::setMatch( int ID )
/* Give Ourselves Focus */
setActiveWindow();
- topLevelWidget()->raise();
+ tqtopLevelWidget()->raise();
}
///////////////////////////////////////
@@ -264,7 +264,7 @@ bool core::clearMatch( int id )
return FALSE;
}
}
- departingMatch = myMatchMap.find(id);
+ departingMatch = myMatchMap.tqfind(id);
/* A bad ID was passed */
if( departingMatch == NULL )
@@ -305,7 +305,7 @@ bool core::clearMatch( int id )
}
/* Remove IOs in this match... */
- ioPtr = myIOMap.find(id);
+ ioPtr = myIOMap.tqfind(id);
while( ioPtr != NULL )
{
myIOMap.remove( id );
@@ -313,7 +313,7 @@ bool core::clearMatch( int id )
{
delete ioPtr;
}
- ioPtr = myIOMap.find(id);
+ ioPtr = myIOMap.tqfind(id);
}
/* ...and remove the match */
@@ -357,7 +357,7 @@ void core::command2IO( const Command &command )
io_base *io;
int id = ((Command)command).getID();
- io = myIOMap.find(id);
+ io = myIOMap.tqfind(id);
while( io != NULL )
{
io->recvCMD(command);
@@ -375,7 +375,7 @@ void core::command2Match( const Command &command )
match *matchPtr;
Command cmd = command;
- matchPtr = myMatchMap.find( cmd.getID() );
+ matchPtr = myMatchMap.tqfind( cmd.getID() );
while( matchPtr != NULL )
{
/* Catch Commands Meant for Core */
@@ -438,9 +438,9 @@ bool core::flag( const bool Army )
// core::clock
//
///////////////////////////////////////
-QString core::clock( const bool Army )
+TQString core::clock( const bool Army )
{
- if( currentMatch == NULL ) return QString::null;
+ if( currentMatch == NULL ) return TQString();
return currentMatch->clock( Army );
return "";
}
@@ -499,11 +499,11 @@ char core::onMove( void )
// core::caption
//
///////////////////////////////////////
-QString core::caption( void )
+TQString core::caption( void )
{
- QButton *Button;
- if( currentMatch == NULL ) return QString::null;
- Button = myButtonGroup->find( currentMatch->getID() );
+ TQButton *Button;
+ if( currentMatch == NULL ) return TQString();
+ Button = myButtonGroup->tqfind( currentMatch->getID() );
if( Button != NULL ) Button->setText( currentMatch->caption() );
return currentMatch->caption();
}
@@ -552,7 +552,7 @@ char core::inputOnMove( bool reverse )
// core::notation
//
///////////////////////////////////////
-QStringList* core::notation( void )
+TQStringList* core::notation( void )
{
if( currentMatch == NULL ) return NULL;
return currentMatch->notation();
@@ -571,7 +571,7 @@ void core::slot_setNotation( void )
// core::slot_setStatusBar
//
///////////////////////////////////////
-void core::slot_setStatusBar( const int &ID, const QString& MSG )
+void core::slot_setStatusBar( const int &ID, const TQString& MSG )
{
emit setStatusBar( ID, MSG );
}
@@ -599,7 +599,7 @@ void core::print( int ID )
}
else
{
- m2p = myMatchMap.find( ID );
+ m2p = myMatchMap.tqfind( ID );
}
if( m2p == NULL ) return;
m2p->print();
@@ -612,21 +612,21 @@ void core::print( int ID )
///////////////////////////////////////
bool core::load( void )
{
- const QString fileFilter( "*.pgn *.Pgn *.PGN|Portable Game Notation (.pgn)\n*|All Files" );
- QString URL;
- URL = KFileDialog::getOpenFileName( QString::null, QString( fileFilter ), this, i18n( "Load PGN..." ) );
+ const TQString fileFilter( "*.pgn *.Pgn *.PGN|Portable Game Notation (.pgn)\n*|All Files" );
+ TQString URL;
+ URL = KFileDialog::getOpenFileName( TQString(), TQString( fileFilter ), this, i18n( "Load PGN..." ) );
if( URL.isEmpty() ) return FALSE;
return load( URL );
}
-bool core::load( const QString &IncURL )
+bool core::load( const TQString &IncURL )
{
listPGN = new list_pgn( 0, "listPGN" );
myResource->tabManager->addTab( listPGN, IncURL.section( '/', -1 ) );
- connect( listPGN, SIGNAL( selected( const QString&, const int& ) ), this, SLOT( load( const QString&, const int& ) ) );
+ connect( listPGN, TQT_SIGNAL( selected( const TQString&, const int& ) ), this, TQT_SLOT( load( const TQString&, const int& ) ) );
listPGN->setURL( IncURL );
return TRUE;
}
-bool core::load( const QString &url, const int &pos )
+bool core::load( const TQString &url, const int &pos )
{
newMatch( new match_param( myResource, PLAYERLOAD, PLAYERLOAD ) );
return currentMatch->load( url, pos );
@@ -638,10 +638,10 @@ bool core::load( const QString &url, const int &pos )
///////////////////////////////////////
bool core::save( const int ID, const bool Prompt, const bool SaveAs )
{
- const QString fileFilter( "*.pgn *.Pgn *.PGN|Portable Game Notation (.pgn)\n*|All Files" );
+ const TQString fileFilter( "*.pgn *.Pgn *.PGN|Portable Game Notation (.pgn)\n*|All Files" );
match *match2bSaved;
int answer;
- QString URL;
+ TQString URL;
if( ID == Null )
{
@@ -650,7 +650,7 @@ bool core::save( const int ID, const bool Prompt, const bool SaveAs )
}
else
{
- match2bSaved = myMatchMap.find( ID );
+ match2bSaved = myMatchMap.tqfind( ID );
}
if( match2bSaved == NULL ) return FALSE;
if( Prompt )
@@ -660,9 +660,9 @@ bool core::save( const int ID, const bool Prompt, const bool SaveAs )
answer = KMessageBox::warningYesNoCancel( this,
i18n("Would you like to save this match?"),
i18n("Save Match?"),
- QString::null,
- QString::null,
- QString("PromptForSaving") );
+ TQString(),
+ TQString(),
+ TQString("PromptForSaving") );
myResource->ConfigRead();
if( answer == KMessageBox::Cancel )
{
@@ -678,12 +678,12 @@ bool core::save( const int ID, const bool Prompt, const bool SaveAs )
if( ( URL.isEmpty() ) || ( SaveAs ) )
{
/* Get a new URL */
- URL = KFileDialog::getSaveFileName( QString::null, QString( fileFilter ), this, i18n( "Save Match..." ) );
+ URL = KFileDialog::getSaveFileName( TQString(), TQString( fileFilter ), this, i18n( "Save Match..." ) );
if( URL.isNull() )
{
return FALSE;
}
- if( URL.findRev( ".pgn", -1, FALSE ) == -1 )
+ if( URL.tqfindRev( ".pgn", -1, FALSE ) == -1 )
{
URL += ".pgn";
}
@@ -712,11 +712,11 @@ void core::matchMenu( int opt )
case MENU_ACCEPT_DRAW:
if( whiteInput() == PLAYERLOCAL )
{
- command2Match( Command( currentMatch->getID(), CMD_Offer_Draw, QString("W") ) );
+ command2Match( Command( currentMatch->getID(), CMD_Offer_Draw, TQString("W") ) );
}
if( blackInput() == PLAYERLOCAL )
{
- command2Match( Command( currentMatch->getID(), CMD_Offer_Draw, QString("B") ) );
+ command2Match( Command( currentMatch->getID(), CMD_Offer_Draw, TQString("B") ) );
}
command2IO( Command( currentMatch->getID(), CMD_Offer_Draw ) );
break;
@@ -756,7 +756,7 @@ void core::matchMenu( int opt )
case MENU_HINT:
currentMatch->requestHint();
break;
- /* Orientation */
+ /* Qt::Orientation */
case MENU_ORIENTATION:
currentMatch->flip();
break;