예제 #1
0
KASearchSettings::KASearchSettings(const char *title, QWidget *parent, const char *name)
  :QGroupBox( title, parent, name )
{
  // setup the main organizer
  //  mainlayout = new QGridLayout( this, 2, 2, 15, 0 );

  // setup the searchlevel
  searchbox = new QGroupBox( this, "searchbox" );
  searchbox->setFrameStyle( QFrame::NoFrame );
  searchmode = new QComboBox( searchbox, "searchmode" );
  //  searchmode->insertStrList(&SearchMode::fullList());
  searchlabel = new QLabel( searchmode, "S&earch Mode", searchbox, "searchlabel" );
  searchlabel->adjustSize();

  // setup the sorttype
  //  sortbox = new QGroupBox( this, "sortbox" );
  //  sortbox->setFrameStyle( QFrame::NoFrame );
  //  sortmode = new QComboBox( sortbox, "sortmode" );
  //  sortlabel = new QLabel( sortmode, "S&ort Mode", sortbox, "sortlabel" );
  //  sortlabel->adjustSize();

  // setup the weightsbox, belongs to sorttype
  //  weightbox = new QGroupBox( this, "weightbox" );
  //  weightbox->setFrameStyle( QFrame::NoFrame );
  //  weightlist = new QListBox( weightbox, "weightlist" );
  //  weightlabel = new QLabel( weightlist, "&Weight", weightbox, "weightlabel" );
  //  weightlabel->adjustSize();

  // setup the nicelevel
  nicebox = new QGroupBox( this, "nicebox" );
  nicebox->setFrameStyle( QFrame::NoFrame );
  nicelevel = new QComboBox( nicebox, "nicelevel" );
  nicelabel = new QLabel( nicelevel, i18n("&Nice Level"), nicebox, "nicelabel" );
  nicelabel->adjustSize();

  // setup the hitslevel
  hitsbox = new QGroupBox( this, "hitsbox" );
  hitsbox->setFrameStyle( QFrame::NoFrame );
  maxhits = new KIntegerLine( hitsbox, "maxhits" );
  hitslabel = new QLabel( maxhits, i18n("max. &Hits"), hitsbox, "hitslabel" );
  hitslabel->adjustSize();
  connect(maxhits, SIGNAL(returnPressed()),
	  this, SLOT(slotRP()) );

  initWidgets();

  doLayout();

  readConfig();
}
예제 #2
0
/**
 * \brief Reads components parameters and checks set integrity before signaling the Worker thread to start running
 *   (1) Ice parameters
 *   (2) Local component parameters read at start
 *
 */
