Example #1
0
void TPropertiesMenu::calculate()
{
    BaseMenu::calculate();
    if(currentEvent != MENU_BACK)  return;
    
    Render::t_screen_sizes_list::iterator it = ss->begin();
    for(int i = 0; i < screen_size_->getItem(); ++i)  ++it;
    
    Properties.window_width  = it->width;
    Properties.window_height = it->height;
    
    if(antialiasing_->getItem() == 0)
        Properties.antialiasing = 0;
    else
        Properties.antialiasing = 1 << (antialiasing_->getItem() - 1);
    
    Properties.fog_quality = fog_->getItem() * 2 + 1;
    Properties.lighting_quality = lighting_->getItem();
    Properties.texture_quality = texture_->getItem();
    Properties.view_distance = view_distance_->getValue();
    
    saveProperties();
    
    Render::texturesQuality = (u_int8_t)Properties.texture_quality;
    Render::setLightQuality((u_int8_t)Properties.lighting_quality);
    Render::setViewDistance(Properties.view_distance);
    
    EMIT_EVENT(PropertiesFinishedEvent);  // ==>
    return;
}
Example #2
0
void View::PropertiesDialog::done(int result)
{
    if(result)
        saveProperties();

    QDialog::done(result);
}
Example #3
0
bool
TaskJuggler::queryExit()
{
    m_view->quit(false);
    saveProperties(kapp->config());
    return true;
}
Example #4
0
void XMLWriter::putChildQObjectItem(QString name, QObject *item, QDomElement *parentNode)
{   
    QDomElement itemNode = m_doc->createElement(name);
    itemNode.setAttribute("ClassName",extractClassName(item));
    itemNode.setAttribute("Type","Object");
    if (parentNode) parentNode->appendChild(itemNode);
    saveProperties(item,&itemNode);
}
Example #5
0
QDomElement KivioBaseTargetStencil::saveXML( QDomDocument &doc )
{
    QDomElement e = createRootElement( doc );

    e.appendChild( saveProperties(doc) );

    return e;
}
Example #6
0
QDomElement XMLWriter::putQObjectItem(QString name, QObject *item)
{
    Q_UNUSED(name)
    QDomElement itemNode = m_doc->createElement("object");
    itemNode.setAttribute("ClassName",extractClassName(item));
    itemNode.setAttribute("Type","Object");
    saveProperties(item,&itemNode);
    return itemNode;
}
Example #7
0
void FileSettings::widgetsChangedSlot()
{
    File *file = m_fileView != NULL && m_fileView->fileModel() != NULL ? m_fileView->fileModel()->bibliographyFile() : NULL;
    if (file != NULL) {
        saveProperties(file);
        /// Notify main view about change it its data
        m_fileView->externalModification();
    }
}
Example #8
0
void 
TopLevel::quitSlot()
{
	saveProperties(Kapp->getConfig());

	taskman->saveSettings();

	Kapp->getConfig()->sync();
	qApp->quit();
}
Example #9
0
bool TopLevel::queryClose()
{
  if ( !mWorkSpace->saveOnQuit() )
    return false;

  KConfigGroup cg( KSharedConfig::openConfig(), "MainWindow" );
  saveProperties( cg );
  KSharedConfig::openConfig()->sync();

  return true;
}
Example #10
0
File: main.C Project: xwizard/kde1
void TEDemo::opt_menu_activated(int item)
{
  switch( item )
  {
    case 1: setMenuVisible(!b_menuvis);
            if (!b_menuvis)
            {
              setCaption("Use the right mouse button to bring back the menu");
              QTimer::singleShot(5000,this,SLOT(setHeader()));
            }
            break;
    case 2: setFrameVisible(!b_framevis);
            break;
    case 4: setBsHack(!b_bshack);
            break;
    case 8: saveProperties(kapp->getConfig());
            break;
  }
}
Example #11
0
void KstGraphFileDialog::apply_I() {
// xxx  _url = _saveLocation->url();
  _format = _comboBoxFormats->currentText();
  _w = _xSize->value();
  _h = _ySize->value();
  _displayOption = _comboBoxSizeOption->currentIndex();
  _allWindows = _radioButtonAll->isChecked();
  _autoSave = _autosave->isChecked();
  _savePeriod = _period->value();
  _saveEPSAsVector = _saveEPSVector->isChecked();
  applyAutosave();

  if (!_autoSave) {
    if (_format == "EPS" && _saveEPSAsVector) {
      reqEpsGraphFile();
    } else {
      reqGraphFile();
    }
  }
  saveProperties();
}
Example #12
0
File: main.c Project: dl3yc/gHermes
/* ----------------------------------------------------------------------------*/
void quit() {
    // save state
    mainSaveState();
    vfoSaveState();
    bandSaveState();
    modeSaveState();
    displaySaveState();
    filterSaveState();
    audioSaveState();
    agcSaveState();
    receiverSaveState();
    volumeSaveState();
    ozySaveState();
    transmitSaveState();
    subrxSaveState();
    keyerSaveState();

    saveProperties(propertyPath);

    exit(0);
}
void DebuggerManager::slotHandleEvent( const QString & event, const QString &, const QString & )
{
  if(event == "before_project_close")
    saveProperties();
}
Example #14
0
void CervisiaShell::writeSettings()
{
    KConfigGroup cg(KSharedConfig::openConfig(), "Session");
    saveProperties(cg);
}
Example #15
0
// ######################################################################
void Logger::run(nub::soft_ref<MbariResultViewer> rv, MbariImage<PixRGB <byte> >& img,
                                        MbariVisualEvent::VisualEventSet& eventSet, const Dims scaledDims)
{
    // adjust scaling if needed
    Dims d = img.getDims();
    itsScaleW = (float)d.w()/(float)scaledDims.w();
    itsScaleH = (float)d.h()/(float)scaledDims.h();

    // initialize property vector and FOE estimator
    MbariVisualEvent::PropertyVectorSet pvs;

    // this is a list of all the events that have a token in this frame
    std::list<MbariVisualEvent::VisualEvent *> eventFrameList;

    // this is a complete list of all those events that are ready to be written
    std::list<MbariVisualEvent::VisualEvent *> eventListToSave;

    // get event frame list for this frame and those events that are ready to be saved
    // this is a list of all the events that have a token in this frame
    eventFrameList = eventSet.getEventsForFrame(img.getFrameNum());

    // this is a complete list of all those events that are ready to be written
    eventListToSave = eventSet.getEventsReadyToSave(img.getFrameNum());

    // write out eventSet?
    if (itsSaveEventsName.getVal().length() > 0 ) saveVisualEvent(eventSet, eventFrameList);

    // write out summary ?
    if (itsSaveSummaryEventsName.getVal().length() > 0) saveVisualEventSummary(Version::versionString(), eventListToSave);

    // flag events that have been saved for delete
    std::list<MbariVisualEvent::VisualEvent *>::iterator i;
    for (i = eventListToSave.begin(); i != eventListToSave.end(); ++i)
        (*i)->flagWriteComplete();

    // write out positions?
    if (itsSavePositionsName.getVal().length() > 0) savePositions(eventFrameList);

    MbariVisualEvent::PropertyVectorSet pvsToSave = eventSet.getPropertyVectorSetToSave();

    // write out property vector set?
    if (itsSavePropertiesName.getVal().length() > 0) saveProperties(pvsToSave);

    // TODO: this is currently not used...look back in history to where this got cut-out
    // need to obtain the property vector set?
    if (itsLoadPropertiesName.getVal().length() > 0) pvs = eventSet.getPropertyVectorSet();

    // get a list of events for this frame
    eventFrameList = eventSet.getEventsForFrame(img.getFrameNum());

    // write out eventSet to XML?
    if (itsSaveXMLEventSetName.getVal().length() > 0) {
        saveVisualEventSetToXML(eventFrameList,
                img.getFrameNum(),
                img.getMetaData().getTC(),
                itsFrameRange);
    }

    const int circleRadiusRatio = 40;
    const int circleRadius = img.getDims().w() / circleRadiusRatio;

    Image< PixRGB<byte> > output = rv->createOutput(img,
            eventSet,
            circleRadius,
            itsScaleW, itsScaleH);

    // write  ?
    if (itsSaveOutput.getVal())
        itsOfs->writeFrame(GenericFrame(output), "results", FrameInfo("results", SRC_POS));

    // display output ?
    rv->display(output, img.getFrameNum(), "Results");

    // need to save any event clips?
    if (itsSaveEventNumsAll) {
        //save all events
        std::list<MbariVisualEvent::VisualEvent *>::iterator i;
        for (i = eventFrameList.begin(); i != eventFrameList.end(); ++i)
            saveSingleEventFrame(img, img.getFrameNum(), *i);
    } else {
        // need to save any particular event clips?
        uint csavenum = numSaveEventClips();
        for (uint idx = 0; idx < csavenum; ++idx) {
            uint evnum = getSaveEventClipNum(idx);
            if (!eventSet.doesEventExist(evnum)) continue;

            MbariVisualEvent::VisualEvent *event = eventSet.getEventByNumber(evnum);
            if (event->frameInRange(img.getFrameNum()))
                saveSingleEventFrame(img, img.getFrameNum(), event);
        }
    }

    //flag events that have been saved for delete otherwise takes too much memory
    for (i = eventListToSave.begin(); i != eventListToSave.end(); ++i)
        (*i)->flagForDelete();
    while (!eventFrameList.empty()) eventFrameList.pop_front();
    while (!eventListToSave.empty()) eventListToSave.pop_front();

}
Example #16
0
File: gpio.c Project: g0orx/pihpsdr
void gpio_save_state() {
   char value[80];

  sprintf(value,"%d",ENABLE_VFO_ENCODER);
  setProperty("ENABLE_VFO_ENCODER",value);
  sprintf(value,"%d",ENABLE_VFO_PULLUP);
  setProperty("ENABLE_VFO_PULLUP",value);
  sprintf(value,"%d",VFO_ENCODER_A);
  setProperty("VFO_ENCODER_A",value);
  sprintf(value,"%d",VFO_ENCODER_B);
  setProperty("VFO_ENCODER_B",value);
#ifdef odroid
  sprintf(value,"%d",VFO_ENCODER_A_PIN);
  setProperty("VFO_ENCODER_A_PIN",value);
  sprintf(value,"%d",VFO_ENCODER_B_PIN);
  setProperty("VFO_ENCODER_B_PIN",value);
#endif
  sprintf(value,"%d",ENABLE_AF_ENCODER);
  setProperty("ENABLE_AF_ENCODER",value);
  sprintf(value,"%d",ENABLE_AF_PULLUP);
  setProperty("ENABLE_AF_PULLUP",value);
  sprintf(value,"%d",AF_ENCODER_A);
  setProperty("AF_ENCODER_A",value);
  sprintf(value,"%d",AF_ENCODER_B);
  setProperty("AF_ENCODER_B",value);
  sprintf(value,"%d",ENABLE_RF_ENCODER);
  setProperty("ENABLE_RF_ENCODER",value);
  sprintf(value,"%d",ENABLE_RF_PULLUP);
  setProperty("ENABLE_RF_PULLUP",value);
  sprintf(value,"%d",RF_ENCODER_A);
  setProperty("RF_ENCODER_A",value);
  sprintf(value,"%d",RF_ENCODER_B);
  setProperty("RF_ENCODER_B",value);
  sprintf(value,"%d",ENABLE_AGC_ENCODER);
  setProperty("ENABLE_AGC_ENCODER",value);
  sprintf(value,"%d",ENABLE_AGC_PULLUP);
  setProperty("ENABLE_AGC_PULLUP",value);
  sprintf(value,"%d",AGC_ENCODER_A);
  setProperty("AGC_ENCODER_A",value);
  sprintf(value,"%d",AGC_ENCODER_B);
  setProperty("AGC_ENCODER_B",value);
  sprintf(value,"%d",ENABLE_BAND_BUTTON);
  setProperty("ENABLE_BAND_BUTTON",value);
  sprintf(value,"%d",BAND_BUTTON);
  setProperty("BAND_BUTTON",value);
  sprintf(value,"%d",ENABLE_BANDSTACK_BUTTON);
  setProperty("ENABLE_BANDSTACK_BUTTON",value);
  sprintf(value,"%d",BANDSTACK_BUTTON);
  setProperty("BANDSTACK_BUTTON",value);
  sprintf(value,"%d",ENABLE_MODE_BUTTON);
  setProperty("ENABLE_MODE_BUTTON",value);
  sprintf(value,"%d",MODE_BUTTON);
  setProperty("MODE_BUTTON",value);
  sprintf(value,"%d",ENABLE_FILTER_BUTTON);
  setProperty("ENABLE_FILTER_BUTTON",value);
  sprintf(value,"%d",FILTER_BUTTON);
  setProperty("FILTER_BUTTON",value);
  sprintf(value,"%d",ENABLE_NOISE_BUTTON);
  setProperty("ENABLE_NOISE_BUTTON",value);
  sprintf(value,"%d",NOISE_BUTTON);
  setProperty("NOISE_BUTTON",value);
  sprintf(value,"%d",ENABLE_AGC_BUTTON);
  setProperty("ENABLE_AGC_BUTTON",value);
  sprintf(value,"%d",AGC_BUTTON);
  setProperty("AGC_BUTTON",value);
  sprintf(value,"%d",ENABLE_FUNCTION_BUTTON);
  setProperty("ENABLE_FUNCTION_BUTTON",value);
  sprintf(value,"%d",FUNCTION_BUTTON);
  setProperty("FUNCTION_BUTTON",value);
  sprintf(value,"%d",ENABLE_MOX_BUTTON);
  setProperty("ENABLE_MOX_BUTTON",value);
  sprintf(value,"%d",MOX_BUTTON);
  setProperty("MOX_BUTTON",value);
  sprintf(value,"%d",ENABLE_LOCK_BUTTON);
  setProperty("ENABLE_LOCK_BUTTON",value);
  sprintf(value,"%d",LOCK_BUTTON);
  setProperty("LOCK_BUTTON",value);

  saveProperties("gpio.props");
}
Example #17
0
void KstCurveDifferentiateI::apply() {
  KstApp *app = KstApp::inst();
  KstViewWindow *window;
  int maxSequences = 0;
  
  getOptions();
  saveProperties();
  
  _seqVect.clear();
  _seqVect.resize(4);
  
  if (_lineColorOrder > -1) {
    _lineColorSeq.setRange(0, KstColorSequence::count());
    _seqVect.insert(_lineColorOrder, &_lineColorSeq);
    maxSequences++;
  }
  if (_pointStyleOrder > -1) {
    _pointStyleSeq.setRange(0, KSTPOINT_MAXTYPE - 1);
    _seqVect.insert(_pointStyleOrder, &_pointStyleSeq);
    maxSequences++;
  }
  if (_lineStyleOrder > -1) {
    _lineStyleSeq.setRange(0, KSTLINESTYLE_MAXTYPE - 1);
    _seqVect.insert(_lineStyleOrder, &_lineStyleSeq);
    maxSequences++;
  }
  if (_lineWidthOrder > -1) {
    _lineWidthSeq.setRange(1, KSTLINEWIDTH_MAX);
    _seqVect.insert(_lineWidthOrder, &_lineWidthSeq);
    maxSequences++;
  }
  
  if (maxSequences > 0) {
    int i;
    
    _seqVect.resize(maxSequences);
    for (i = 0; i < maxSequences-1; i++) {
      _seqVect[i]->hookToNextSequence(_seqVect[i+1]);
    }
    _seqVect[maxSequences-1]->hookToNextSequence(0L);
        
    if (_applyTo == 0) {
      window = dynamic_cast<KstViewWindow*>(app->activeWindow());
      
      if (window) {
        cycleWindow(window);
      }
    } else {
      KMdiIterator<KMdiChildView*> *it = app->createIterator();
      
      if (it) {
        while (it->currentItem()) {
          if (_repeatAcross == 1) {
            _seqVect[0]->reset();
          }

          window = dynamic_cast<KstViewWindow*>(it->currentItem());
          if (window && !window->view()->children().isEmpty()) {
            cycleWindow(window);
          }
          it->next();
        }
        app->deleteIterator(it);
      }
    }
  }

  close();
}
Example #18
0
void cleanGame()
{
    saveProperties();
    delete currentPhase;
    return;
}
Example #19
0
KJotsMain::~KJotsMain()
{
  saveProperties( (KConfig *) 0 );
}
Example #20
0
void UIMain::closeEvent( QCloseEvent* event )
{
    saveProperties();

    QMainWindow::closeEvent( event );
}
void CervisiaShell::writeSettings()
{
    KConfigGroup cg( KGlobal::config(), "Session");
    saveProperties(cg);
}
Example #22
0
void radioSaveState() {
    char value[80];

    sem_wait(&property_sem);
    sprintf(value,"%d",atlas_penelope);
    setProperty("atlas_penelope",value);
    sprintf(value,"%d",sample_rate);
    setProperty("sample_rate",value);
    sprintf(value,"%d",filter_board);
    setProperty("filter_board",value);
    sprintf(value,"%d",apollo_tuner);
    setProperty("apollo_tuner",value);
    sprintf(value,"%d",pa);
    setProperty("pa",value);
    sprintf(value,"%d",updates_per_second);
    setProperty("updates_per_second",value);
    sprintf(value,"%d",display_panadapter);
    setProperty("display_panadapter",value);
    sprintf(value,"%d",display_detector_mode);
    setProperty("display_detector_mode",value);
    sprintf(value,"%d",display_average_mode);
    setProperty("display_average_mode",value);
    sprintf(value,"%f",display_average_time);
    setProperty("display_average_time",value);
    sprintf(value,"%d",panadapter_high);
    setProperty("panadapter_high",value);
    sprintf(value,"%d",panadapter_low);
    setProperty("panadapter_low",value);
    sprintf(value,"%d",display_waterfall);
    setProperty("display_waterfall",value);
    sprintf(value,"%d",display_sliders);
    setProperty("display_sliders",value);
    sprintf(value,"%d",display_toolbar);
    setProperty("display_toolbar",value);
    sprintf(value,"%d",toolbar_simulate_buttons);
    setProperty("toolbar_simulate_buttons",value);
    sprintf(value,"%d",waterfall_high);
    setProperty("waterfall_high",value);
    sprintf(value,"%d",waterfall_low);
    setProperty("waterfall_low",value);
    sprintf(value,"%d",waterfall_automatic);
    setProperty("waterfall_automatic",value);
    sprintf(value,"%f",volume);
    setProperty("volume",value);
    sprintf(value,"%f",mic_gain);
    setProperty("mic_gain",value);
    sprintf(value,"%d",drive);
    setProperty("drive",value);
    sprintf(value,"%d",tune_drive);
    setProperty("tune_drive",value);
    sprintf(value,"%d",mic_boost);
    setProperty("mic_boost",value);
    sprintf(value,"%d",mic_linein);
    setProperty("mic_linein",value);
    sprintf(value,"%d",mic_ptt_enabled);
    setProperty("mic_ptt_enabled",value);
    sprintf(value,"%d",mic_bias_enabled);
    setProperty("mic_bias_enabled",value);
    sprintf(value,"%d",mic_ptt_tip_bias_ring);
    setProperty("mic_ptt_tip_bias_ring",value);
    sprintf(value,"%d",nr_none);
    setProperty("nr_none",value);
    sprintf(value,"%d",nr);
    setProperty("nr",value);
    sprintf(value,"%d",nr2);
    setProperty("nr2",value);
    sprintf(value,"%d",nb);
    setProperty("nb",value);
    sprintf(value,"%d",nb2);
    setProperty("nb2",value);
    sprintf(value,"%d",anf);
    setProperty("anf",value);
    sprintf(value,"%d",snb);
    setProperty("snb",value);
    sprintf(value,"%d",nr_agc);
    setProperty("nr_agc",value);
    sprintf(value,"%d",nr2_gain_method);
    setProperty("nr2_gain_method",value);
    sprintf(value,"%d",nr2_npe_method);
    setProperty("nr2_npe_method",value);
    sprintf(value,"%d",nr2_ae);
    setProperty("nr2_ae",value);
    sprintf(value,"%d",agc);
    setProperty("agc",value);
    sprintf(value,"%f",agc_gain);
    setProperty("agc_gain",value);
    sprintf(value,"%d",step);
    setProperty("step",value);
    sprintf(value,"%d",cw_keys_reversed);
    setProperty("cw_keys_reversed",value);
    sprintf(value,"%d",cw_keyer_speed);
    setProperty("cw_keyer_speed",value);
    sprintf(value,"%d",cw_keyer_mode);
    setProperty("cw_keyer_mode",value);
    sprintf(value,"%d",cw_keyer_weight);
    setProperty("cw_keyer_weight",value);
    sprintf(value,"%d",cw_keyer_spacing);
    setProperty("cw_keyer_spacing",value);
    sprintf(value,"%d",cw_keyer_internal);
    setProperty("cw_keyer_internal",value);
    sprintf(value,"%d",cw_keyer_sidetone_volume);
    setProperty("cw_keyer_sidetone_volume",value);
    sprintf(value,"%d",cw_keyer_ptt_delay);
    setProperty("cw_keyer_ptt_delay",value);
    sprintf(value,"%d",cw_keyer_hang_time);
    setProperty("cw_keyer_hang_time",value);
    sprintf(value,"%d",cw_keyer_sidetone_frequency);
    setProperty("cw_keyer_sidetone_frequency",value);
    sprintf(value,"%d",cw_breakin);
    setProperty("cw_breakin",value);
    sprintf(value,"%d",vfo_encoder_divisor);
    setProperty("vfo_encoder_divisor",value);
    sprintf(value,"%d",OCtune);
    setProperty("OCtune",value);
    sprintf(value,"%d",OCfull_tune_time);
    setProperty("OCfull_tune_time",value);
    sprintf(value,"%d",OCmemory_tune_time);
    setProperty("OCmemory_tune_time",value);
    sprintf(value,"%d",attenuation);
    setProperty("attenuation",value);
    sprintf(value,"%d",rx_dither);
    setProperty("rx_dither",value);
    sprintf(value,"%d",rx_random);
    setProperty("rx_random",value);
    sprintf(value,"%d",rx_preamp);
    setProperty("rx_preamp",value);

    bandSaveState();

    saveProperties(property_path);
    sem_post(&property_sem);
}