diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 18:28:11 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 18:28:11 +0000 |
commit | 9ca7f795653bc31cf1d206da1e12c801a8380fa6 (patch) | |
tree | ee829debe9ad76ce8fc3b10cdc376754dba5ed03 /knights/knights.cpp | |
parent | 98cb2d5fa21e616cfea012f80bf1d989cfe264e3 (diff) | |
download | knights-9ca7f795653bc31cf1d206da1e12c801a8380fa6.tar.gz knights-9ca7f795653bc31cf1d206da1e12c801a8380fa6.zip |
TQt4 port knights
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knights@1238529 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knights/knights.cpp')
-rw-r--r-- | knights/knights.cpp | 288 |
1 files changed, 144 insertions, 144 deletions
diff --git a/knights/knights.cpp b/knights/knights.cpp index ae68539..3ff2094 100644 --- a/knights/knights.cpp +++ b/knights/knights.cpp @@ -33,21 +33,21 @@ #include <klocale.h> /* KFile */ #include <kfiledialog.h> -/* Qt */ -#include <qpalette.h> -#include <qiconset.h> -#include <qlabel.h> -#include <qframe.h> -#include <qstyle.h> +/* TQt */ +#include <tqpalette.h> +#include <tqiconset.h> +#include <tqlabel.h> +#include <tqframe.h> +#include <tqstyle.h> -Knights::Knights(KCmdLineArgs *Args, QWidget *parent, const char *name) : KMainWindow(parent, name) +Knights::Knights(KCmdLineArgs *Args, TQWidget *tqparent, const char *name) : KMainWindow(tqparent, name) { InitAll = TRUE; ResizeFlag = TRUE; Minimized = FALSE; args = Args; SplashScreen = NULL; - setFocusPolicy( ClickFocus ); + setFocusPolicy( TQ_ClickFocus ); } Knights::~Knights() { @@ -76,21 +76,21 @@ void Knights::BirthAll(void) matchMenu = new KPopupMenu( this, "matchMenu"); drawMenu = new KPopupMenu( this, "drawMenu"); tutorialMenu = new KPopupMenu( this, "tutorialMenu"); - MainFrame = new QFrame( this, "MainFrame" ); + MainFrame = new TQFrame( this, "MainFrame" ); Core = new core( MainFrame, "Core", Resource ); - Message = new QLabel( MainFrame, "Message"); - whiteTimeLabel = new QLabel( MainFrame, "whiteTimeLabel"); - blackTimeLabel = new QLabel( MainFrame, "blackTimeLabel"); + Message = new TQLabel( MainFrame, "Message"); + whiteTimeLabel = new TQLabel( MainFrame, "whiteTimeLabel"); + blackTimeLabel = new TQLabel( MainFrame, "blackTimeLabel"); notationBar = new KComboBox( MainFrame, "notationBar"); /* Connect all Signals & Slots */ - connect( Core, SIGNAL( requestResize() ), this, SLOT( resizeMainFrame() ) ); - connect( Core, SIGNAL( setStatusBar(const int&, const QString& ) ), this, SLOT( setStatusBar(const int&, const QString& ) ) ); - connect( Core, SIGNAL( setNotation() ), this, SLOT( setNotation() ) ); - connect( Core, SIGNAL( initMatch() ), this, SLOT( initMatch() ) ); - connect( Core, SIGNAL( setClocks() ), this, SLOT( setClocks() ) ); - connect( Core, SIGNAL( serverDestroyed() ), this, SLOT( netConnect() ) ); - connect( notationBar, SIGNAL( activated(int) ), Core, SLOT( review(int) ) ); + connect( Core, TQT_SIGNAL( requestResize() ), this, TQT_SLOT( resizeMainFrame() ) ); + connect( Core, TQT_SIGNAL( setStatusBar(const int&, const TQString& ) ), this, TQT_SLOT( setStatusBar(const int&, const TQString& ) ) ); + connect( Core, TQT_SIGNAL( setNotation() ), this, TQT_SLOT( setNotation() ) ); + connect( Core, TQT_SIGNAL( initMatch() ), this, TQT_SLOT( initMatch() ) ); + connect( Core, TQT_SIGNAL( setClocks() ), this, TQT_SLOT( setClocks() ) ); + connect( Core, TQT_SIGNAL( serverDestroyed() ), this, TQT_SLOT( netConnect() ) ); + connect( notationBar, TQT_SIGNAL( activated(int) ), Core, TQT_SLOT( review(int) ) ); } /////////////////////////////////////// // @@ -101,7 +101,7 @@ void Knights::menuClose(void) { if( !queryClose() ) return; - qApp->quit(); + tqApp->quit(); } /////////////////////////////////////// // @@ -143,8 +143,8 @@ void Knights::KillAll(void) bool Knights::init( void ) { wiz_setup *Wizard; - QColorGroup GroupWhite; - QColorGroup GroupBlack; + TQColorGroup GroupWhite; + TQColorGroup GroupBlack; BirthAll(); SelectTheme(-1,-1); @@ -154,30 +154,30 @@ bool Knights::init( void ) /* Connect Accelerators */ - connect( Resource->myAccel, SIGNAL( board_up() ), this, SLOT( boardBigger() ) ); - connect( Resource->myAccel, SIGNAL( board_down() ), this, SLOT( boardSmaller() ) ); - connect( Resource->myAccel, SIGNAL( move_prev() ), this, SLOT( PrevNotation() ) ); - connect( Resource->myAccel, SIGNAL( move_next() ), this, SLOT( NextNotation() ) ); - connect( this, SIGNAL( focus( const QChar& ) ), Resource->myAccel, SIGNAL( focus( const QChar& ) ) ); + connect( Resource->myAccel, TQT_SIGNAL( board_up() ), this, TQT_SLOT( boardBigger() ) ); + connect( Resource->myAccel, TQT_SIGNAL( board_down() ), this, TQT_SLOT( boardSmaller() ) ); + connect( Resource->myAccel, TQT_SIGNAL( move_prev() ), this, TQT_SLOT( PrevNotation() ) ); + connect( Resource->myAccel, TQT_SIGNAL( move_next() ), this, TQT_SLOT( NextNotation() ) ); + connect( this, TQT_SIGNAL( focus( const TQChar& ) ), Resource->myAccel, TQT_SIGNAL( focus( const TQChar& ) ) ); initMenus(); /* Init Message */ - Message->setAlignment( Qt::AlignAuto | Qt::AlignVCenter | Qt::SingleLine ); + Message->tqsetAlignment( TQt::AlignAuto | TQt::AlignVCenter | TQt::SingleLine ); /* Init White Time Label */ - GroupWhite.setColor( QColorGroup::Background, Resource->COLOR_White ); - GroupWhite.setColor( QColorGroup::Foreground, Resource->COLOR_Black ); - whiteTimeLabel->setPalette( QPalette( GroupWhite, GroupWhite, GroupWhite ) ); - whiteTimeLabel->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); - whiteTimeLabel->setAlignment( Qt::AlignCenter | Qt::SingleLine ); + GroupWhite.setColor( TQColorGroup::Background, Resource->COLOR_White ); + GroupWhite.setColor( TQColorGroup::Foreground, Resource->COLOR_Black ); + whiteTimeLabel->setPalette( TQPalette( GroupWhite, GroupWhite, GroupWhite ) ); + whiteTimeLabel->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); + whiteTimeLabel->tqsetAlignment( TQt::AlignCenter | TQt::SingleLine ); /* Init Black Time Label */ - GroupBlack.setColor( QColorGroup::Background, Resource->COLOR_Black ); - GroupBlack.setColor( QColorGroup::Foreground, Resource->COLOR_White ); - blackTimeLabel->setPalette( QPalette( GroupBlack, GroupBlack, GroupBlack ) ); - blackTimeLabel->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); - blackTimeLabel->setAlignment( Qt::AlignCenter | Qt::SingleLine ); + GroupBlack.setColor( TQColorGroup::Background, Resource->COLOR_Black ); + GroupBlack.setColor( TQColorGroup::Foreground, Resource->COLOR_White ); + blackTimeLabel->setPalette( TQPalette( GroupBlack, GroupBlack, GroupBlack ) ); + blackTimeLabel->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); + blackTimeLabel->tqsetAlignment( TQt::AlignCenter | TQt::SingleLine ); /* Configure self */ setCentralWidget( MainFrame ); @@ -207,7 +207,7 @@ bool Knights::init( void ) /* Begin loading file from command line */ if( args->count() ) { - Core->load( QString( args->arg( 0 ) ) ); + Core->load( TQString( args->arg( 0 ) ) ); } else { @@ -247,125 +247,125 @@ void Knights::initMenus( void ) matchMenu->insertItem( i18n( "&Draw" ), drawMenu, MENU_DRAW ); matchMenu->setItemEnabled( MENU_DRAW, FALSE ); // MENU_RETRACT - matchMenu->insertItem( QIconSet( Resource->LoadIcon( QString("undo"), KIcon::Small ) ), - i18n( "&Retract Move" ), Core, SLOT(matchMenu(int)), 0, MENU_RETRACT ); + matchMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("undo"), KIcon::Small ) ), + i18n( "&Retract Move" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_RETRACT ); matchMenu->setItemEnabled( MENU_RETRACT, FALSE ); - matchMenu->setWhatsThis( MENU_RETRACT, i18n( "Select this to retract your last move." ) ); + matchMenu->tqsetWhatsThis( MENU_RETRACT, i18n( "Select this to retract your last move." ) ); // MENU_RESIGN - matchMenu->insertItem( i18n( "Resign" ), Core, SLOT(matchMenu(int)), 0, MENU_RESIGN ); + matchMenu->insertItem( i18n( "Resign" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_RESIGN ); matchMenu->setItemEnabled( MENU_RESIGN, FALSE ); - matchMenu->setWhatsThis( MENU_RESIGN, i18n( "Use this to concede the match to your opponent." ) ); + matchMenu->tqsetWhatsThis( MENU_RESIGN, i18n( "Use this to concede the match to your opponent." ) ); // MENU_CALL_FLAG - matchMenu->insertItem( i18n( "&Call Flag" ), Core, SLOT(matchMenu(int)), 0, MENU_CALL_FLAG ); + matchMenu->insertItem( i18n( "&Call Flag" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_CALL_FLAG ); matchMenu->setItemEnabled( MENU_CALL_FLAG, FALSE ); - matchMenu->setWhatsThis( MENU_CALL_FLAG, i18n( "Use this to declare the match over, due to your opponent being out of time." ) ); + matchMenu->tqsetWhatsThis( MENU_CALL_FLAG, i18n( "Use this to declare the match over, due to your opponent being out of time." ) ); // MENU_HINT - matchMenu->insertItem( i18n( "&Hint" ), Core, SLOT(matchMenu(int)), 0, MENU_HINT ); + matchMenu->insertItem( i18n( "&Hint" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_HINT ); matchMenu->setItemEnabled( MENU_HINT, FALSE ); - matchMenu->setWhatsThis( MENU_HINT, i18n( "This will ask your opponent for a hint." ) ); + matchMenu->tqsetWhatsThis( MENU_HINT, i18n( "This will ask your opponent for a hint." ) ); // MENU_MOVE_NOW - matchMenu->insertItem( i18n( "Move &Now" ), Core, SLOT(matchMenu(int)), 0, MENU_MOVE_NOW ); + matchMenu->insertItem( i18n( "Move &Now" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_MOVE_NOW ); matchMenu->setItemEnabled( MENU_MOVE_NOW, FALSE ); - matchMenu->setWhatsThis( MENU_MOVE_NOW, i18n( "Clicking this option will force your opponent to move immediately." ) ); + matchMenu->tqsetWhatsThis( MENU_MOVE_NOW, i18n( "Clicking this option will force your opponent to move immediately." ) ); // MENU_ORIENTATION - matchMenu->insertItem( i18n( "&Flip View" ), Core, SLOT(matchMenu(int)), Key_F2, MENU_ORIENTATION ); + matchMenu->insertItem( i18n( "&Flip View" ), Core, TQT_SLOT(matchMenu(int)), Key_F2, MENU_ORIENTATION ); matchMenu->setItemEnabled( MENU_ORIENTATION, FALSE ); - matchMenu->setWhatsThis( MENU_ORIENTATION, i18n( "This will reverse the chessboard's orientation by 180 degrees." ) ); + matchMenu->tqsetWhatsThis( MENU_ORIENTATION, i18n( "This will reverse the chessboard's orientation by 180 degrees." ) ); // MENU_PONDER - matchMenu->insertItem( i18n( "&Ponder" ), this, SLOT(Settings(int)), 0, MENU_PONDER ); + matchMenu->insertItem( i18n( "&Ponder" ), this, TQT_SLOT(Settings(int)), 0, MENU_PONDER ); matchMenu->setItemChecked( MENU_PONDER, Resource->OPTION_Ponder ); matchMenu->setItemEnabled( MENU_PONDER, FALSE ); - matchMenu->setWhatsThis( MENU_PONDER, i18n( "This toggles your opponent's ability to think while it's your turn." ) ); + matchMenu->tqsetWhatsThis( MENU_PONDER, i18n( "This toggles your opponent's ability to think while it's your turn." ) ); matchMenu->insertSeparator(); // MENU_PAUSE - matchMenu->insertItem( QIconSet( Resource->LoadIcon( QString("player_pause"), KIcon::Small ) ), - i18n( "Pause" ), this, SLOT( Settings(int) ), Key_F12, MENU_PAUSE ); + matchMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("player_pause"), KIcon::Small ) ), + i18n( "Pause" ), this, TQT_SLOT( Settings(int) ), Key_F12, MENU_PAUSE ); matchMenu->setItemEnabled( MENU_PAUSE, FALSE ); - matchMenu->setWhatsThis( MENU_PAUSE, i18n( "Select this to pause the clock for this match." ) ); + matchMenu->tqsetWhatsThis( MENU_PAUSE, i18n( "Select this to pause the clock for this match." ) ); /* drawMenu menu */ // MENU_OFFER_DRAW - drawMenu->insertItem( i18n( "&Offer Draw" ), Core, SLOT(matchMenu(int)), 0, MENU_OFFER_DRAW ); - drawMenu->setWhatsThis( MENU_OFFER_DRAW, i18n( "Clicking this will inform your opponent that you are willing draw the match." ) ); + drawMenu->insertItem( i18n( "&Offer Draw" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_OFFER_DRAW ); + drawMenu->tqsetWhatsThis( MENU_OFFER_DRAW, i18n( "Clicking this will inform your opponent that you are willing draw the match." ) ); // MENU_ACCEPT_DRAW - drawMenu->insertItem( i18n( "&Accept Draw" ), Core, SLOT(matchMenu(int)), 0, MENU_ACCEPT_DRAW ); - drawMenu->setWhatsThis( MENU_ACCEPT_DRAW, i18n( "Clicking this will accept a draw offered by your opponent." ) ); + drawMenu->insertItem( i18n( "&Accept Draw" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_ACCEPT_DRAW ); + drawMenu->tqsetWhatsThis( MENU_ACCEPT_DRAW, i18n( "Clicking this will accept a draw offered by your opponent." ) ); // MENU_REJECT_DRAW - drawMenu->insertItem( i18n( "&Reject Draw" ), Core, SLOT(matchMenu(int)), 0, MENU_REJECT_DRAW ); - drawMenu->setWhatsThis( MENU_REJECT_DRAW, i18n( "Clicking this will reject a draw offered by your opponent." ) ); + drawMenu->insertItem( i18n( "&Reject Draw" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_REJECT_DRAW ); + drawMenu->tqsetWhatsThis( MENU_REJECT_DRAW, i18n( "Clicking this will reject a draw offered by your opponent." ) ); // MENU_IGNORE_DRAW - drawMenu->insertItem( i18n( "&Ignore Draw" ), Core, SLOT(matchMenu(int)), 0, MENU_IGNORE_DRAW ); - drawMenu->setWhatsThis( MENU_IGNORE_DRAW, i18n( "Clicking this will ignore future draw offers from your opponent." ) ); + drawMenu->insertItem( i18n( "&Ignore Draw" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_IGNORE_DRAW ); + drawMenu->tqsetWhatsThis( MENU_IGNORE_DRAW, i18n( "Clicking this will ignore future draw offers from your opponent." ) ); /* fileMenu menu */ // MENU_NEWGAME - fileMenu->insertItem( QIconSet( Resource->LoadIcon( QString("filenew"), KIcon::Small ) ), - i18n( "&New Match..." ), this, SLOT( openNewMatchDialog() ), CTRL+Key_N, MENU_NEWGAME ); - fileMenu->setWhatsThis( MENU_NEWGAME, i18n( "This allows you to begin a new match." ) ); + fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("filenew"), KIcon::Small ) ), + i18n( "&New Match..." ), this, TQT_SLOT( openNewMatchDialog() ), CTRL+Key_N, MENU_NEWGAME ); + fileMenu->tqsetWhatsThis( MENU_NEWGAME, i18n( "This allows you to begin a new match." ) ); // MENU_LOAD - fileMenu->insertItem( QIconSet( Resource->LoadIcon( QString("fileopen"), KIcon::Small ) ), - i18n( "&Load Match..." ), Core, SLOT( load() ), CTRL+Key_L, MENU_LOAD ); - fileMenu->setWhatsThis( MENU_LOAD, i18n( "The Load command will allow you to select a previously saved match and play it again." ) ); + fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("fileopen"), KIcon::Small ) ), + i18n( "&Load Match..." ), Core, TQT_SLOT( load() ), CTRL+Key_L, MENU_LOAD ); + fileMenu->tqsetWhatsThis( MENU_LOAD, i18n( "The Load command will allow you to select a previously saved match and play it again." ) ); fileMenu->insertSeparator(); // MENU_SAVE - fileMenu->insertItem( QIconSet( Resource->LoadIcon( QString("filesave"), KIcon::Small ) ), - i18n( "&Save Match" ), this, SLOT( SaveGame() ), CTRL+Key_S, MENU_SAVE ); + fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("filesave"), KIcon::Small ) ), + i18n( "&Save Match" ), this, TQT_SLOT( SaveGame() ), CTRL+Key_S, MENU_SAVE ); fileMenu->setItemEnabled( MENU_SAVE, FALSE ); - fileMenu->setWhatsThis( MENU_SAVE, i18n( "The Save command will allow you to store a copy of your current match for later use." ) ); + fileMenu->tqsetWhatsThis( MENU_SAVE, i18n( "The Save command will allow you to store a copy of your current match for later use." ) ); // MENU_SAVEAS - fileMenu->insertItem( QIconSet( Resource->LoadIcon( QString("filesave"), KIcon::Small ) ), - i18n( "Save Match &As..." ), this, SLOT( SaveGameAs() ), CTRL+Key_A, MENU_SAVEAS ); + fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("filesave"), KIcon::Small ) ), + i18n( "Save Match &As..." ), this, TQT_SLOT( SaveGameAs() ), CTRL+Key_A, MENU_SAVEAS ); fileMenu->setItemEnabled( MENU_SAVEAS, FALSE ); - fileMenu->setWhatsThis( MENU_SAVEAS, i18n( "The Save command will allow you to store a copy of your current match for later use." ) ); + fileMenu->tqsetWhatsThis( MENU_SAVEAS, i18n( "The Save command will allow you to store a copy of your current match for later use." ) ); fileMenu->insertSeparator(); // MENU_CONNECT - fileMenu->insertItem( QIconSet( Resource->LoadIcon( QString("connect_creating"), KIcon::Small ) ), - i18n( "Connect to Server" ), this, SLOT( netConnect() ), CTRL+Key_C, MENU_CONNECT ); - fileMenu->setWhatsThis( MENU_CONNECT, i18n( "Clicking this will connect Knights with an internet chess server." ) ); + fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("connect_creating"), KIcon::Small ) ), + i18n( "Connect to Server" ), this, TQT_SLOT( netConnect() ), CTRL+Key_C, MENU_CONNECT ); + fileMenu->tqsetWhatsThis( MENU_CONNECT, i18n( "Clicking this will connect Knights with an internet chess server." ) ); fileMenu->insertSeparator(); // MENU_PRINT - fileMenu->insertItem( QIconSet( Resource->LoadIcon( QString("fileprint"), KIcon::Small ) ), - i18n( "&Print Notation..." ), Core, SLOT( print() ), CTRL+Key_P, MENU_PRINT ); + fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("fileprint"), KIcon::Small ) ), + i18n( "&Print Notation..." ), Core, TQT_SLOT( print() ), CTRL+Key_P, MENU_PRINT ); fileMenu->setItemEnabled( MENU_PRINT, FALSE ); - fileMenu->setWhatsThis( MENU_PRINT, i18n( "The Print command will allow you to print this game's notation on your printer." ) ); + fileMenu->tqsetWhatsThis( MENU_PRINT, i18n( "The Print command will allow you to print this game's notation on your printer." ) ); fileMenu->insertSeparator(); // MENU_CLOSE - fileMenu->insertItem( QIconSet( Resource->LoadIcon( QString("fileclose"), KIcon::Small ) ), - i18n( "&Close Match" ), Core, SLOT( clearMatch() ), CTRL+Key_W, MENU_CLOSE ); + fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("fileclose"), KIcon::Small ) ), + i18n( "&Close Match" ), Core, TQT_SLOT( clearMatch() ), CTRL+Key_W, MENU_CLOSE ); fileMenu->setItemEnabled( MENU_CLOSE, FALSE ); - fileMenu->setWhatsThis( MENU_CLOSE, i18n( "This command removes the current match." ) ); + fileMenu->tqsetWhatsThis( MENU_CLOSE, i18n( "This command removes the current match." ) ); // MENU_CLOSEALL - fileMenu->insertItem( i18n( "Close All" ), Core, SLOT( clearAll() ), 0, MENU_CLOSEALL ); + fileMenu->insertItem( i18n( "Close All" ), Core, TQT_SLOT( clearAll() ), 0, MENU_CLOSEALL ); fileMenu->setItemEnabled( MENU_CLOSEALL, FALSE ); - fileMenu->setWhatsThis( MENU_CLOSEALL, i18n( "This command will remove all matches that are currently loaded." ) ); + fileMenu->tqsetWhatsThis( MENU_CLOSEALL, i18n( "This command will remove all matches that are currently loaded." ) ); fileMenu->insertSeparator(); - // MENU_QUIT - fileMenu->insertItem( QIconSet( Resource->LoadIcon( QString("exit"), KIcon::Small ) ), - i18n( "&Quit" ), this, SLOT(menuClose()), CTRL+Key_Q, MENU_QUIT ); - fileMenu->setWhatsThis( MENU_QUIT, i18n( "The Quit command will stop all matches and exit Knights." ) ); + // MENU_TQUIT + fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("exit"), KIcon::Small ) ), + i18n( "&Quit" ), this, TQT_SLOT(menuClose()), CTRL+Key_Q, MENU_TQUIT ); + fileMenu->tqsetWhatsThis( MENU_TQUIT, i18n( "The Quit command will stop all matches and exit Knights." ) ); /* settingsMenu menu */ // MENU_INSTALL_THEMES - settingsMenu->insertItem( i18n( "&Install Themes" ), this, SLOT(installThemes()), 0, MENU_INSTALL_THEMES ); - settingsMenu->setWhatsThis( MENU_INSTALL_THEMES, i18n( "This lets you install downloaded themes into Knights." ) ); + settingsMenu->insertItem( i18n( "&Install Themes" ), this, TQT_SLOT(installThemes()), 0, MENU_INSTALL_THEMES ); + settingsMenu->tqsetWhatsThis( MENU_INSTALL_THEMES, i18n( "This lets you install downloaded themes into Knights." ) ); // MENU_BINDINGS_DIALOG - settingsMenu->insertItem( QIconSet( Resource->LoadIcon( QString("key_bindings"), KIcon::Small ) ), - i18n( "Configure &Key Bindings..." ), this, SLOT(openKeyBindingDialog()), 0, MENU_BINDINGS_DIALOG ); - settingsMenu->setWhatsThis( MENU_BINDINGS_DIALOG, i18n( "Click this if you want to change the keyboard shortcuts that Knights uses." ) ); + settingsMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("key_bindings"), KIcon::Small ) ), + i18n( "Configure &Key Bindings..." ), this, TQT_SLOT(openKeyBindingDialog()), 0, MENU_BINDINGS_DIALOG ); + settingsMenu->tqsetWhatsThis( MENU_BINDINGS_DIALOG, i18n( "Click this if you want to change the keyboard shortcuts that Knights uses." ) ); // MENU_SETTINGS_DIALOG - settingsMenu->insertItem( QIconSet( Resource->LoadIcon( QString("configure"), KIcon::Small ) ), - i18n( "&Configure Knights..." ), this, SLOT(openSettingsDialog()), 0, MENU_SETTINGS_DIALOG ); - settingsMenu->setWhatsThis( MENU_SETTINGS_DIALOG, i18n( "This opens a new window which allows you to customize Knights to your particular tastes." ) ); + settingsMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("configure"), KIcon::Small ) ), + i18n( "&Configure Knights..." ), this, TQT_SLOT(openSettingsDialog()), 0, MENU_SETTINGS_DIALOG ); + settingsMenu->tqsetWhatsThis( MENU_SETTINGS_DIALOG, i18n( "This opens a new window which allows you to customize Knights to your particular tastes." ) ); /* tutorialMenu menu */ tutorialMenu->setCheckable(TRUE); // MENU_OPEN_TUTORIAL - tutorialMenu->insertItem( i18n( "Begin a Tutorial" ), this, SLOT(Settings(int)), 0, MENU_OPEN_TUTORIAL ); -// tutorialMenu->setWhatsThis( MENU_OPEN_TUTORIAL, i18n( "" ) ); + tutorialMenu->insertItem( i18n( "Begin a Tutorial" ), this, TQT_SLOT(Settings(int)), 0, MENU_OPEN_TUTORIAL ); +// tutorialMenu->tqsetWhatsThis( MENU_OPEN_TUTORIAL, i18n( "" ) ); /* topMenu menu */ @@ -383,9 +383,9 @@ void Knights::initMenus( void ) /////////////////////////////////////// void Knights::resizeMainFrame(void) { - QStyle& Style = QApplication::style(); - QSize S_Message; - QSize S_Menu; + TQStyle& Style = TQApplication::tqstyle(); + TQSize S_Message; + TQSize S_Menu; int statusY(0); int statusX(0); @@ -397,8 +397,8 @@ void Knights::resizeMainFrame(void) Core->move( 0, 0 ); Core->resize(); /* Get our size hints */ - S_Message = Message->sizeHint(); - S_Menu = topMenu->sizeHint(); + S_Message = Message->tqsizeHint(); + S_Menu = topMenu->tqsizeHint(); statusHeight = S_Message.height() + ( margin << 1 ); statusY += Core->height() + margin + statusHeight + margin; statusX = Core->width(); @@ -421,7 +421,7 @@ void Knights::resizeMainFrame(void) // Knights::event // /////////////////////////////////////// -bool Knights::event( QEvent *e ) +bool Knights::event( TQEvent *e ) { if( e->type() == EVENT_Del_IO_Net ) { @@ -435,9 +435,9 @@ bool Knights::event( QEvent *e ) // Knights::resizeEvent // /////////////////////////////////////// -void Knights::resizeEvent( QResizeEvent * ) +void Knights::resizeEvent( TQResizeEvent * ) { - QSize S_Message; + TQSize S_Message; int tmp(0); int statusHeight(0); int statusY(0); @@ -447,7 +447,7 @@ void Knights::resizeEvent( QResizeEvent * ) if( ResizeFlag ) return; /* Get the height & Y of the status bar */ gridX = Core->width() >> 3; - S_Message = Message->sizeHint() + QSize( 2, 2 ); + S_Message = Message->tqsizeHint() + TQSize( 2, 2 ); statusHeight = S_Message.height() + ( margin << 1 ); Resource->Widget_Height = statusHeight; statusY += Core->height() + margin; @@ -479,11 +479,11 @@ void Knights::resizeEvent( QResizeEvent * ) // Knights::keyPressEvent // /////////////////////////////////////// -void Knights::keyPressEvent( QKeyEvent *e ) +void Knights::keyPressEvent( TQKeyEvent *e ) { - QChar input; + TQChar input; - if( ( e->state() | Qt::ShiftButton ) == Qt::ShiftButton ) + if( ( e->state() | TQt::ShiftButton ) == TQt::ShiftButton ) { input = e->text().at(0); if( input.isLetterOrNumber() ) @@ -500,7 +500,7 @@ void Knights::keyPressEvent( QKeyEvent *e ) // Knights::hideEvent // /////////////////////////////////////// -void Knights::hideEvent( QHideEvent* ) +void Knights::hideEvent( TQHideEvent* ) { if( !Resource->OPTION_Pause_On_Minimize ) return; @@ -512,7 +512,7 @@ void Knights::hideEvent( QHideEvent* ) // Knights::showEvent // /////////////////////////////////////// -void Knights::showEvent( QShowEvent* ) +void Knights::showEvent( TQShowEvent* ) { if( !Minimized ) return; @@ -524,7 +524,7 @@ void Knights::showEvent( QShowEvent* ) // Knights::wheelEvent // /////////////////////////////////////// -void Knights::wheelEvent( QWheelEvent *event ) +void Knights::wheelEvent( TQWheelEvent *event ) { event->accept(); if( event->delta() > 0 ) PrevNotation(); @@ -545,7 +545,7 @@ void Knights::SelectTheme( int boardIndex, int chessmenIndex ) // Knights::setStatusBar // /////////////////////////////////////// -void Knights::setStatusBar( const int &ID, const QString &MSG ) +void Knights::setStatusBar( const int &ID, const TQString &MSG ) { /* Game comments as specified in http://www.schachprobleme.de/chessml/faq/pgn/ Section 10: Numeric Annotation Glyphs */ @@ -561,29 +561,29 @@ void Knights::setStatusBar( const int &ID, const QString &MSG ) case BOOK_ERROR_1: Message->setText( i18n( "Error with white engine" ) ); KMessageBox::sorry( this, - i18n("You selected %1 to play white,\nbut it can only be used as a book engine.\nPlease select another engine to play white.").arg( MSG ), + i18n("You selected %1 to play white,\nbut it can only be used as a book engine.\nPlease select another engine to play white.").tqarg( MSG ), i18n("White Engine Problem") ); break; case BOOK_ERROR_2: Message->setText( i18n( "Error with white book engine" ) ); KMessageBox::sorry( this, - i18n("You selected %1 to play white's book,\nbut it can only be used as a regular engine.\nPlease select another engine to play white's book.").arg( MSG ), + i18n("You selected %1 to play white's book,\nbut it can only be used as a regular engine.\nPlease select another engine to play white's book.").tqarg( MSG ), i18n("White Book Engine Problem") ); break; case BOOK_ERROR_3: Message->setText( i18n( "Error with black engine" ) ); KMessageBox::sorry( this, - i18n("You selected %1 to play black,\nbut it can only be used as a book engine.\nPlease select another engine to play black.").arg( MSG ), + i18n("You selected %1 to play black,\nbut it can only be used as a book engine.\nPlease select another engine to play black.").tqarg( MSG ), i18n("Black Engine Problem") ); break; case BOOK_ERROR_4: Message->setText( i18n( "Error with black book engine" ) ); KMessageBox::sorry( this, - i18n("You selected %1 to play black's book,\nbut it can only be used as a regular engine.\nPlease select another engine to play black's book.").arg( MSG ), + i18n("You selected %1 to play black's book,\nbut it can only be used as a regular engine.\nPlease select another engine to play black's book.").tqarg( MSG ), i18n("Black Book Engine Problem") ); break; case ENGINE_DIED_ERROR: - Message->setText( i18n( "The computer opponent assigned to play %1 has crashed" ).arg( MSG ) ); + Message->setText( i18n( "The computer opponent assigned to play %1 has crashed" ).tqarg( MSG ) ); break; case LOAD_ERROR: Message->setText( i18n( "There was an error while loading the file" ) ); @@ -696,8 +696,8 @@ void Knights::setClocks( void ) /////////////////////////////////////// void Knights::setNotation( void ) { - QStringList *list; - QStringList::Iterator IT; + TQStringList *list; + TQStringList::Iterator IT; int count(0); setCaption( Core->caption() ); @@ -837,14 +837,14 @@ void Knights::netConnect( void ) { if(Core->isOnline()) { - fileMenu->changeItem( MENU_CONNECT, QIconSet( Resource->LoadIcon( QString("connect_creating"), + fileMenu->changeItem( MENU_CONNECT, TQIconSet( Resource->LoadIcon( TQString("connect_creating"), KIcon::Small ) ), i18n( "Connect to Server" )); Core->goOffline(); setCursor( Resource->CURSOR_Standard ); } else { - fileMenu->changeItem( MENU_CONNECT, QIconSet( Resource->LoadIcon( QString("connect_no"), + fileMenu->changeItem( MENU_CONNECT, TQIconSet( Resource->LoadIcon( TQString("connect_no"), KIcon::Small ) ), i18n( "Disconnect from Server" ) ); /* By passing Null as the ID, we're telling core that we're @@ -861,10 +861,10 @@ void Knights::netConnect( void ) void Knights::openSettingsDialog( void ) { SettingsDialog = new dlg_settings( this, "settings", Resource ); - connect( SettingsDialog, SIGNAL( themeChanged(int,int) ), this, SLOT( SelectTheme(int,int) ) ); - connect( SettingsDialog, SIGNAL( redrawBoard() ), Core, SLOT( resize() ) ); - connect( SettingsDialog, SIGNAL( resetServer() ), Core, SLOT( resetServer() ) ); - connect( this, SIGNAL( themesAdded() ), SettingsDialog, SLOT( slotThemesAdded() ) ); + connect( SettingsDialog, TQT_SIGNAL( themeChanged(int,int) ), this, TQT_SLOT( SelectTheme(int,int) ) ); + connect( SettingsDialog, TQT_SIGNAL( redrawBoard() ), Core, TQT_SLOT( resize() ) ); + connect( SettingsDialog, TQT_SIGNAL( resetServer() ), Core, TQT_SLOT( resetServer() ) ); + connect( this, TQT_SIGNAL( themesAdded() ), SettingsDialog, TQT_SLOT( slotThemesAdded() ) ); SettingsDialog->show(); } /////////////////////////////////////// @@ -875,7 +875,7 @@ void Knights::openSettingsDialog( void ) void Knights::openNewMatchDialog( void ) { NewMatch = new dlg_newmatch( this, "NewMatch", Resource ); - connect( NewMatch, SIGNAL( okClicked() ), this, SLOT( newMatch() ) ); + connect( NewMatch, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( newMatch() ) ); NewMatch->show(); } /////////////////////////////////////// @@ -914,13 +914,13 @@ void Knights::Settings(int opt) if( Core->paused() ) { matchMenu->changeItem( MENU_PAUSE, - QIconSet( Resource->LoadIcon( QString("player_pause"), KIcon::Small ) ), + TQIconSet( Resource->LoadIcon( TQString("player_pause"), KIcon::Small ) ), i18n( "Pause" ) ); } else { matchMenu->changeItem( MENU_PAUSE, - QIconSet( Resource->LoadIcon( QString("1rightarrow"), KIcon::Small ) ), + TQIconSet( Resource->LoadIcon( TQString("1rightarrow"), KIcon::Small ) ), i18n( "Resume" ) ); } Core->matchMenu( MENU_PAUSE ); @@ -978,28 +978,28 @@ void Knights::installThemes( void ) bool localFlag(FALSE); bool installError(FALSE); unsigned int loop; - QString allerror; - QString fileFilter( "KB* KC* KS*|" ); + TQString allerror; + TQString fileFilter( "KB* KC* KS*|" ); fileFilter += i18n( "Knights Themes" ); - KURL::List files = KFileDialog::getOpenURLs( QString::null, fileFilter, this, i18n( "Install Theme..." ) ); + KURL::List files = KFileDialog::getOpenURLs( TQString(), fileFilter, this, i18n( "Install Theme..." ) ); for( loop = 0; loop < files.count(); loop++ ) { /* Try writing to the global theme dir */ - if( !KIO::NetAccess::copy( files[loop], KURL( QString( Resource->themeDir() + files[loop].filename() ) ) ) ) + if( !KIO::NetAccess::copy( files[loop], KURL( TQString( Resource->themeDir() + files[loop].filename() ) ) ) ) { /* Nope... Try a local .knights dir */ - allerror += "\n\n" + QString( Resource->themeDir() + files[loop].filename() ) + allerror += "\n\n" + TQString( Resource->themeDir() + files[loop].filename() ) + " - " + KIO::NetAccess::lastErrorString(); - if( !KIO::NetAccess::exists( KURL( QString( QDir::homeDirPath() + "/.knights" ) ) ) ) + if( !KIO::NetAccess::exists( KURL( TQString( TQDir::homeDirPath() + "/.knights" ) ) ) ) { /* Create local .knights dir */ - KIO::NetAccess::mkdir( KURL( QString( QDir::homeDirPath() + "/.knights" ) ) ); + KIO::NetAccess::mkdir( KURL( TQString( TQDir::homeDirPath() + "/.knights" ) ) ); } - if( !KIO::NetAccess::copy( files[loop], KURL( QString( QDir::homeDirPath() + "/.knights/" + files[loop].filename() ) ) ) ) + if( !KIO::NetAccess::copy( files[loop], KURL( TQString( TQDir::homeDirPath() + "/.knights/" + files[loop].filename() ) ) ) ) { /* Nope, can't copy it anywhere */ installError = TRUE; - allerror += "\n\n" + QString( QDir::homeDirPath() + "/.knights/" + allerror += "\n\n" + TQString( TQDir::homeDirPath() + "/.knights/" + files[loop].filename() ) + " - " + KIO::NetAccess::lastErrorString(); } else @@ -1017,7 +1017,7 @@ void Knights::installThemes( void ) if( installError ) { KMessageBox::sorry( this, - i18n("The theme could not be installed:\n%1").arg( allerror ), + i18n("The theme could not be installed:\n%1").tqarg( allerror ), i18n("Can not install theme") ); } return; |