void SpecificMonitor::initialize()
{
	rInfo("Starting monitor ...");
	initialTime=QTime::currentTime();
	RoboCompCommonBehavior::ParameterList params;
	readPConfParams(params);
	readConfig(params);
	if(!sendParamsToWorker(params))
	{
		rError("Error reading config parameters. Exiting");
		killYourSelf();
	}
	state = RoboCompCommonBehavior::Running;
}
예제 #3
0
nodeInfo * configParser(int num, char * pwd)
{
    char * buffer;
    nodeInfo * n;

    if ((n=nodeNew(num)) == NULL)
        errorMessage("can not allocate memory!");

    buffer = textPreOper(pwd, num);
    readConfig(buffer, n, num);
    
    free(buffer);
    return n;
}
예제 #4
0
/****** Interactive/qrsh/--qrsh_starter ***************************************
*
*  NAME
*     qrsh_starter -- start a command special correct environment
*
*  SYNOPSIS
*     qrsh_starter <environment file> <noshell>
*     int main(int argc, char **argv[])
*
*  FUNCTION
*     qrsh_starter is used to start a command, optionally with additional
*     arguments, in a special environment.
*     The environment is read from the given <environment file>.
*     The command to be executed is read from the environment variable
*     QRSH_COMMAND and executed either standalone, passed to a wrapper
*     script (environment  variable QRSH_WRAPPER) or (default) in a users login
*     shell (<shell> -c <command>).
*     On exit of the command, or if an error occurs, an exit code is written
*     to the file $TMPDIR/qrsh_exit_code.
*
*     qrsh_starter is called from qrsh to start the remote processes in 
*     the correct environment.
*
*  INPUTS
*     environment file - file with environment information, each line 
*                        contains a tuple <name>=<value>
*     noshell          - if this parameter is passed, the command will be
*                        executed standalone
*
*  RESULT
*     EXIT_SUCCESS, if all actions could be performed,
*     EXIT_FAILURE, if an error occured
*
*  EXAMPLE
*     setenv QRSH_COMMAND "echo test"
*     env > ~/myenvironment
*     rsh <hostname> qrsh_starter ~/myenvironment 
*
*  SEE ALSO
*     Interactive/qsh/--Interactive
*
****************************************************************************
*/
int main(int argc, char *argv[])
{
   int   exitCode = 0;
   char *command  = NULL;
   char *wrapper = NULL;
   int  noshell  = 0;

   /* check for correct usage */
   if(argc < 2) {
      fprintf(stderr, "usage: %s <job spooldir> [noshell]\n", argv[0]);
      exit(EXIT_FAILURE);        
   }

   /* check for noshell */
   if(argc > 2) {
      if(strcmp(argv[2], "noshell") == 0) {
         noshell = 1;
      }
   }

   if(!readConfig(argv[1])) {
      writeExitCode(EXIT_FAILURE, 0);
      exit(EXIT_FAILURE);
   }

   /* setup environment */
   command = setEnvironment(argv[1], &wrapper);
   if(command == NULL) {
      writeExitCode(EXIT_FAILURE, 0);
      exit(EXIT_FAILURE);
   }   

   if(!changeDirectory()) {
      writeExitCode(EXIT_FAILURE, 0);
      exit(EXIT_FAILURE);
   }

   /* start job */
   exitCode = startJob(command, wrapper, noshell);

   /* JG: TODO: At this time, we could already pass the exitCode to qrsh.
    *           Currently, this is done by shepherd, but only after 
    *           qrsh_starter and rshd exited.
    *           If we pass exitCode to qrsh, we also have to implement the
    *           shepherd_about_to_exit mechanism here.
    */

   /* write exit code and exit */
   return writeExitCode(EXIT_SUCCESS, exitCode);
}
예제 #5
0
//-----------------------------------------------------------------------------
KMFilter::KMFilter(KConfig* config)
{
  int i;

  if (!sActionDict) sActionDict = new KMFilterActionDict;
  if (config) readConfig(config);
  else
  {
    mName = 0;
    mOperator = OpIgnore;
    for (i=0; i<=FILTER_MAX_ACTIONS; i++)
      mAction[i] = NULL;
  }
}
예제 #6
0
QtGeneralSettings::QtGeneralSettings(CWengoPhone & cWengoPhone, QWidget * parent)
	: QWidget(parent),
		_cWengoPhone( cWengoPhone )
{

	_ui = new Ui::GeneralSettings();
	_ui->setupUi(this);

#ifdef OS_LINUX
	_ui->autoStartGroupBox->hide();
#endif

	readConfig();
}
예제 #7
0
OptionsGraphicsMenu::OptionsGraphicsMenu(::Engines::Console *console) : KotORBase::GUI(console) {
	load("optgraphics");

	addBackground(KotORBase::kBackgroundTypeMenu);

	_advanced.reset(new OptionsGraphicsAdvancedMenu(_console));
	_resolution.reset(new OptionsResolutionMenu(_console));

	// Hardcoded, the gui file returns incorrect values
	getCheckBox("CB_SHADOWS", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
	getCheckBox("CB_GRASS", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);

	readConfig();
}
예제 #8
0
SlaveConfigProtocol* SlaveConfigPrivate::readProtocolConfig(const QString &_protocol)
{
   SlaveConfigProtocol *scp = protocol.find(_protocol);
   if (!scp)
   {
      QString filename = KProtocolInfo::config(_protocol);
      scp = new SlaveConfigProtocol;
      scp->configFile = new KConfig(filename, true, false);
      protocol.insert(_protocol, scp);
   }
   // Read global stuff...
   readConfig(scp->configFile, "<default>", &(scp->global));
   return scp;
}
예제 #9
0
ToolsConfigWidget::ToolsConfigWidget(QWidget *parent, const char *name)
    : ToolsConfigWidgetBase(parent, name)
{
    m_toolsmenuEntries.setAutoDelete(true);
    m_filecontextEntries.setAutoDelete(true);
    m_dircontextEntries.setAutoDelete(true);

    toolsmenuBox->setAcceptDrops(true);
    toolsmenuBox->installEventFilter(this);
    toolsmenuBox->viewport()->setAcceptDrops(true);
    toolsmenuBox->viewport()->installEventFilter(this);

    readConfig();
}
예제 #10
0
void MainDialog::showOptions()
{
	LOG_5("MWIN: Showing settings dialog");
	SettingsDialog * settings = new SettingsDialog(this);
	// Exec for a modal dialog
	int result = settings->exec();
	
	if( result == QDialog::Accepted ){
		LOG_5("MWIN: Applying new settings");
		settings->applyChanges();	// Apply the changes to 'config'
		readConfig();				// Read the values from 'config'
	}
	delete settings;
}
예제 #11
0
bool SUSE2Handler::reset(unsigned long /*changed*/)
{
    // we assume the active font to be the same as the inactive font since the control
    // center doesn't offer different settings anyways.
    m_titleFont = KDecoration::options()->font(true, false); // not small
    m_titleFontTool = KDecoration::options()->font(true, true); // small

    switch(KDecoration::options()->preferredBorderSize( this )) {
        case BorderTiny:
            m_borderSize = 3;
            break;
        case BorderLarge:
            m_borderSize = 8;
            break;
        case BorderVeryLarge:
            m_borderSize = 12;
            break;
        case BorderHuge:
            m_borderSize = 18;
            break;
        case BorderVeryHuge:
            m_borderSize = 27;
            break;
        case BorderOversized:
            m_borderSize = 40;
            break;
        case BorderNormal:
        default:
            m_borderSize = 4;
    }

    // check if we are in reverse layout mode
    m_reverse = QApplication::reverseLayout();

    // read in the configuration
    readConfig();

    for (int t = 0; t < NumButtonStatus; ++t) {
        for (int i = 0; i < NumButtonIcons; ++i) {
            if (m_pixmaps[t][i]) {
                delete m_pixmaps[t][i];
                m_pixmaps[t][i] = 0;
            }
        }
    }

    /// I dont want to do smart things here
    /// just for cases that do not happen very often.
    return true;
}
bool OutputString::set_value(std::string val)
{
    if (!isEnabled()) return true;

    readConfig();

    set_value_real(val);
   
    value = val;
    EmitSignalIO();
    emitChange();

    return true;
}
//______________________________________________________________________________
bool scopeConfigReader::readConfigFiles()
{
    bool success = true;
    /// There are 2 types of objects in the scope, a trace monitor and a number monitor;
    /// They are defined in seperate config files to seperate the data more clearly
    /// they still all end up in an scopeObject
    //NUM
    scopeNumObjects.clear();
    scopeNumMonStructs.clear();
    bool numSuccess = readConfig( *this,  configFile1, &scopeConfigReader::addToScopeNumObjectsV1,nullptr, &scopeConfigReader::addToScopeNumMonStructsV1 );
    if( !numSuccess )
        success = false;
//    if( numObjs == scopeTraceDataObject.size() )
    if( numObjs == scopeNumObjects.size() )
        debugMessage( "*** Created ", numObjs, " scope num Objects, As Expected ***", "\n" );
    else
    {
        debugMessage( "*** Created ", scopeNumObjects.size() ," scope num Objects, Expected ", numObjs,  " ERROR ***", "\n"  );
        success = false;
    }
    //TRACE
    scopeTraceDataObjects.clear();
    scopeTraceDataMonStructs.clear();
    bool traceSuccess = readConfig( *this,  configFile2, &scopeConfigReader::addToScopeTraceDataObjectsV1,nullptr, &scopeConfigReader::addToScopeTraceDataMonStructsV1 );
    if( !traceSuccess )
        success = false;
//    if( numObjs == scopeTraceDataObject.size() )
    if( numObjs == scopeTraceDataObjects.size() )
        debugMessage( "*** Created ", numObjs, " scope trace Objects, As Expected ***", "\n" );
    else
    {
        debugMessage( "*** Created ", scopeTraceDataObjects.size() ," scope trace Objects, Expected ", numObjs,  " ERROR ***", "\n"  );
        success = false;
    }

    return success;
}
예제 #14
0
int main( int argc, char **argv )
{
  TDECmdLineArgs::init( argc, argv, "kasbar", "KasBar", I18N_NOOP( "An alternative task manager" ), VERSION_STRING );
  TDECmdLineArgs::addCmdLineOptions( options );
  TDEGlobal::locale()->setMainCatalogue( "kasbarextension" );
  TDEApplication app;
  TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();

  kdDebug(1345) << "Kasbar starting..." << endl;

  int wflags = TQt::WStyle_Customize | TQt::WX11BypassWM | TQt::WStyle_DialogBorder | TQt::WStyle_StaysOnTop;
  KasBar *kasbar;
  TDEConfig conf( "kasbarrc" );

  if ( args->isSet("test") ) {
      kasbar = new KasBar( Qt::Vertical, 0, "testkas", (TQ_WFlags)wflags );
      kasbar->setItemSize( KasBar::Large );
      kasbar->append( new KasClockItem(kasbar) );
      kasbar->append( new KasItem(kasbar) );
      kasbar->append( new KasLoadItem(kasbar) );
      kasbar->append( new KasItem(kasbar) );
      kasbar->addTestItems();
  }
  else {
      KasTasker *kastasker = new KasTasker( Qt::Vertical, 0, "testkas", (TQ_WFlags)wflags );
      kastasker->setConfig( &conf );
      kastasker->setStandAlone( true );
      kasbar = kastasker;

      kastasker->readConfig();
      kastasker->move( kastasker->detachedPosition() );
      kastasker->connect( kastasker->resources(), TQT_SIGNAL(changed()), TQT_SLOT(readConfig()) );
      kastasker->refreshAll();
  }

  kdDebug(1345) << "Kasbar about to show" << endl;
  app.setMainWidget( kasbar );
  kasbar->show();

  kasbar->setDetached( true );
  KWin::setOnAllDesktops( kasbar->winId(), true );
  kdDebug() << "kasbar: Window id is " << kasbar->winId() << endl;

  TDEApplication::kApplication()->dcopClient()->registerAs( "kasbar" );

  app.connect( &app, TQT_SIGNAL( lastWindowClosed() ), TQT_SLOT(quit()) );

  return app.exec();
}
예제 #15
0
void handle_init() {
  int i;

  srand(time(NULL));
  initColors();

  readConfig();
  swapDigitShapes();
  app_message_init();

  initSplash();

  window = window_create();
  if (invertStatus) {
    window_set_background_color(window, GColorWhite);
  } else {
    window_set_background_color(window, GColorBlack);
  }
  window_stack_push(window, true);

  rootLayer = window_get_root_layer(window);
  mainLayer = layer_create(layer_get_bounds(rootLayer));
  layer_add_child(rootLayer, mainLayer);
  layer_set_update_proc(mainLayer, updateMainLayer);

  for (i=0; i<NUMSLOTS; i++) {
    initSlot(i, mainLayer);
  }

  initDigitCorners();

  animImpl.setup = NULL;
  animImpl.update = animateDigits;
#ifdef PBL_PLATFORM_APLITE
  animImpl.teardown = destroyAnim;
#else
  animImpl.teardown = NULL;
#endif
  createAnim();

  timer = app_timer_register(STARTDELAY, handle_timer, NULL);

  tick_timer_service_subscribe(MINUTE_UNIT, handle_tick);

  accel_tap_service_subscribe(handle_tap);

  lastBluetoothStatus = bluetooth_connection_service_peek();
  bluetooth_connection_service_subscribe(handle_bluetooth);
}
예제 #16
0
int
main(int argc, char** argv)
{

  setvbuf(stdout, NULL, _IONBF, 0);

  readConfig(argv[1]);

  log_kernel = log_create(argv[2], "KERNEL", false, LOG_LEVEL_TRACE);
  log_info(log_kernel, "Se inicio el Kernel");

  initializateCollections();

  setupSemaphores();

  fillDictionaries();

  startCommunicationWithUMV();

  pthread_t hilo_PLP;
  pthread_t hilo_PCP;

  pthread_create(&hilo_PLP, NULL, *threadPLP, NULL );
  pthread_create(&hilo_PCP, NULL, *threadPCP, NULL );

  actualizarEstado();
  t_nodo_proceso* nodoAListo;
  while (1)
    {

      sem_wait(&sem_multiprog);
      sem_wait(&sem_listaNuevos);
      pthread_mutex_lock(&mutex_listaNuevos);
      nodoAListo = list_remove(listaNuevos, 0);
      pthread_mutex_unlock(&mutex_listaNuevos);
      log_info(log_kernel, "Moviendo PID %d a la lista de Listos",
          nodoAListo->pcb.pid);
      pthread_mutex_lock(&mutex_listaListos);
      queue_push(listaListos, nodoAListo);
      pthread_mutex_unlock(&mutex_listaListos);
      sem_post(&sem_listaListos);
      actualizarEstado();
    }

  pthread_join(hilo_PLP, NULL );
  pthread_join(hilo_PCP, NULL );

  return 0;
}
예제 #17
0
QtLanguagesSettings::QtLanguagesSettings(QWidget * parent)
    : QWidget(parent) {

    _ui = new Ui::LanguagesSettings();
    _ui->setupUi(this);

    SAFE_CONNECT(_ui->launchpadLink,
                 SIGNAL(linkActivated(const QString &)),
                 SLOT(launchpadLinkClicked(const QString &))
                );

    _ui->listWidget->addItems(QtLanguage::getAvailableLanguages());

    readConfig();
}
예제 #18
0
PHPSettings::PHPSettings(  )
  : KConfigSkeleton( QString::fromLatin1( "protoeditorrc" ) )
{
  setCurrentGroup( QString::fromLatin1( "PHP" ) );

  KConfigSkeleton::ItemString  *itemDefaultDebugger;
  itemDefaultDebugger = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "DefaultDebugger" ), mDefaultDebugger );
  addItem( itemDefaultDebugger, QString::fromLatin1( "DefaultDebugger" ) );

  KConfigSkeleton::ItemString  *itemPHPCommand;
  itemPHPCommand = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "PHPCommand" ), mPHPCommand, "php %1");
  addItem( itemPHPCommand, QString::fromLatin1( "PHPCommand" ) );

  readConfig();
}
예제 #19
0
파일: kbackupdlg.cpp 프로젝트: KDE/kmymoney
KBackupDlg::KBackupDlg(QWidget* parent)
    : kbackupdlgdecl(parent)
{
  readConfig();

  KGuiItem chooseButtenItem(i18n("C&hoose..."),
                            QIcon::fromTheme("folder"),
                            i18n("Select mount point"),
                            i18n("Use this to browse to the mount point."));
  KGuiItem::assign(chooseButton, chooseButtenItem);

  connect(chooseButton, SIGNAL(clicked()), this, SLOT(chooseButtonClicked()));
  connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
예제 #20
0
파일: effectloader.cpp 프로젝트: KDE/kwin
void BuiltInEffectLoader::queryAndLoadAll()
{
    const QList<BuiltInEffect> effects = BuiltInEffects::availableEffects();
    for (BuiltInEffect effect : effects) {
        // check whether it is already loaded
        if (m_loadedEffects.contains(effect)) {
            continue;
        }
        const QString key = BuiltInEffects::nameForEffect(effect);
        const LoadEffectFlags flags = readConfig(key, BuiltInEffects::enabledByDefault(effect));
        if (flags.testFlag(LoadEffectFlag::Load)) {
            m_queue->enqueue(qMakePair(effect, flags));
        }
    }
}
예제 #21
0
void CdmaWidget::setCdmaInfo(const QVariantMap info)
{
    Q_D(CdmaWidget);
    d->setting->setNumber(info["number"].toString());

    if (!info["username"].isNull()) {
        d->setting->setUsername(info["username"].toString());
    }
    if (!info["password"].isNull()) {
        d->setting->setPassword(info["password"].toString());
    }

    // TODO: save the sids.
    readConfig();
}
예제 #22
0
파일: testApp.cpp 프로젝트: quave/tripno
//--------------------------------------------------------------
void testApp::setup(){
	// init logs
	ofSetLogLevel(OF_LOG_VERBOSE);
	ofLogVerbose() << "setup started";
	
	tripno.mass = 1.0;
	tripno.velocity = 0;
	tripno.position = ofPoint(0, 0);

	// init scene objects
	timeElapsed = 0;
	currentIndex = 1;

	minFreqLog = 100;
	maxFreqLog = 0;
	maxSignal = 0;

    for (int i = 0; i < SEGMENTS_STORED; ++i) {
        ceilHeights[i] = floorHeights[i] = 0;
		earthline[i] = skyline[i] = ofRectangle(0,0,0,0);
    }

	gameField = paddingTop = paddingBottom = 
		ofRectangle(0,0,0,0);

	viewPort = ofGetCurrentViewport();

	// init vertical sync and some graphics
	ofSetVerticalSync(true);
	ofSetCircleResolution(6);
	ofBackground(47, 52, 64);

	// init audio
	soundStream.listDevices();

	fft = ofxFft::create(AUDIO_BUFFER_SIZE, OF_FFT_WINDOW_RECTANGULAR);

	soundStream.setup(this, 0, 2, SAMPLE_RATE, AUDIO_BUFFER_SIZE, 4);
	fftOutput = new float[fft->getBinSize()];

	// seed random
	ofSeedRandom();

	//update config
	readConfig();

	ofLogVerbose() << "setup finished";
}
예제 #23
0
void SimulatorWin::parseCocosProjectConfig(ProjectConfig &config)
{
    // get project directory
    ProjectConfig tmpConfig;
    // load project config from command line args
    vector<string> args;
    for (int i = 0; i < __argc; ++i)
    {
        wstring ws(__wargv[i]);
        string s;
        s.assign(ws.begin(), ws.end());
        args.push_back(s);
    }

    if (args.size() >= 2)
    {
        if (args.size() && args.at(1).at(0) == '/')
        {
            // FIXME:
            // for Code IDE before RC2
            tmpConfig.setProjectDir(args.at(1));
        }

        tmpConfig.parseCommandLine(args);
    }

    // set project directory as search root path
    FileUtils::getInstance()->setDefaultResourceRootPath(tmpConfig.getProjectDir().c_str());

    // parse config.json
    auto parser = ConfigParser::getInstance();
    auto configPath = tmpConfig.getProjectDir().append(CONFIG_FILE);
    parser->readConfig(configPath);

    // set information
    config.setConsolePort(parser->getConsolePort());
    config.setFileUploadPort(parser->getUploadPort());
    config.setFrameSize(parser->getInitViewSize());
    if (parser->isLanscape())
    {
        config.changeFrameOrientationToLandscape();
    }
    else
    {
        config.changeFrameOrientationToPortait();
    }
    config.setScriptFile(parser->getEntryFile());
}
예제 #24
0
int main(int argc, char* argv[]) {
    cout << "Starting Lost Penguins!\n";
    //Clean exit on Windows close...
    atexit(SDL_Quit);

    cout << "Loading configuration file...\n";
    //Maybe: add some more location checks...
    if (readConfig("/usr/local/etc/lost_penguins.conf")) cout << "Loaded /usr/local/etc/lost_penguins.conf...\n";
    else cout << "Configuration files not found! Set default parameters...\n";

    parseInput(argc,argv);

    if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_AUDIO)==0) {
        cout << "Initialized SDL...\n";
    } else {
        cout << "Couldn't initialize SDL!\n";
        exit(-1);
    }
    SDL_ShowCursor(SDL_DISABLE);
    //Change directory to datadir

    cout << "ImageCache...\n";
    imgcache=new ImageCache();
    cout << "SoundCache...\n";
    sndcache=new SoundCache();
    cout << "GraphicsEngine...\n";
    gfxeng=new GraphicsEngine();
    cout << "SoundEngine...\n";
    sfxeng=new SoundsEngine();
    cout << "Fonts...\n";
    font=new Font(imgcache->loadImage(1,"font_arial_white_16_01.png").surface);
    font2=new Font(imgcache->loadImage(1,"font_arial_red_16_01.png").surface);
    cout << "InputHandler...\n";
    input=new InputHandler();
    cout << "Initializing Scenario...\n";
    scenario=new Scenario();

    startScreen();

    while (true) {
        input->update();
        scenario->physic->update();
        gfxeng->draw();
        SDL_Delay(1);
    }

    quitGame(-2);
}
bool ConfigurationReader::readHome(File* file, char* fileContentBuffer, Actor* actor, Configuration* config) {
	if (!readToBuffer(file, fileContentBuffer)) {
		return false;
	}
	//DiagnosticOutputStream.sendln(fileContentBuffer);
	StaticJsonBuffer<READ_FILE_BUFFOR_SIZE> jsonBuffer;
	JsonObject& root = jsonBuffer.parseObject(fileContentBuffer);

	if (!root.success()) {
	  DiagnosticOutputStream.sendln("Config parse failed");
	  return false;
	}
	readConfig(root, config);
	JsonArray& jsonRooms = root[JSON_HOME][JSON_ROOMS].asArray();
	readRooms(jsonRooms, actor);
}
예제 #26
0
AddressBookPluginWidget::AddressBookPluginWidget( QWidget *parent,  const char* name )
    : QWidget( parent, name )
{
    addressLabel = 0l;
    m_contactdb = 0l;
    layoutTodo = 0l;

    m_contactdb = new Opie::OPimContactAccess("addressplugin");
    m_contactdb->load();

    connect( m_contactdb, SIGNAL( signalChanged(const Opie::OPimContactAccess*) ),
             this, SLOT( refresh(const Opie::OPimContactAccess*) ) );

    readConfig();
    getAddress();
}
예제 #27
0
NetworkDialog::NetworkDialog(QWidget *parent)
    : QDialog(parent)
{
    ui.setupUi(this);

#if !USE_TUIO
    ui.labelUDPPort->setVisible(false);
    ui.comboBoxUDPPort->setVisible(false);
#endif

    // The contents of the combo boxes is only updated if the combo box
    // has the keyboard focus. Update manually.
    connect(this, SIGNAL(accepted()), this, SLOT(onAccepted()));

    readConfig();
}
예제 #28
0
QtPhoneSettings::QtPhoneSettings(CWengoPhone & cWengoPhone, QWidget * parent)
	: QWidget(parent),
	_cWengoPhone(cWengoPhone){

	_ui = new Ui::PhoneSettings();
	_ui->setupUi(this);

	_jsAction = "";

	SAFE_CONNECT(_ui->webView, SIGNAL(loadFinished(bool)), SLOT(documentCompleteSlot(bool)));

	SAFE_CONNECT(_ui->lblContactManager, SIGNAL(linkActivated(const QString &)), SLOT(linkSlot()));


	readConfig();
}
예제 #29
0
void init(void)
{
	char*				filename;
#ifdef _ASPELL_
	AspellCanHaveError*	possible_err;
#endif
	lineWrap=true;
	highLight=true;
	useUnderline=true;

	tabWidth=4;
	fontAndSize=strdup("mono 10");
	terminalCommand=strdup("xterm -e");
	windowWidth=800;
	windowHeight=400;
	windowX=-1;
	windowY=-1;
	wrapSearch=true;
	insensitiveSearch=true;
	replaceAll=false;
	showLiveSearch=true;
	gzipPages=false;

	asprintf(&filename,"%s/.ManPageEditor",getenv("HOME"));
	g_mkdir_with_parents(filename,493);
	g_free(filename);

	readConfig();

	tmpGzipPages=gzipPages;
	tmpHighLight=highLight;
	tmpLineWrap=lineWrap;
	tmpTabWidth=tabWidth;
	tmpUseUnderline=useUnderline;
	tmpShowLiveSearch=showLiveSearch;

#ifdef _ASPELL_
	aspellConfig=new_aspell_config();
	possible_err=new_aspell_speller(aspellConfig);

	if(aspell_error_number(possible_err)!= 0)
		puts(aspell_error_message(possible_err));
	else
		spellChecker=to_aspell_speller(possible_err);
#endif

}
예제 #30
0
void GameStateConfigDesktop::init() {
	VIDEO_TAB = 0;
	AUDIO_TAB = 1;
	INTERFACE_TAB = 2;
	INPUT_TAB = 3;
	KEYBINDS_TAB = 4;
	MODS_TAB = 5;

	tab_control->setTabTitle(VIDEO_TAB, msg->get("Video"));
	tab_control->setTabTitle(AUDIO_TAB, msg->get("Audio"));
	tab_control->setTabTitle(INTERFACE_TAB, msg->get("Interface"));
	tab_control->setTabTitle(INPUT_TAB, msg->get("Input"));
	tab_control->setTabTitle(KEYBINDS_TAB, msg->get("Keybindings"));
	tab_control->setTabTitle(MODS_TAB, msg->get("Mods"));
	tab_control->updateHeader();

	readConfig();

	// Allocate KeyBindings ScrollBox
	input_scrollbox = new WidgetScrollBox(scrollpane.w, scrollpane.h);
	input_scrollbox->setBasePos(scrollpane.x, scrollpane.y);
	input_scrollbox->bg.r = scrollpane_color.r;
	input_scrollbox->bg.g = scrollpane_color.g;
	input_scrollbox->bg.b = scrollpane_color.b;
	input_scrollbox->transparent = false;
	input_scrollbox->resize(scrollpane.w, scrollpane_contents);

	// Set positions of secondary key bindings
	for (unsigned int i = key_count; i < key_count*2; i++) {
		keybinds_btn[i]->pos.x = keybinds_btn[i-key_count]->pos.x + secondary_offset.x;
		keybinds_btn[i]->pos.y = keybinds_btn[i-key_count]->pos.y + secondary_offset.y;
	}

	// Set positions of joystick bindings
	for (unsigned int i = key_count*2; i < keybinds_btn.size(); i++) {
		keybinds_btn[i]->pos.x = keybinds_btn[i-(key_count*2)]->pos.x + (secondary_offset.x*2);
		keybinds_btn[i]->pos.y = keybinds_btn[i-(key_count*2)]->pos.y + (secondary_offset.y*2);
	}

	addChildWidgets();
	addChildWidgetsDesktop();
	setupTabList();

	refreshWidgets();

	update();
}