/*!

*/
void
DebugMessageWindow::createActions()
{
    // view switches

    M_show_debug_view_all_act = new QAction( QIcon( QPixmap( debug_view_all_xpm ) ),
                                             tr( "Toggle debug view" ), this );
    M_show_debug_view_all_act->setStatusTip( tr( "Show/Hide all debug view" ) );
    M_show_debug_view_all_act->setCheckable( true );
    M_show_debug_view_all_act->setChecked( true );
    connect( M_show_debug_view_all_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugViewAll( bool ) ) );

    M_show_debug_view_self_act = new QAction( QIcon( QPixmap( debug_view_self_xpm ) ),
                                              tr( "Toggle debug view self" ), this );
    M_show_debug_view_self_act->setStatusTip( tr( "Show/Hide debug view self" ) );
    M_show_debug_view_self_act->setCheckable( true );
    M_show_debug_view_self_act->setChecked( true );
    connect( M_show_debug_view_self_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugViewSelf( bool ) ) );

    M_show_debug_view_ball_act = new QAction( QIcon( QPixmap( debug_view_ball_xpm ) ),
                                              tr( "Toggle debug view ball" ), this );
    M_show_debug_view_ball_act->setStatusTip( tr( "Show/Hide debug view ball" ) );
    M_show_debug_view_ball_act->setCheckable( true );
    M_show_debug_view_ball_act->setChecked( true );
    connect( M_show_debug_view_ball_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugViewBall( bool ) ) );

    M_show_debug_view_teammates_act = new QAction( QIcon( QPixmap( debug_view_teammate_xpm ) ),
                                                   tr( "Toggle debug view teammates" ), this );
    M_show_debug_view_teammates_act->setStatusTip( tr( "Show/Hide debug view teammates" ) );
    M_show_debug_view_teammates_act->setCheckable( true );
    M_show_debug_view_teammates_act->setChecked( true );
    connect( M_show_debug_view_teammates_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugViewTeammates( bool ) ) );

    M_show_debug_view_opponents_act = new QAction( QIcon( QPixmap( debug_view_opponent_xpm ) ),
                                                   tr( "Toggle debug view opponents" ), this );
    M_show_debug_view_opponents_act->setStatusTip( tr( "Show/Hide debug view opponents" ) );
    M_show_debug_view_opponents_act->setCheckable( true );
    M_show_debug_view_opponents_act->setChecked( true );
    connect( M_show_debug_view_opponents_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugViewOpponents( bool ) ) );

    M_show_debug_view_comment_act = new QAction( QIcon( QPixmap( debug_view_comment_xpm ) ),
                                              tr( "Toggle debug view comment" ), this );
    M_show_debug_view_comment_act->setStatusTip( tr( "Show/Hide debug view comment" ) );
    M_show_debug_view_comment_act->setCheckable( true );
    M_show_debug_view_comment_act->setChecked( true );
    connect( M_show_debug_view_comment_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugViewComment( bool ) ) );

    M_show_debug_view_shape_act = new QAction( QIcon( QPixmap( debug_view_line_xpm ) ),
                                              tr( "Toggle debug view shape" ), this );
    M_show_debug_view_shape_act->setStatusTip( tr( "Show/Hide debug view shape" ) );
    M_show_debug_view_shape_act->setCheckable( true );
    M_show_debug_view_shape_act->setChecked( true );
    connect( M_show_debug_view_shape_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugViewShape( bool ) ) );

    M_show_debug_view_target_act = new QAction( QIcon( QPixmap( debug_view_target_xpm ) ),
                                              tr( "Toggle debug view target" ), this );
    M_show_debug_view_target_act->setStatusTip( tr( "Show/Hide debug view target" ) );
    M_show_debug_view_target_act->setCheckable( true );
    M_show_debug_view_target_act->setChecked( true );
    connect( M_show_debug_view_target_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugViewTarget( bool ) ) );

    M_show_debug_view_message_act = new QAction( QIcon( QPixmap( debug_view_message_xpm ) ),
                                              tr( "Toggle debug view message" ), this );
    M_show_debug_view_message_act->setStatusTip( tr( "Show/Hide debug view message" ) );
    M_show_debug_view_message_act->setCheckable( true );
    M_show_debug_view_message_act->setChecked( true );
    connect( M_show_debug_view_message_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugViewMessage( bool ) ) );
    //////////////////////////////////////////////
    // debug log view
    M_show_debug_log_objects_act = new QAction( QIcon( QPixmap( debug_log_view_xpm ) ),
                                                tr( "Toggle debug log objects" ),
                                                this );
    M_show_debug_log_objects_act->setStatusTip( tr( "Show/Hide debug log objects" ) );
    M_show_debug_log_objects_act->setCheckable( true );
    M_show_debug_log_objects_act->setChecked( true );
    connect( M_show_debug_log_objects_act, SIGNAL( triggered( bool ) ),
             this, SLOT( toggleShowDebugLogObjects( bool ) ) );

    //////////////////////////////////////////////
    // dir selection
    M_open_debug_log_dir_act = new QAction( QIcon( QPixmap( open_dir_xpm ) ),
                                            tr( "Open log dir..." ), this );
