void RSIDialog::setGUI (Entity *settings) { _settings = settings; // RSI page QWidget *w = new QWidget; QFormLayout *form = new QFormLayout; w->setLayout(form); // color QVariant *set = _settings->get(QString("color")); _rsiColor = new ColorButton(this, QColor(set->toString())); connect(_rsiColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _rsiColor); // period set = _settings->get(QString("period")); _rsiPeriod = new QSpinBox; _rsiPeriod->setRange(1, 999999); _rsiPeriod->setValue(set->toInt()); connect(_rsiPeriod, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Period"), _rsiPeriod); // style set = _settings->get(QString("style")); CurveLineType clt; _rsiStyle = new QComboBox; _rsiStyle->addItems(clt.list()); _rsiStyle->setCurrentIndex(_rsiStyle->findText(set->toString(), Qt::MatchExactly)); connect(_rsiStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Style"), _rsiStyle); // width set = _settings->get(QString("width")); _rsiWidth = new QSpinBox; _rsiWidth->setRange(1, 99); _rsiWidth->setValue(set->toInt()); connect(_rsiWidth, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Width"), _rsiWidth); // show set = _settings->get(QString("rsiShow")); _rsiShow = new QCheckBox; _rsiShow->setChecked(set->toBool()); connect(_rsiShow, SIGNAL(toggled(bool)), this, SLOT(modified())); form->addRow(tr("Show"), _rsiShow); _tabs->addTab(w, QString("RSI")); // MA page w = new QWidget; form = new QFormLayout; w->setLayout(form); // type set = _settings->get(QString("maType")); MAType mat; _maType = new QComboBox; _maType->addItems(mat.list()); _maType->setCurrentIndex(_maType->findText(set->toString(), Qt::MatchExactly)); connect(_maType, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Type"), _maType); // style set = _settings->get(QString("maStyle")); _maStyle = new QComboBox; _maStyle->addItems(clt.list()); _maStyle->setCurrentIndex(_maStyle->findText(set->toString(), Qt::MatchExactly)); connect(_maStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Style"), _maStyle); // width set = _settings->get(QString("maWidth")); _maWidth = new QSpinBox; _maWidth->setRange(1, 99); _maWidth->setValue(set->toInt()); connect(_maWidth, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Width"), _maWidth); // color set = _settings->get(QString("maColor")); _maColor = new ColorButton(this, QColor(set->toString())); connect(_maColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _maColor); // period set = _settings->get(QString("maPeriod")); _maPeriod = new QSpinBox; _maPeriod->setRange(1, 999999); _maPeriod->setValue(set->toInt()); connect(_maPeriod, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Period"), _maPeriod); // show set = _settings->get(QString("maShow")); _maShow = new QCheckBox; _maShow->setChecked(set->toBool()); connect(_maShow, SIGNAL(toggled(bool)), this, SLOT(modified())); form->addRow(tr("Show"), _maShow); _tabs->addTab(w, QString("MA")); // buy marker page w = new QWidget; form = new QFormLayout; w->setLayout(form); // color set = _settings->get(QString("buyMarkerColor")); _ref1Color = new ColorButton(this, QColor(set->toString())); connect(_ref1Color, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _ref1Color); // value set = _settings->get(QString("buyMarkerPrice")); _ref1 = new QDoubleSpinBox; _ref1->setRange(-99999999.0, 99999999.0); _ref1->setValue(set->toDouble()); connect(_ref1, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Value"), _ref1); // show set = _settings->get(QString("buyMarkerShow")); _ref1Show = new QCheckBox; _ref1Show->setChecked(set->toBool()); connect(_ref1Show, SIGNAL(toggled(bool)), this, SLOT(modified())); form->addRow(tr("Show"), _ref1Show); _tabs->addTab(w, tr("Buy Marker")); // REF2 page w = new QWidget; form = new QFormLayout; w->setLayout(form); // color set = _settings->get(QString("sellMarkerColor")); _ref2Color = new ColorButton(this, QColor(set->toString())); connect(_ref2Color, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _ref2Color); // value set = _settings->get(QString("sellMarkerPrice")); _ref2 = new QDoubleSpinBox; _ref2->setRange(-99999999.0, 99999999.0); _ref2->setValue(set->toDouble()); connect(_ref2, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Value"), _ref2); // show set = _settings->get(QString("sellMarkerShow")); _ref2Show = new QCheckBox; _ref2Show->setChecked(set->toBool()); connect(_ref2Show, SIGNAL(toggled(bool)), this, SLOT(modified())); form->addRow(tr("Show"), _ref2Show); _tabs->addTab(w, tr("Sell Marker")); }
void STOCHSDialog::setGUI (Entity *settings) { _settings = settings; // %K page QWidget *w = new QWidget; QFormLayout *form = new QFormLayout; w->setLayout(form); // color QVariant *set = _settings->get(QString("kColor")); _kColor = new ColorButton(this, QColor(set->toString())); connect(_kColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _kColor); // fast period set = _settings->get(QString("fkPeriod")); _fkPeriod = new QSpinBox; _fkPeriod->setRange(1, 999999); _fkPeriod->setValue(set->toInt()); connect(_fkPeriod, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Fast Period"), _fkPeriod); // k period set = _settings->get(QString("kPeriod")); _kPeriod = new QSpinBox; _kPeriod->setRange(1, 999999); _kPeriod->setValue(set->toInt()); connect(_kPeriod, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Period"), _kPeriod); // ma type set = _settings->get(QString("kType")); MAType mat; _kType = new QComboBox; _kType->addItems(mat.list()); _kType->setCurrentIndex(_kType->findText(set->toString(), Qt::MatchExactly)); connect(_kType, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Type"), _kType); // style set = _settings->get(QString("kStyle")); CurveLineType clt; _kStyle = new QComboBox; _kStyle->addItems(clt.list()); _kStyle->setCurrentIndex(_kStyle->findText(set->toString(), Qt::MatchExactly)); connect(_kStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Style"), _kStyle); // width set = _settings->get(QString("kWidth")); _kWidth = new QSpinBox; _kWidth->setRange(1, 99); _kWidth->setValue(set->toInt()); connect(_kWidth, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Width"), _kWidth); _tabs->addTab(w, QString("%K")); // %D page w = new QWidget; form = new QFormLayout; w->setLayout(form); // type set = _settings->get(QString("dType")); _dType = new QComboBox; _dType->addItems(mat.list()); _dType->setCurrentIndex(_dType->findText(set->toString(), Qt::MatchExactly)); connect(_dType, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Type"), _dType); // style set = _settings->get(QString("dStyle")); _dStyle = new QComboBox; _dStyle->addItems(clt.list()); _dStyle->setCurrentIndex(_dStyle->findText(set->toString(), Qt::MatchExactly)); connect(_dStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Style"), _dStyle); // width set = _settings->get(QString("dWidth")); _dWidth = new QSpinBox; _dWidth->setRange(1, 99); _dWidth->setValue(set->toInt()); connect(_dWidth, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Width"), _dWidth); // color set = _settings->get(QString("dColor")); _dColor = new ColorButton(this, QColor(set->toString())); connect(_dColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _dColor); // period set = _settings->get(QString("dPeriod")); _dPeriod = new QSpinBox; _dPeriod->setRange(1, 999999); _dPeriod->setValue(set->toInt()); connect(_dPeriod, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Period"), _dPeriod); _tabs->addTab(w, QString("%D")); // buy marker page w = new QWidget; form = new QFormLayout; w->setLayout(form); // color set = _settings->get(QString("buyMarkerColor")); _ref1Color = new ColorButton(this, QColor(set->toString())); connect(_ref1Color, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _ref1Color); // value set = _settings->get(QString("buyMarkerPrice")); _ref1 = new QDoubleSpinBox; _ref1->setRange(-99999999.0, 99999999.0); _ref1->setValue(set->toDouble()); connect(_ref1, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Value"), _ref1); _tabs->addTab(w, tr("Buy Marker")); // REF2 page w = new QWidget; form = new QFormLayout; w->setLayout(form); // color set = _settings->get(QString("sellMarkerColor")); _ref2Color = new ColorButton(this, QColor(set->toString())); connect(_ref2Color, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _ref2Color); // value set = _settings->get(QString("sellMarkerPrice")); _ref2 = new QDoubleSpinBox; _ref2->setRange(-99999999.0, 99999999.0); _ref2->setValue(set->toDouble()); connect(_ref2, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Value"), _ref2); _tabs->addTab(w, tr("Sell Marker")); }
void MACDDialog::setGUI (Entity *settings) { _settings = settings; // MACD page QWidget *w = new QWidget; QFormLayout *form = new QFormLayout; w->setLayout(form); // input QVariant *set = _settings->get(QString("input")); BarType bt; _input = new QComboBox; _input->addItems(bt.list()); _input->setCurrentIndex(_input->findText(set->toString(), Qt::MatchExactly)); connect(_input, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Input"), _input); // color set = _settings->get(QString("macdColor")); _macdColor = new ColorButton(this, QColor(set->toString())); connect(_macdColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _macdColor); // fast period set = _settings->get(QString("fast")); _fast = new QSpinBox; _fast->setRange(1, 999999); _fast->setValue(set->toInt()); connect(_fast, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Fast Period"), _fast); // slow period set = _settings->get(QString("slow")); _slow = new QSpinBox; _slow->setRange(1, 999999); _slow->setValue(set->toInt()); connect(_slow, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Slow Period"), _slow); // ma fast type set = _settings->get(QString("fastMA")); MAType mat; _fastMA = new QComboBox; _fastMA->addItems(mat.list()); _fastMA->setCurrentIndex(_fastMA->findText(set->toString(), Qt::MatchExactly)); connect(_fastMA, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Fast MA"), _fastMA); // ma slow type set = _settings->get(QString("slowMA")); _slowMA = new QComboBox; _slowMA->addItems(mat.list()); _slowMA->setCurrentIndex(_slowMA->findText(set->toString(), Qt::MatchExactly)); connect(_slowMA, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Slow MA"), _slowMA); // line style set = _settings->get(QString("macdStyle")); CurveLineType clt; _macdStyle = new QComboBox; _macdStyle->addItems(clt.list()); _macdStyle->setCurrentIndex(_macdStyle->findText(set->toString(), Qt::MatchExactly)); connect(_macdStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Style"), _macdStyle); // width set = _settings->get(QString("macdWidth")); _macdWidth = new QSpinBox; _macdWidth->setRange(1, 99); _macdWidth->setValue(set->toInt()); connect(_macdWidth, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Width"), _macdWidth); // show set = _settings->get(QString("macdShow")); _macdShow = new QCheckBox; _macdShow->setChecked(set->toBool()); connect(_macdShow, SIGNAL(toggled(bool)), this, SLOT(modified())); form->addRow(tr("Show"), _macdShow); _tabs->addTab(w, QString("MACD")); // SIGNAL page w = new QWidget; form = new QFormLayout; w->setLayout(form); // style set = _settings->get(QString("signalStyle")); _signalStyle = new QComboBox; _signalStyle->addItems(clt.list()); _signalStyle->setCurrentIndex(_signalStyle->findText(set->toString(), Qt::MatchExactly)); connect(_signalStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Style"), _signalStyle); // width set = _settings->get(QString("signalWidth")); _signalWidth = new QSpinBox; _signalWidth->setRange(1, 99); _signalWidth->setValue(set->toInt()); connect(_signalWidth, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Width"), _signalWidth); // color set = _settings->get(QString("signalColor")); _signalColor = new ColorButton(this, QColor(set->toString())); connect(_signalColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _signalColor); // ma type set = _settings->get(QString("signalMA")); _signalMA = new QComboBox; _signalMA->addItems(mat.list()); _signalMA->setCurrentIndex(_fastMA->findText(set->toString(), Qt::MatchExactly)); connect(_signalMA, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("MA"), _signalMA); // period set = _settings->get(QString("signalPeriod")); _signalPeriod = new QSpinBox; _signalPeriod->setRange(1, 999999); _signalPeriod->setValue(set->toInt()); connect(_signalPeriod, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Period"), _signalPeriod); // show set = _settings->get(QString("signalShow")); _signalShow = new QCheckBox; _signalShow->setChecked(set->toBool()); connect(_signalShow, SIGNAL(toggled(bool)), this, SLOT(modified())); form->addRow(tr("Show"), _signalShow); _tabs->addTab(w, tr("Signal")); // HIST page w = new QWidget; form = new QFormLayout; w->setLayout(form); // color set = _settings->get(QString("histColor")); _histColor = new ColorButton(this, QColor(set->toString())); connect(_histColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _histColor); // show set = _settings->get(QString("histShow")); _histShow = new QCheckBox; _histShow->setChecked(set->toBool()); connect(_histShow, SIGNAL(toggled(bool)), this, SLOT(modified())); form->addRow(tr("Show"), _histShow); _tabs->addTab(w, tr("Histogram")); }
void VolumeDialog::setGUI (Entity *settings) { _settings = settings; // Volume page QWidget *w = new QWidget; QFormLayout *form = new QFormLayout; w->setLayout(form); // up color QVariant *set = _settings->get(QString("upColor")); _upColor = new ColorButton(this, QColor(set->toString())); connect(_upColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Up Color"), _upColor); // down color set = _settings->get(QString("downColor")); _downColor = new ColorButton(this, QColor(set->toString())); connect(_downColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Down Color"), _downColor); // neutral color set = _settings->get(QString("neutralColor")); _neutralColor = new ColorButton(this, QColor(set->toString())); connect(_neutralColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Neutral Color"), _neutralColor); _tabs->addTab(w, QString("Volume")); // MA page w = new QWidget; form = new QFormLayout; w->setLayout(form); // type set = _settings->get(QString("maType")); MAType mat; _maType = new QComboBox; _maType->addItems(mat.list()); _maType->setCurrentIndex(_maType->findText(set->toString(), Qt::MatchExactly)); connect(_maType, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Type"), _maType); // style set = _settings->get(QString("maStyle")); CurveLineType clt; _maStyle = new QComboBox; _maStyle->addItems(clt.list()); _maStyle->setCurrentIndex(_maStyle->findText(set->toString(), Qt::MatchExactly)); connect(_maStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(modified())); form->addRow(tr("Style"), _maStyle); // width set = _settings->get(QString("maWidth")); _maWidth = new QSpinBox; _maWidth->setRange(1, 99); _maWidth->setValue(set->toInt()); connect(_maWidth, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Width"), _maWidth); // color set = _settings->get(QString("maColor")); _maColor = new ColorButton(this, QColor(set->toString())); connect(_maColor, SIGNAL(valueChanged(QColor)), this, SLOT(modified())); form->addRow(tr("Color"), _maColor); // period set = _settings->get(QString("maPeriod")); _maPeriod = new QSpinBox; _maPeriod->setRange(1, 999999); _maPeriod->setValue(set->toInt()); connect(_maPeriod, SIGNAL(valueChanged(const QString &)), this, SLOT(modified())); form->addRow(tr("Period"), _maPeriod); _tabs->addTab(w, QString("MA")); }