|
|
|
@ -85,13 +85,13 @@ void Knights::BirthAll(void)
|
|
|
|
|
notationBar = new KComboBox( MainFrame, "notationBar");
|
|
|
|
|
|
|
|
|
|
/* Connect all Signals & Slots */
|
|
|
|
|
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) ) );
|
|
|
|
|
connect( Core, TQ_SIGNAL( requestResize() ), this, TQ_SLOT( resizeMainFrame() ) );
|
|
|
|
|
connect( Core, TQ_SIGNAL( setStatusBar(const int&, const TQString& ) ), this, TQ_SLOT( setStatusBar(const int&, const TQString& ) ) );
|
|
|
|
|
connect( Core, TQ_SIGNAL( setNotation() ), this, TQ_SLOT( setNotation() ) );
|
|
|
|
|
connect( Core, TQ_SIGNAL( initMatch() ), this, TQ_SLOT( initMatch() ) );
|
|
|
|
|
connect( Core, TQ_SIGNAL( setClocks() ), this, TQ_SLOT( setClocks() ) );
|
|
|
|
|
connect( Core, TQ_SIGNAL( serverDestroyed() ), this, TQ_SLOT( netConnect() ) );
|
|
|
|
|
connect( notationBar, TQ_SIGNAL( activated(int) ), Core, TQ_SLOT( review(int) ) );
|
|
|
|
|
}
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
@ -174,11 +174,11 @@ bool Knights::init( void )
|
|
|
|
|
/*
|
|
|
|
|
Connect Accelerators
|
|
|
|
|
*/
|
|
|
|
|
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& ) ) );
|
|
|
|
|
connect( Resource->myAccel, TQ_SIGNAL( board_up() ), this, TQ_SLOT( boardBigger() ) );
|
|
|
|
|
connect( Resource->myAccel, TQ_SIGNAL( board_down() ), this, TQ_SLOT( boardSmaller() ) );
|
|
|
|
|
connect( Resource->myAccel, TQ_SIGNAL( move_prev() ), this, TQ_SLOT( PrevNotation() ) );
|
|
|
|
|
connect( Resource->myAccel, TQ_SIGNAL( move_next() ), this, TQ_SLOT( NextNotation() ) );
|
|
|
|
|
connect( this, TQ_SIGNAL( focus( const TQChar& ) ), Resource->myAccel, TQ_SIGNAL( focus( const TQChar& ) ) );
|
|
|
|
|
|
|
|
|
|
initMenus();
|
|
|
|
|
|
|
|
|
@ -268,123 +268,123 @@ void Knights::initMenus( void )
|
|
|
|
|
matchMenu->setItemEnabled( MENU_DRAW, FALSE );
|
|
|
|
|
// MENU_RETRACT
|
|
|
|
|
matchMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("edit-undo"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "&Retract Move" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_RETRACT );
|
|
|
|
|
i18n( "&Retract Move" ), Core, TQ_SLOT(matchMenu(int)), 0, MENU_RETRACT );
|
|
|
|
|
matchMenu->setItemEnabled( MENU_RETRACT, FALSE );
|
|
|
|
|
matchMenu->setWhatsThis( MENU_RETRACT, i18n( "Select this to retract your last move." ) );
|
|
|
|
|
// MENU_RESIGN
|
|
|
|
|
matchMenu->insertItem( i18n( "Resign" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_RESIGN );
|
|
|
|
|
matchMenu->insertItem( i18n( "Resign" ), Core, TQ_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." ) );
|
|
|
|
|
// MENU_CALL_FLAG
|
|
|
|
|
matchMenu->insertItem( i18n( "&Call Flag" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_CALL_FLAG );
|
|
|
|
|
matchMenu->insertItem( i18n( "&Call Flag" ), Core, TQ_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." ) );
|
|
|
|
|
// MENU_HINT
|
|
|
|
|
matchMenu->insertItem( i18n( "&Hint" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_HINT );
|
|
|
|
|
matchMenu->insertItem( i18n( "&Hint" ), Core, TQ_SLOT(matchMenu(int)), 0, MENU_HINT );
|
|
|
|
|
matchMenu->setItemEnabled( MENU_HINT, FALSE );
|
|
|
|
|
matchMenu->setWhatsThis( MENU_HINT, i18n( "This will ask your opponent for a hint." ) );
|
|
|
|
|
// MENU_MOVE_NOW
|
|
|
|
|
matchMenu->insertItem( i18n( "Move &Now" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_MOVE_NOW );
|
|
|
|
|
matchMenu->insertItem( i18n( "Move &Now" ), Core, TQ_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." ) );
|
|
|
|
|
// MENU_ORIENTATION
|
|
|
|
|
matchMenu->insertItem( i18n( "&Flip View" ), Core, TQT_SLOT(matchMenu(int)), Key_F2, MENU_ORIENTATION );
|
|
|
|
|
matchMenu->insertItem( i18n( "&Flip View" ), Core, TQ_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." ) );
|
|
|
|
|
// MENU_PONDER
|
|
|
|
|
matchMenu->insertItem( i18n( "&Ponder" ), this, TQT_SLOT(Settings(int)), 0, MENU_PONDER );
|
|
|
|
|
matchMenu->insertItem( i18n( "&Ponder" ), this, TQ_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->insertSeparator();
|
|
|
|
|
// MENU_PAUSE
|
|
|
|
|
matchMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("media-playback-pause"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "Pause" ), this, TQT_SLOT( Settings(int) ), Key_F12, MENU_PAUSE );
|
|
|
|
|
i18n( "Pause" ), this, TQ_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." ) );
|
|
|
|
|
/*
|
|
|
|
|
drawMenu menu
|
|
|
|
|
*/
|
|
|
|
|
// MENU_OFFER_DRAW
|
|
|
|
|
drawMenu->insertItem( i18n( "&Offer Draw" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_OFFER_DRAW );
|
|
|
|
|
drawMenu->insertItem( i18n( "&Offer Draw" ), Core, TQ_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." ) );
|
|
|
|
|
// MENU_ACCEPT_DRAW
|
|
|
|
|
drawMenu->insertItem( i18n( "&Accept Draw" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_ACCEPT_DRAW );
|
|
|
|
|
drawMenu->insertItem( i18n( "&Accept Draw" ), Core, TQ_SLOT(matchMenu(int)), 0, MENU_ACCEPT_DRAW );
|
|
|
|
|
drawMenu->setWhatsThis( MENU_ACCEPT_DRAW, i18n( "Clicking this will accept a draw offered by your opponent." ) );
|
|
|
|
|
// MENU_REJECT_DRAW
|
|
|
|
|
drawMenu->insertItem( i18n( "&Reject Draw" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_REJECT_DRAW );
|
|
|
|
|
drawMenu->insertItem( i18n( "&Reject Draw" ), Core, TQ_SLOT(matchMenu(int)), 0, MENU_REJECT_DRAW );
|
|
|
|
|
drawMenu->setWhatsThis( MENU_REJECT_DRAW, i18n( "Clicking this will reject a draw offered by your opponent." ) );
|
|
|
|
|
// MENU_IGNORE_DRAW
|
|
|
|
|
drawMenu->insertItem( i18n( "&Ignore Draw" ), Core, TQT_SLOT(matchMenu(int)), 0, MENU_IGNORE_DRAW );
|
|
|
|
|
drawMenu->insertItem( i18n( "&Ignore Draw" ), Core, TQ_SLOT(matchMenu(int)), 0, MENU_IGNORE_DRAW );
|
|
|
|
|
drawMenu->setWhatsThis( MENU_IGNORE_DRAW, i18n( "Clicking this will ignore future draw offers from your opponent." ) );
|
|
|
|
|
/*
|
|
|
|
|
fileMenu menu
|
|
|
|
|
*/
|
|
|
|
|
// MENU_NEWGAME
|
|
|
|
|
fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("document-new"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "&New Match..." ), this, TQT_SLOT( openNewMatchDialog() ), CTRL+Key_N, MENU_NEWGAME );
|
|
|
|
|
i18n( "&New Match..." ), this, TQ_SLOT( openNewMatchDialog() ), CTRL+Key_N, MENU_NEWGAME );
|
|
|
|
|
fileMenu->setWhatsThis( MENU_NEWGAME, i18n( "This allows you to begin a new match." ) );
|
|
|
|
|
// MENU_LOAD
|
|
|
|
|
fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("document-open"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "&Load Match..." ), Core, TQT_SLOT( load() ), CTRL+Key_L, MENU_LOAD );
|
|
|
|
|
i18n( "&Load Match..." ), Core, TQ_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->insertSeparator();
|
|
|
|
|
// MENU_SAVE
|
|
|
|
|
fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("document-save"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "&Save Match" ), this, TQT_SLOT( SaveGame() ), CTRL+Key_S, MENU_SAVE );
|
|
|
|
|
i18n( "&Save Match" ), this, TQ_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." ) );
|
|
|
|
|
// MENU_SAVEAS
|
|
|
|
|
fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("document-save"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "Save Match &As..." ), this, TQT_SLOT( SaveGameAs() ), CTRL+Key_A, MENU_SAVEAS );
|
|
|
|
|
i18n( "Save Match &As..." ), this, TQ_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->insertSeparator();
|
|
|
|
|
// MENU_CONNECT
|
|
|
|
|
fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("connect_creating"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "Connect to Server" ), this, TQT_SLOT( netConnect() ), CTRL+Key_C, MENU_CONNECT );
|
|
|
|
|
i18n( "Connect to Server" ), this, TQ_SLOT( netConnect() ), CTRL+Key_C, MENU_CONNECT );
|
|
|
|
|
fileMenu->setWhatsThis( MENU_CONNECT, i18n( "Clicking this will connect Knights with an internet chess server." ) );
|
|
|
|
|
fileMenu->insertSeparator();
|
|
|
|
|
// MENU_PRINT
|
|
|
|
|
fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("document-print"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "&Print Notation..." ), Core, TQT_SLOT( print() ), CTRL+Key_P, MENU_PRINT );
|
|
|
|
|
i18n( "&Print Notation..." ), Core, TQ_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->insertSeparator();
|
|
|
|
|
// MENU_CLOSE
|
|
|
|
|
fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("window-close"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "&Close Match" ), Core, TQT_SLOT( clearMatch() ), CTRL+Key_W, MENU_CLOSE );
|
|
|
|
|
i18n( "&Close Match" ), Core, TQ_SLOT( clearMatch() ), CTRL+Key_W, MENU_CLOSE );
|
|
|
|
|
fileMenu->setItemEnabled( MENU_CLOSE, FALSE );
|
|
|
|
|
fileMenu->setWhatsThis( MENU_CLOSE, i18n( "This command removes the current match." ) );
|
|
|
|
|
// MENU_CLOSEALL
|
|
|
|
|
fileMenu->insertItem( i18n( "Close All" ), Core, TQT_SLOT( clearAll() ), 0, MENU_CLOSEALL );
|
|
|
|
|
fileMenu->insertItem( i18n( "Close All" ), Core, TQ_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->insertSeparator();
|
|
|
|
|
// MENU_QUIT
|
|
|
|
|
fileMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("system-log-out"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "&Quit" ), this, TQT_SLOT(menuClose()), CTRL+Key_Q, MENU_QUIT );
|
|
|
|
|
i18n( "&Quit" ), this, TQ_SLOT(menuClose()), CTRL+Key_Q, MENU_QUIT );
|
|
|
|
|
fileMenu->setWhatsThis( MENU_QUIT, i18n( "The Quit command will stop all matches and exit Knights." ) );
|
|
|
|
|
/*
|
|
|
|
|
settingsMenu menu
|
|
|
|
|
*/
|
|
|
|
|
// MENU_INSTALL_THEMES
|
|
|
|
|
settingsMenu->insertItem( i18n( "&Install Themes" ), this, TQT_SLOT(installThemes()), 0, MENU_INSTALL_THEMES );
|
|
|
|
|
settingsMenu->insertItem( i18n( "&Install Themes" ), this, TQ_SLOT(installThemes()), 0, MENU_INSTALL_THEMES );
|
|
|
|
|
settingsMenu->setWhatsThis( MENU_INSTALL_THEMES, i18n( "This lets you install downloaded themes into Knights." ) );
|
|
|
|
|
// MENU_BINDINGS_DIALOG
|
|
|
|
|
settingsMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("key_bindings"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "Configure &Key Bindings..." ), this, TQT_SLOT(openKeyBindingDialog()), 0, MENU_BINDINGS_DIALOG );
|
|
|
|
|
i18n( "Configure &Key Bindings..." ), this, TQ_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." ) );
|
|
|
|
|
// MENU_SETTINGS_DIALOG
|
|
|
|
|
settingsMenu->insertItem( TQIconSet( Resource->LoadIcon( TQString("configure"), TDEIcon::Small ) ),
|
|
|
|
|
i18n( "&Configure Knights..." ), this, TQT_SLOT(openSettingsDialog()), 0, MENU_SETTINGS_DIALOG );
|
|
|
|
|
i18n( "&Configure Knights..." ), this, TQ_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." ) );
|
|
|
|
|
/*
|
|
|
|
|
tutorialMenu menu
|
|
|
|
|
*/
|
|
|
|
|
tutorialMenu->setCheckable(TRUE);
|
|
|
|
|
// MENU_OPEN_TUTORIAL
|
|
|
|
|
tutorialMenu->insertItem( i18n( "Begin a Tutorial" ), this, TQT_SLOT(Settings(int)), 0, MENU_OPEN_TUTORIAL );
|
|
|
|
|
tutorialMenu->insertItem( i18n( "Begin a Tutorial" ), this, TQ_SLOT(Settings(int)), 0, MENU_OPEN_TUTORIAL );
|
|
|
|
|
// tutorialMenu->setWhatsThis( MENU_OPEN_TUTORIAL, i18n( "" ) );
|
|
|
|
|
/*
|
|
|
|
|
topMenu menu
|
|
|
|
@ -881,10 +881,10 @@ void Knights::netConnect( void )
|
|
|
|
|
void Knights::openSettingsDialog( void )
|
|
|
|
|
{
|
|
|
|
|
SettingsDialog = new dlg_settings( this, "settings", Resource );
|
|
|
|
|
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() ) );
|
|
|
|
|
connect( SettingsDialog, TQ_SIGNAL( themeChanged(int,int) ), this, TQ_SLOT( SelectTheme(int,int) ) );
|
|
|
|
|
connect( SettingsDialog, TQ_SIGNAL( redrawBoard() ), Core, TQ_SLOT( resize() ) );
|
|
|
|
|
connect( SettingsDialog, TQ_SIGNAL( resetServer() ), Core, TQ_SLOT( resetServer() ) );
|
|
|
|
|
connect( this, TQ_SIGNAL( themesAdded() ), SettingsDialog, TQ_SLOT( slotThemesAdded() ) );
|
|
|
|
|
SettingsDialog->show();
|
|
|
|
|
}
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
@ -895,7 +895,7 @@ void Knights::openSettingsDialog( void )
|
|
|
|
|
void Knights::openNewMatchDialog( void )
|
|
|
|
|
{
|
|
|
|
|
NewMatch = new dlg_newmatch( this, "NewMatch", Resource );
|
|
|
|
|
connect( NewMatch, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( newMatch() ) );
|
|
|
|
|
connect( NewMatch, TQ_SIGNAL( okClicked() ), this, TQ_SLOT( newMatch() ) );
|
|
|
|
|
NewMatch->show();
|
|
|
|
|
}
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|