コード例 #1
0
KstEqDialog::KstEqDialog(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : KstDataDialog(parent) {
printf("eqd0\n");
  _w = new Ui::EqDialogWidget();
printf("eqd1\n");
  _w->setupUi(_contents);

  setMultiple(true);

  connect(_w->_vectors, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_xVectors, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_scalars, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));

  //
  // connections for edit multiple mode...
  //

  connect(_w->_doInterpolation, SIGNAL(clicked()), this, SLOT(setDoInterpolationDirty()));
  populateFunctionList();

  // 
  // connections for apply button...
  //

  connect(_w->_equation, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xVectors, SIGNAL(selectionChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xVectors, SIGNAL(selectionChangedLabel(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_doInterpolation, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_curveAppearance, SIGNAL(changed()), this, SLOT(wasModifiedApply()));
}
コード例 #2
0
KstEqDialogI::KstEqDialogI(QWidget* parent, const char* name, bool modal, WFlags fl)
: KstDataDialog(parent, name, modal, fl) {
  _w = new EqDialogWidget(_contents);
  setMultiple(true);
  connect(_w->_vectors, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_xVectors, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_scalars, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
  
  // for edit multiple mode
  connect(_w->_doInterpolation, SIGNAL(clicked()), this, SLOT(setDoInterpolationDirty()));
  populateFunctionList();
}
コード例 #3
0
void KstPluginDialogI::generateEntries(bool input, int& cnt, QWidget *parent, QGridLayout *grid, const QValueList<Plugin::Data::IOValue>& table) {
QString scalarLabelTemplate, vectorLabelTemplate;

  if (input) {
    scalarLabelTemplate = i18n("Input Scalar - %1:");
    vectorLabelTemplate = i18n("Input Vector - %1:");
  } else {
    scalarLabelTemplate = i18n("Output Scalar - %1:");
    vectorLabelTemplate = i18n("Output Vector - %1:");
  }

  for (QValueList<Plugin::Data::IOValue>::ConstIterator it = table.begin(); it != table.end(); ++it) {
    QString labellabel;
    bool scalar = false;
    switch ((*it)._type) {
      case Plugin::Data::IOValue::FloatType:
        labellabel = scalarLabelTemplate.arg((*it)._name);
        scalar = true;
        break;
      case Plugin::Data::IOValue::TableType:
        if ((*it)._subType == Plugin::Data::IOValue::FloatSubType) {
          labellabel = vectorLabelTemplate.arg((*it)._name);
        } else {
          // unsupported
          continue;
        }
        break;
      default:
        // unsupported
        continue;
    }

    QLabel *label = new QLabel(labellabel, parent, input ? "Input label" : "Output label");

    QWidget *widget = 0L;

    if (input) {
      if (scalar) {
        ScalarSelector *w = new ScalarSelector(parent, (*it)._name.latin1());
        widget = w;
        connect(w->_scalar, SIGNAL(activated(const QString&)), this, SLOT(updateScalarTooltip(const QString&)));
        connect(widget, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
        KstScalarPtr p = *KST::scalarList.findTag(w->_scalar->currentText());
        if (p) {
          QToolTip::add(w->_scalar, QString::number(p->value()));
        }
      } else {
        widget = new VectorSelector(parent, (*it)._name.latin1());
        connect(widget, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
      }
    } else {
コード例 #4
0
void KstBasicDialogI::createInputScalar(const QString &name, int row) {
  QLabel *label = new QLabel(name + ":", _w->_frame);

  ScalarSelector *widget = new ScalarSelector(_w->_frame,
                                              name.latin1());
  connect(widget, SIGNAL(newScalarCreated()),
          this, SIGNAL(modified()));
  widget->allowDirectEntry(true);

  _grid->addWidget(label, row, 0);
  label->show();
  _grid->addWidget(widget, row, 1);
  widget->show();
}
コード例 #5
0
KstEventMonitorI::KstEventMonitorI(QWidget* parent,
                                           const char* name,
                                           bool modal,
                                           WFlags fl) :
  EventMonitor(parent, name, modal, fl) {
  QStringList	labels;

  _bSetWidths = FALSE;
  
  labels.append(i18n("Log as:"));
  labels.append(i18n("Expression:"));
  labels.append(i18n("Description:"));
  
  tableEvents = new KstEventTable( this, "tableEvents" );
  tableEvents->setNumRows( 0 );
  tableEvents->setNumCols( 3 );
  tableEvents->setReadOnly( TRUE );
  tableEvents->setSorting( FALSE );     
  tableEvents->setRowMovingEnabled( FALSE );
  tableEvents->setColumnLabels( labels );
  tableEvents->setSelectionMode( QTable::SingleRow );
  tableEvents->setEventMonitors( &_eventMonitors );
  layoutGrid->addWidget( tableEvents, 1, 0 );

  connect(vectorSelector, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(vectorSelectorEq, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect( scalarSelectorEq, SIGNAL( newScalarCreated() ), this, SIGNAL(modified()));
  connect( buttonGroupLog, SIGNAL( clicked(int) ), this, SLOT( logChanged(int) ) );
  connect( checkBoxDebug, SIGNAL(clicked()), this, SLOT(logCheckChanged()));
  connect( Close, SIGNAL( clicked() ), this, SLOT( close() ) );
  connect( pushButtonAdd, SIGNAL( clicked() ), this, SLOT( addEvent() ) );
  connect( pushButtonDelete, SIGNAL( clicked() ), this, SLOT( deleteEvent() ) );
  connect( pushButtonAccept, SIGNAL( clicked() ), this, SLOT( acceptChanges() ) );
  connect( pushButtonDiscard, SIGNAL( clicked() ), this, SLOT( discardChanges() ) );
  connect( lineEditEquation, SIGNAL( textChanged(const QString&) ), this, SLOT( expressionChanged(const QString&) ) );
  connect( lineEditDescription, SIGNAL( textChanged(const QString&) ), this, SLOT( descriptionChanged(const QString&) ) );
  connect( tableEvents, SIGNAL( currentChanged(int, int) ), this, SLOT( changedEvent(int, int) ) );
  connect( tableEvents, SIGNAL( selectionChanged() ), this, SLOT( changedSelection() ) );
  connect( vectorSelector, SIGNAL( selectionChanged(const QString&) ), this, SLOT( vectorChanged(const QString&) ) );
  connect( vectorSelector, SIGNAL( newVectorCreated(const QString&) ), this, SLOT( vectorChanged(const QString&) ) );
  connect( vectorSelectorEq, SIGNAL( selectionChangedLabel(const QString&)), lineEditEquation, SLOT( insert(const QString&) ) );
  connect( scalarSelectorEq, SIGNAL( selectionChangedLabel(const QString&)), lineEditEquation, SLOT( insert(const QString&) ) );
  connect( pushButtonApply, SIGNAL( clicked() ), this, SLOT( apply() ) );
    
  languageChange( );
  
  setChanged( FALSE );
}
コード例 #6
0
KstEventMonitorI::KstEventMonitorI(QWidget* parent, const char* name, bool modal, WFlags fl)
: KstDataDialog(parent, name, modal, fl) {
  _w = new EventMonitorWidget(_contents);
  setMultiple(true);
  connect(_w->_vectorSelectorEq, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_scalarSelectorEq, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
  connect(_w->_vectorSelectorEq, SIGNAL(selectionChangedLabel(const QString&)), _w->lineEditEquation, SLOT(insert(const QString&)));
  connect(_w->_vectorSelectorEq, SIGNAL(selectionChangedLabel(const QString&)), _w->lineEditEquation, SLOT(setFocus()));
  connect(_w->_scalarSelectorEq, SIGNAL(selectionChangedLabel(const QString&)), _w->lineEditEquation, SLOT(insert(const QString&)));
  connect(_w->_scalarSelectorEq, SIGNAL(selectionChangedLabel(const QString&)), _w->lineEditEquation, SLOT(setFocus()));
  connect(_w->_pushButtonELOGConfigure, SIGNAL(clicked()), KstApp::inst(), SLOT(EventELOGConfigure()));
  
  // more multiple edit mode
  connect(_w->checkBoxDebug, SIGNAL(clicked()), this, SLOT(setcheckBoxDebugDirty()));
  connect(_w->checkBoxEMailNotify, SIGNAL(clicked()), this, SLOT(setcheckBoxEMailNotifyDirty()));
  connect(_w->checkBoxELOGNotify, SIGNAL(clicked()), this, SLOT(setcheckBoxELOGNotifyDirty()));
  connect(_w->_useScript, SIGNAL(clicked()), this, SLOT(setScriptDirty()));
  connect(_w->_script, SIGNAL(textChanged()), this, SLOT(setScriptDirty()));

  setFixedHeight(height());
}
コード例 #7
0
void KstPluginDialogI::generateEntries(bool input, int& cnt, QWidget *parent, QGridLayout *grid, const QValueList<Plugin::Data::IOValue>& table) {
    QString scalarLabelTemplate, vectorLabelTemplate, stringLabelTemplate;

    if (input) {
        stringLabelTemplate = i18n("Input string - %1:");
        scalarLabelTemplate = i18n("Input scalar - %1:");
        vectorLabelTemplate = i18n("Input vector - %1:");
    } else {
        stringLabelTemplate = i18n("Output string - %1:");
        scalarLabelTemplate = i18n("Output scalar - %1:");
        vectorLabelTemplate = i18n("Output vector - %1:");
    }

    for (QValueList<Plugin::Data::IOValue>::ConstIterator it = table.begin(); it != table.end(); ++it) {
        QString labellabel;
        bool scalar = false;
        bool string = false;
        switch ((*it)._type) {
        case Plugin::Data::IOValue::PidType:
            continue;
        case Plugin::Data::IOValue::StringType:
            labellabel = stringLabelTemplate.arg((*it)._name);
            string = true;
            break;
        case Plugin::Data::IOValue::FloatType:
            labellabel = scalarLabelTemplate.arg((*it)._name);
            scalar = true;
            break;
        case Plugin::Data::IOValue::TableType:
            if ((*it)._subType == Plugin::Data::IOValue::FloatSubType ||
                    (*it)._subType == Plugin::Data::IOValue::FloatNonVectorSubType) {
                labellabel = vectorLabelTemplate.arg((*it)._name);
            } else {
                // unsupported
                continue;
            }
            break;
        default:
            // unsupported
            continue;
        }

        QLabel *label = new QLabel(labellabel, parent, input ? "Input label" : "Output label");

        QWidget *widget = 0L;

        if (input) {
            if (scalar) {
                ScalarSelector *w = new ScalarSelector(parent, (*it)._name.latin1());
                widget = w;
                connect(w->_scalar, SIGNAL(activated(const QString&)), this, SLOT(updateScalarTooltip(const QString&)));
                connect(widget, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
                if (!(*it)._default.isEmpty()) {
                    w->_scalar->insertItem((*it)._default);
                    w->_scalar->setCurrentText((*it)._default);
                }
                KstScalarPtr p = *KST::scalarList.findTag(w->_scalar->currentText());
                w->allowDirectEntry(true);
                if (p) {
                    p->readLock();
                    QToolTip::remove(w->_scalar);
                    QToolTip::add(w->_scalar, QString::number(p->value()));
                    p->unlock();
                }
            } else if (string) {
                StringSelector *w = new StringSelector(parent, (*it)._name.latin1());
                widget = w;
                connect(w->_string, SIGNAL(activated(const QString&)), this, SLOT(updateStringTooltip(const QString&)));
                connect(widget, SIGNAL(newStringCreated()), this, SIGNAL(modified()));
                if (!(*it)._default.isEmpty()) {
                    w->_string->insertItem((*it)._default);
                    w->_string->setCurrentText((*it)._default);
                }
                KstStringPtr p = *KST::stringList.findTag(w->_string->currentText());
                w->allowDirectEntry(true);
                if (p) {
                    p->readLock();
                    QToolTip::remove(w->_string);
                    QToolTip::add(w->_string, p->value());
                    p->unlock();
                }
            } else {
                widget = new VectorSelector(parent, (*it)._name.latin1());
                connect(widget, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
            }
        } else {
コード例 #8
0
KstVvDialogI::KstVvDialogI(QWidget* parent, const char* name, bool modal, WFlags fl)
: KstDataDialog(parent, name, modal, fl) {
  _w = new VectorViewDialogWidget(_contents);
  setMultiple(true);

  connect(_w->_xVector, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_yVector, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_FlagVector, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(_w->_xMinScalar, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
  connect(_w->_xMaxScalar, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
  connect(_w->_yMinScalar, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
  connect(_w->_yMaxScalar, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));

  _w->_FlagVector->provideNoneVector(true);
  _w->_FlagVector->allowNewVectors(true);

  connect(_w->_xMinCheckbox, SIGNAL(clicked()), this, SLOT(updateButtons()));
  connect(_w->_xMaxCheckbox, SIGNAL(clicked()), this, SLOT(updateButtons()));
  connect(_w->_yMinCheckbox, SIGNAL(clicked()), this, SLOT(updateButtons()));
  connect(_w->_yMaxCheckbox, SIGNAL(clicked()), this, SLOT(updateButtons()));

  _w->_xMinScalar->allowDirectEntry(true);
  _w->_xMaxScalar->allowDirectEntry(true);
  _w->_yMinScalar->allowDirectEntry(true);
  _w->_yMaxScalar->allowDirectEntry(true);

  connect(_w->_realtimeButton, SIGNAL(clicked()), this, SLOT(realtimeClicked()));
  connect(_w->_currentButton, SIGNAL(clicked()), this, SLOT(currentClicked()));

  QColor qc = _w->_curveAppearance->color();
  _w->_curveAppearance->setValue(false, false, true, qc, 0, 0, 0, 1, 0);

  // for multiple edit mode
  connect(_w->_xMinCheckbox, SIGNAL(clicked()), this, SLOT(xMinCheckboxClicked()));
  connect(_w->_xMaxCheckbox, SIGNAL(clicked()), this, SLOT(xMaxCheckboxClicked()));
  connect(_w->_yMinCheckbox, SIGNAL(clicked()), this, SLOT(yMinCheckboxClicked()));
  connect(_w->_yMaxCheckbox, SIGNAL(clicked()), this, SLOT(yMaxCheckboxClicked()));

  // for apply button
  connect(_w->_xVector, SIGNAL(selectionChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xVector, SIGNAL(selectionChangedLabel(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xVector->_vector, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yVector, SIGNAL(selectionChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yVector, SIGNAL(selectionChangedLabel(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yVector->_vector, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_interp, SIGNAL(highlighted(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_xMinCheckbox, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_xMinScalar, SIGNAL(selectionChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xMinScalar, SIGNAL(selectionChangedLabel(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xMinScalar->_scalar, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xMaxCheckbox, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_xMaxScalar, SIGNAL(selectionChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xMaxScalar, SIGNAL(selectionChangedLabel(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xMaxScalar->_scalar, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yMinCheckbox, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_yMinScalar, SIGNAL(selectionChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yMinScalar, SIGNAL(selectionChangedLabel(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yMinScalar->_scalar, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yMaxCheckbox, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_yMaxScalar, SIGNAL(selectionChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yMaxScalar, SIGNAL(selectionChangedLabel(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yMaxScalar->_scalar, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_plotAxes, SIGNAL(highlighted(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_plotList, SIGNAL(highlighted(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_realtimeButton, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_currentButton, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_FlagVector, SIGNAL(selectionChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_FlagVector, SIGNAL(selectionChangedLabel(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_curveAppearance, SIGNAL(changed()), this, SLOT(wasModifiedApply()));
}