#ifdef Q_WS_MAC
    M_open_debug_log_dir_act->setShortcut( Qt::META + Qt::Key_O );
#else
    M_open_debug_log_dir_act->setShortcut( Qt::CTRL + Qt::Key_O );
#endif
    M_open_debug_log_dir_act->setStatusTip( tr( "Open the debug log directory" ) );
    connect( M_open_debug_log_dir_act, SIGNAL( triggered() ),
             this, SLOT( showDebugLogDirDialog() ) );
    //
    M_clear_data_act = new QAction( QIcon( QPixmap( clear_xpm ) ),
                                    tr( "Clear data" ), this );
    M_clear_data_act->setStatusTip( tr( "Clear all data" ) );
    connect( M_clear_data_act, SIGNAL( triggered() ),
             this, SLOT( clearAll() ) );

    //////////////////////////////////////////////
    // cycle control
    M_sync_act = new QAction( QIcon( QPixmap( sync_xpm ) ),
                              tr( "Sync" ), this );
#ifdef Q_WS_MAC
    M_sync_act->setShortcut( Qt::META + Qt::Key_S );
#else
    M_sync_act->setShortcut( Qt::CTRL + Qt::Key_S );
#endif
    M_sync_act->setStatusTip( tr( "Synchronize with field canvas" ) );
    connect( M_sync_act, SIGNAL( triggered() ),
             this, SLOT( syncCycle() ) );

    M_decrement_act = new QAction( QIcon( QPixmap( logplayer_one_step_back_xpm ) ),
                              tr( "Decrement" ), this );
#ifdef Q_WS_MAC
    M_decrement_act->setShortcut( Qt::META + Qt::Key_Left );
#else
    M_decrement_act->setShortcut( Qt::CTRL + Qt::Key_Left );
#endif
    M_decrement_act->setStatusTip( tr( "Decrement message cycle" ) );
    connect( M_decrement_act, SIGNAL( triggered() ),
             this, SLOT( decrementCycle() ) );

    M_increment_act = new QAction( QIcon( QPixmap( logplayer_one_step_forward_xpm ) ),
                                   tr( "Increment" ), this );
#ifdef Q_WS_MAC
    M_increment_act->setShortcut( Qt::META + Qt::Key_Right );
#else
    M_increment_act->setShortcut( Qt::CTRL + Qt::Key_Right );
#endif
    M_increment_act->setStatusTip( tr( "Increment message cycle" ) );
    connect( M_increment_act, SIGNAL( triggered() ),
             this, SLOT( incrementCycle() ) );

    //////////////////////////////////////////////
    // debug level switches
    const char ** num_xpm[] = { num_1_xpm, num_2_xpm, num_3_xpm, num_4_xpm,
                                num_5_xpm, num_6_xpm, num_7_xpm, num_8_xpm,
                                num_9_xpm, num_10_xpm, num_11_xpm, num_12_xpm,
                                num_13_xpm, num_14_xpm, num_15_xpm, num_16_xpm,
                                num_17_xpm, num_18_xpm, num_19_xpm, num_20_xpm,
                                num_21_xpm, num_22_xpm, num_23_xpm, num_24_xpm,
                                num_25_xpm, num_26_xpm, num_27_xpm, num_28_xpm,
                                num_29_xpm, num_30_xpm, num_31_xpm, num_32_xpm };

    QSignalMapper * debug_level_mapper = new QSignalMapper( this );
    connect( debug_level_mapper, SIGNAL( mapped( int ) ),
             this, SLOT( toggleDebugLevel( int ) ) );

    for ( int i = 0; i < 32; ++i )
    {
        QString menu_text;
        if ( M_debug_text[i].isEmpty() )
        {
            menu_text = tr( "Level %1 " ).arg( i + 1 );
            M_debug_level_act[i] = new QAction( QIcon( QPixmap( num_xpm[i] ) ),
                                                menu_text, this );
        }
        else
        {
            menu_text = M_debug_text[i];
            M_debug_level_act[i] = new QAction( menu_text, this );
        }

        M_debug_level_act[i]->setStatusTip( tr( "Debug " ) + menu_text );
        M_debug_level_act[i]->setCheckable( true );

        connect( M_debug_level_act[i], SIGNAL( triggered() ),
                 debug_level_mapper, SLOT( map() ) );
        debug_level_mapper->setMapping( M_debug_level_act[i], i + 1 );
    }
}
예제 #2
0
void HeapVerifier::initializeGCCycle()
{
    Heap* heap = m_heap;
    incrementCycle();
    currentCycle().collectionType = heap->operationInProgress();
}