Beispiel #1
0
void DBGNet::receivePack(DBGResponsePack* pack)
{
  if(!processHeader(pack->header()))
  {
    return;
  }

  DBGResponseTag* tag = NULL;
  pack->rewind();
  while((tag = pack->next()) != NULL)
  {
    tag->process(this, pack);
  }

  if(m_isProfiling)
  {
    setupProfile();
  }
  else
  {
    shipStack();
  }
}
Beispiel #2
0
// A save or restore has been requested (Probably by QEGui itself)
void saveRestoreManager::saveRestore( SaveRestoreSignal::saveRestoreOptions option )
{
    PersistanceManager* pm = profile.getPersistanceManager();

    switch( option )
    {
        // Save the application data
        case SaveRestoreSignal::SAVE:
            {
                // Start with the top level element - the QEGui application
                PMElement appElement =  pm->addNamedConfiguration( SAVERESTORE_NAME );

                // Note the number of main windows. This will determine how many main windows are expected on restore
                appElement.addValue( "MainWindows", app->getMainWindowCount() );

                // Note the current user level
                userLevelTypes meta;
                appElement.addValue ("UserLevel", QEUtilities::enumToString( meta, "userLevels", getUserLevel() ));
            }
            break;

        // First restore phase.
        // This application will create the main windows and the GUIs they contain
        case SaveRestoreSignal::RESTORE_APPLICATION:
            {
                // Get the data for this application
                PMElement QEGuiData = pm->getNamedConfiguration( SAVERESTORE_NAME );

                // If none, do nothing
                if( QEGuiData.isNull() )
                {
                    return;
                }

                // Note the current user level
                QString levelString;
                QEGuiData.getValue( "UserLevel", levelString );
                userLevelTypes meta;
                userLevelTypes::userLevels levelInt;
                bool ok;
                levelInt = (userLevelTypes::userLevels)QEUtilities::stringToEnum( meta, "userLevels", levelString, &ok );
                if( ok )
                {
                    setUserLevel( levelInt );
                }

                // Get the number of expected main windows
                int numMainWindows = 0;
                QEGuiData.getValue( "MainWindows", numMainWindows );

                // Create the main windows. They will restore themselves
                setupProfile( NULL, app->getParams()->pathList, "", app->getParams()->substitutions );
                for( int i = 0; i < numMainWindows; i++ )
                {
                    MainWindow* mw = new MainWindow( app, "", "", "", QEFormMapper::nullHandle(), false );
                    mw->show();
                }

                releaseProfile();
            }
            break;

        // Second resore phase.
        // This application has done it's work. The widgets that have been created will be able to act on the second phase
        case SaveRestoreSignal::RESTORE_QEFRAMEWORK:
            break;

    }

}