@ -32,8 +32,8 @@ KStdGameAction::KStdGameAction()
KStdGameAction : : ~ KStdGameAction ( )
KStdGameAction : : ~ KStdGameAction ( )
{ }
{ }
K Action * KStdGameAction : : action ( StdGameAction act_enum , const TQObject * recvr ,
TDE Action * KStdGameAction : : action ( StdGameAction act_enum , const TQObject * recvr ,
const char * slot , K ActionCollection * parent ,
const char * slot , TDE ActionCollection * parent ,
const char * name )
const char * name )
{
{
return create ( act_enum , name , recvr , slot , parent ) ;
return create ( act_enum , name , recvr , slot , parent ) ;
@ -47,7 +47,7 @@ const char* KStdGameAction::stdName(StdGameAction act_enum)
struct KStdGameActionInfo
struct KStdGameActionInfo
{
{
KStdGameAction : : StdGameAction id ;
KStdGameAction : : StdGameAction id ;
K StdAccel: : StdAccel globalAccel ; // if we reuse a global accel
TDE StdAccel: : StdAccel globalAccel ; // if we reuse a global accel
int shortcut ; // specific shortcut (NH: should be configurable)
int shortcut ; // specific shortcut (NH: should be configurable)
const char * psName ;
const char * psName ;
const char * psLabel ;
const char * psLabel ;
@ -57,32 +57,32 @@ struct KStdGameActionInfo
const KStdGameActionInfo g_rgActionInfo [ ] = {
const KStdGameActionInfo g_rgActionInfo [ ] = {
// "game" menu
// "game" menu
{ KStdGameAction : : New , K StdAccel: : New , 0 , " game_new " , I18N_NOOP2 ( " new game " , " &New " ) , 0 , " filenew " } ,
{ KStdGameAction : : New , TDE StdAccel: : New , 0 , " game_new " , I18N_NOOP2 ( " new game " , " &New " ) , 0 , " filenew " } ,
{ KStdGameAction : : Load , K StdAccel: : Open , 0 , " game_load " , I18N_NOOP ( " &Load... " ) , 0 , " fileopen " } ,
{ KStdGameAction : : Load , TDE StdAccel: : Open , 0 , " game_load " , I18N_NOOP ( " &Load... " ) , 0 , " fileopen " } ,
{ KStdGameAction : : LoadRecent , K StdAccel: : AccelNone , 0 , " game_load_recent " , I18N_NOOP ( " Load &Recent " ) , 0 , 0 } ,
{ KStdGameAction : : LoadRecent , TDE StdAccel: : AccelNone , 0 , " game_load_recent " , I18N_NOOP ( " Load &Recent " ) , 0 , 0 } ,
{ KStdGameAction : : Restart , K StdAccel: : Reload , 0 , " game_restart " , I18N_NOOP ( " Restart &Game " ) , 0 , " reload " } ,
{ KStdGameAction : : Restart , TDE StdAccel: : Reload , 0 , " game_restart " , I18N_NOOP ( " Restart &Game " ) , 0 , " reload " } ,
{ KStdGameAction : : Save , K StdAccel: : Save , 0 , " game_save " , I18N_NOOP ( " &Save " ) , 0 , " filesave " } ,
{ KStdGameAction : : Save , TDE StdAccel: : Save , 0 , " game_save " , I18N_NOOP ( " &Save " ) , 0 , " filesave " } ,
{ KStdGameAction : : SaveAs , K StdAccel: : AccelNone , 0 , " game_save_as " , I18N_NOOP ( " Save &As... " ) , 0 , " filesaveas " } ,
{ KStdGameAction : : SaveAs , TDE StdAccel: : AccelNone , 0 , " game_save_as " , I18N_NOOP ( " Save &As... " ) , 0 , " filesaveas " } ,
{ KStdGameAction : : End , K StdAccel: : End , 0 , " game_end " , I18N_NOOP ( " &End Game " ) , 0 , " fileclose " } ,
{ KStdGameAction : : End , TDE StdAccel: : End , 0 , " game_end " , I18N_NOOP ( " &End Game " ) , 0 , " fileclose " } ,
{ KStdGameAction : : Pause , K StdAccel: : AccelNone , TQt : : Key_P , " game_pause " , I18N_NOOP ( " Pa&use " ) , 0 , " player_pause " } ,
{ KStdGameAction : : Pause , TDE StdAccel: : AccelNone , TQt : : Key_P , " game_pause " , I18N_NOOP ( " Pa&use " ) , 0 , " player_pause " } ,
{ KStdGameAction : : Highscores , K StdAccel: : AccelNone , TQt : : CTRL + TQt : : Key_H , " game_highscores " , I18N_NOOP ( " Show &Highscores " ) , 0 , " highscore " } ,
{ KStdGameAction : : Highscores , TDE StdAccel: : AccelNone , TQt : : CTRL + TQt : : Key_H , " game_highscores " , I18N_NOOP ( " Show &Highscores " ) , 0 , " highscore " } ,
{ KStdGameAction : : Print , K StdAccel: : Print , 0 , " game_print " , I18N_NOOP ( " &Print... " ) , 0 , " fileprint " } ,
{ KStdGameAction : : Print , TDE StdAccel: : Print , 0 , " game_print " , I18N_NOOP ( " &Print... " ) , 0 , " fileprint " } ,
{ KStdGameAction : : Quit , K StdAccel: : Quit , 0 , " game_quit " , I18N_NOOP ( " &Quit " ) , 0 , " exit " } ,
{ KStdGameAction : : Quit , TDE StdAccel: : Quit , 0 , " game_quit " , I18N_NOOP ( " &Quit " ) , 0 , " exit " } ,
// "move" menu
// "move" menu
{ KStdGameAction : : Repeat , K StdAccel: : AccelNone , 0 , " move_repeat " , I18N_NOOP ( " Repeat " ) , 0 , 0 } ,
{ KStdGameAction : : Repeat , TDE StdAccel: : AccelNone , 0 , " move_repeat " , I18N_NOOP ( " Repeat " ) , 0 , 0 } ,
{ KStdGameAction : : Undo , K StdAccel: : Undo , 0 , " move_undo " , I18N_NOOP ( " Und&o " ) , 0 , " undo " } ,
{ KStdGameAction : : Undo , TDE StdAccel: : Undo , 0 , " move_undo " , I18N_NOOP ( " Und&o " ) , 0 , " undo " } ,
{ KStdGameAction : : Redo , K StdAccel: : Redo , 0 , " move_redo " , I18N_NOOP ( " Re&do " ) , 0 , " redo " } ,
{ KStdGameAction : : Redo , TDE StdAccel: : Redo , 0 , " move_redo " , I18N_NOOP ( " Re&do " ) , 0 , " redo " } ,
{ KStdGameAction : : Roll , K StdAccel: : AccelNone , TQt : : CTRL + TQt : : Key_R , " move_roll " , I18N_NOOP ( " &Roll Dice " ) , 0 , " roll " } ,
{ KStdGameAction : : Roll , TDE StdAccel: : AccelNone , TQt : : CTRL + TQt : : Key_R , " move_roll " , I18N_NOOP ( " &Roll Dice " ) , 0 , " roll " } ,
{ KStdGameAction : : EndTurn , K StdAccel: : AccelNone , 0 , " move_end_turn " , I18N_NOOP ( " End Turn " ) , 0 , " endturn " } ,
{ KStdGameAction : : EndTurn , TDE StdAccel: : AccelNone , 0 , " move_end_turn " , I18N_NOOP ( " End Turn " ) , 0 , " endturn " } ,
{ KStdGameAction : : Hint , K StdAccel: : AccelNone , TQt : : Key_H , " move_hint " , I18N_NOOP ( " &Hint " ) , 0 , " idea " } ,
{ KStdGameAction : : Hint , TDE StdAccel: : AccelNone , TQt : : Key_H , " move_hint " , I18N_NOOP ( " &Hint " ) , 0 , " idea " } ,
{ KStdGameAction : : Demo , K StdAccel: : AccelNone , TQt : : Key_D , " move_demo " , I18N_NOOP ( " &Demo " ) , 0 , " 1rightarrow " } ,
{ KStdGameAction : : Demo , TDE StdAccel: : AccelNone , TQt : : Key_D , " move_demo " , I18N_NOOP ( " &Demo " ) , 0 , " 1rightarrow " } ,
{ KStdGameAction : : Solve , K StdAccel: : AccelNone , 0 , " move_solve " , I18N_NOOP ( " &Solve " ) , 0 , " wizard " } ,
{ KStdGameAction : : Solve , TDE StdAccel: : AccelNone , 0 , " move_solve " , I18N_NOOP ( " &Solve " ) , 0 , " wizard " } ,
// "settings" menu
// "settings" menu
{ KStdGameAction : : ChooseGameType , K StdAccel: : AccelNone , 0 , " options_choose_game_type " , I18N_NOOP ( " Choose Game &Type " ) , 0 , 0 } ,
{ KStdGameAction : : ChooseGameType , TDE StdAccel: : AccelNone , 0 , " options_choose_game_type " , I18N_NOOP ( " Choose Game &Type " ) , 0 , 0 } ,
{ KStdGameAction : : Carddecks , K StdAccel: : AccelNone , 0 , " options_configure_carddecks " , I18N_NOOP ( " Configure &Carddecks... " ) , 0 , 0 } ,
{ KStdGameAction : : Carddecks , TDE StdAccel: : AccelNone , 0 , " options_configure_carddecks " , I18N_NOOP ( " Configure &Carddecks... " ) , 0 , 0 } ,
{ KStdGameAction : : ConfigureHighscores , K StdAccel: : AccelNone , 0 , " options_configure_highscores " , I18N_NOOP ( " Configure &Highscores... " ) , 0 , 0 } ,
{ KStdGameAction : : ConfigureHighscores , TDE StdAccel: : AccelNone , 0 , " options_configure_highscores " , I18N_NOOP ( " Configure &Highscores... " ) , 0 , 0 } ,
{ KStdGameAction : : ActionNone , K StdAccel: : AccelNone , 0 , 0 , 0 , 0 , 0 }
{ KStdGameAction : : ActionNone , TDE StdAccel: : AccelNone , 0 , 0 , 0 , 0 , 0 }
} ;
} ;
static const KStdGameActionInfo * infoPtr ( KStdGameAction : : StdGameAction id )
static const KStdGameActionInfo * infoPtr ( KStdGameAction : : StdGameAction id )
@ -95,35 +95,35 @@ static const KStdGameActionInfo* infoPtr( KStdGameAction::StdGameAction id )
}
}
K Action* KStdGameAction : : create ( StdGameAction id , const char * name ,
TDE Action* KStdGameAction : : create ( StdGameAction id , const char * name ,
const TQObject * recvr , const char * slot ,
const TQObject * recvr , const char * slot ,
K ActionCollection* parent )
TDE ActionCollection* parent )
{
{
K Action* pAction = 0 ;
TDE Action* pAction = 0 ;
const KStdGameActionInfo * pInfo = infoPtr ( id ) ;
const KStdGameActionInfo * pInfo = infoPtr ( id ) ;
kdDebug ( 125 ) < < " KStdGameAction::create( " < < id < < " = " < < ( pInfo ? pInfo - > psName : ( const char * ) 0 ) < < " , " < < parent < < " , " < < name < < " ) " < < endl ;
kdDebug ( 125 ) < < " KStdGameAction::create( " < < id < < " = " < < ( pInfo ? pInfo - > psName : ( const char * ) 0 ) < < " , " < < parent < < " , " < < name < < " ) " < < endl ;
if ( pInfo ) {
if ( pInfo ) {
TQString sLabel = i18n ( pInfo - > psLabel ) ;
TQString sLabel = i18n ( pInfo - > psLabel ) ;
K Shortcut cut = ( pInfo - > globalAccel = = K StdAccel: : AccelNone
TDE Shortcut cut = ( pInfo - > globalAccel = = TDE StdAccel: : AccelNone
? K Shortcut( pInfo - > shortcut )
? TDE Shortcut( pInfo - > shortcut )
: K StdAccel: : shortcut ( pInfo - > globalAccel ) ) ;
: TDE StdAccel: : shortcut ( pInfo - > globalAccel ) ) ;
const char * n = name ? name : pInfo - > psName ;
const char * n = name ? name : pInfo - > psName ;
switch ( id ) {
switch ( id ) {
case LoadRecent :
case LoadRecent :
pAction =
pAction =
new K RecentFilesAction( sLabel , cut , recvr , slot , parent , n ) ;
new TDE RecentFilesAction( sLabel , cut , recvr , slot , parent , n ) ;
break ;
break ;
case Pause :
case Pause :
case Demo :
case Demo :
pAction = new K ToggleAction( sLabel , pInfo - > psIconName , cut ,
pAction = new TDE ToggleAction( sLabel , pInfo - > psIconName , cut ,
recvr , slot , parent , n ) ;
recvr , slot , parent , n ) ;
break ;
break ;
case ChooseGameType :
case ChooseGameType :
pAction = new K SelectAction( sLabel , pInfo - > psIconName , cut ,
pAction = new TDE SelectAction( sLabel , pInfo - > psIconName , cut ,
recvr , slot , parent , n ) ;
recvr , slot , parent , n ) ;
break ;
break ;
default :
default :
pAction = new K Action( sLabel , pInfo - > psIconName , cut ,
pAction = new TDE Action( sLabel , pInfo - > psIconName , cut ,
recvr , slot , parent , n ) ;
recvr , slot , parent , n ) ;
break ;
break ;
}
}
@ -137,73 +137,73 @@ const char* KStdGameAction::name( StdGameAction id )
return ( pInfo ) ? pInfo - > psName : 0 ;
return ( pInfo ) ? pInfo - > psName : 0 ;
}
}
K Action * KStdGameAction : : gameNew ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : gameNew ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( New , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( New , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : load ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : load ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Load , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Load , name , recvr , slot , parent ) ; }
K RecentFilesAction * KStdGameAction : : loadRecent ( const TQObject * recvr , const char * slot ,
TDE RecentFilesAction * KStdGameAction : : loadRecent ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return static_cast < K RecentFilesAction * > ( KStdGameAction : : create ( LoadRecent , name , recvr , slot , parent ) ) ; }
{ return static_cast < TDE RecentFilesAction * > ( KStdGameAction : : create ( LoadRecent , name , recvr , slot , parent ) ) ; }
K Action * KStdGameAction : : save ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : save ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Save , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Save , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : saveAs ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : saveAs ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( SaveAs , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( SaveAs , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : end ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : end ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( End , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( End , name , recvr , slot , parent ) ; }
K ToggleAction * KStdGameAction : : pause ( const TQObject * recvr , const char * slot ,
TDE ToggleAction * KStdGameAction : : pause ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return static_cast < K ToggleAction * > ( KStdGameAction : : create ( Pause , name , recvr , slot , parent ) ) ; }
{ return static_cast < TDE ToggleAction * > ( KStdGameAction : : create ( Pause , name , recvr , slot , parent ) ) ; }
K Action * KStdGameAction : : highscores ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : highscores ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Highscores , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Highscores , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : print ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : print ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Print , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Print , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : quit ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : quit ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Quit , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Quit , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : repeat ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : repeat ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Repeat , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Repeat , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : undo ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : undo ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Undo , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Undo , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : redo ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : redo ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Redo , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Redo , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : roll ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : roll ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Roll , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Roll , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : endTurn ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : endTurn ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( EndTurn , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( EndTurn , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : carddecks ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : carddecks ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Carddecks , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Carddecks , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : configureHighscores ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : configureHighscores ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( ConfigureHighscores , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( ConfigureHighscores , name , recvr , slot , parent ) ; }
K Action * KStdGameAction : : hint ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : hint ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Hint , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Hint , name , recvr , slot , parent ) ; }
K ToggleAction * KStdGameAction : : demo ( const TQObject * recvr , const char * slot ,
TDE ToggleAction * KStdGameAction : : demo ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return static_cast < K ToggleAction * > ( KStdGameAction : : create ( Demo , name , recvr , slot , parent ) ) ; }
{ return static_cast < TDE ToggleAction * > ( KStdGameAction : : create ( Demo , name , recvr , slot , parent ) ) ; }
K Action * KStdGameAction : : solve ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : solve ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Solve , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Solve , name , recvr , slot , parent ) ; }
K SelectAction * KStdGameAction : : chooseGameType ( const TQObject * recvr , const char * slot ,
TDE SelectAction * KStdGameAction : : chooseGameType ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return static_cast < K SelectAction * > ( KStdGameAction : : create ( ChooseGameType , name , recvr , slot , parent ) ) ; }
{ return static_cast < TDE SelectAction * > ( KStdGameAction : : create ( ChooseGameType , name , recvr , slot , parent ) ) ; }
K Action * KStdGameAction : : restart ( const TQObject * recvr , const char * slot ,
TDE Action * KStdGameAction : : restart ( const TQObject * recvr , const char * slot ,
K ActionCollection * parent , const char * name )
TDE ActionCollection * parent , const char * name )
{ return KStdGameAction : : create ( Restart , name , recvr , slot , parent ) ; }
{ return KStdGameAction : : create ( Restart , name , recvr , slot , parent ) ; }