Exemplo n.º 1
0
FeeCalculator::FeeCalculator()
	: QDialog()
{
	buyPaidLocked=false;
	buyBtcLocked=true;
	buyBtcReceivedLocked=false;
	ui.setupUi(this);
	setWindowFlags(Qt::WindowCloseButtonHint);
	foreach(QDoubleSpinBox* spinBox, findChildren<QDoubleSpinBox*>())new JulySpinBoxFix(spinBox);
#ifdef Q_OS_WIN
	if(QtWin::isCompositionEnabled())QtWin::extendFrameIntoClientArea(this);
#endif
	ui.feeValue->setValue(mainWindow.ui.accountFee->value());

	ui.buyPrice->setValue(mainWindow.ui.marketBuy->value());
	double btcVal=mainWindow.ui.accountUSD->value()/ui.buyPrice->value();
	if(btcVal<0.01)btcVal=1.0;
	ui.buyTotalBtc->setValue(btcVal);

	buyBtcLocked=false;
	buyBtcChanged(ui.buyTotalBtc->value());
	setZeroProfitPrice();
	buyBtcChanged(ui.buyTotalBtc->value());//I'll remove this soon
	setZeroProfitPrice();//and this too

	mainWindow.fillAllBtcLabels(this,currencyAStr);
	mainWindow.fillAllUsdLabels(this,currencyBStr);

	julyTranslator->translateUi(this);

	languageChanged();
	connect(julyTranslator,SIGNAL(languageChanged()),this,SLOT(languageChanged()));
}
Exemplo n.º 2
0
FeeCalculator::FeeCalculator()
	: QDialog()
{
	buyPaidLocked=false;
	buyBtcLocked=true;
	buyBtcReceivedLocked=false;
	ui.setupUi(this);
	setAttribute(Qt::WA_DeleteOnClose,true);
	setWindowFlags(Qt::WindowCloseButtonHint);
	Q_FOREACH(QDoubleSpinBox* spinBox, findChildren<QDoubleSpinBox*>())new JulySpinBoxFix(spinBox);

	mainWindow.fillAllBtcLabels(this,baseValues.currentPair.currAStr);
	mainWindow.fillAllUsdLabels(this,baseValues.currentPair.currBStr);
	mainWindow.fixDecimals(this);

	ui.feeValue->setValue(mainWindow.ui.accountFee->value());

    ui.buyPrice->setValue(IndicatorEngine::getValue(baseValues.exchangeName+'_'+baseValues.currentPair.symbol+"_Sell"));
	double btcVal=mainWindow.getAvailableUSD()/ui.buyPrice->value();
	if(btcVal<baseValues.currentPair.tradeVolumeMin)btcVal=baseValues.currentPair.tradeVolumeMin;
	ui.buyTotalBtc->setValue(btcVal);

	ui.buyBtcLayout->addWidget(new JulySpinBoxPicker(ui.buyTotalBtc));
	ui.buyPriceLayout->addWidget(new JulySpinBoxPicker(ui.buyPrice));
	ui.sellPriceLayout->addWidget(new JulySpinBoxPicker(ui.sellPrice));
	ui.feeLayout->addWidget(new JulySpinBoxPicker(ui.feeValue));
	ui.totalPaidLayout->addWidget(new JulySpinBoxPicker(ui.totalPaid));
	ui.receivedLayout->addWidget(new JulySpinBoxPicker(ui.btcReceived));

	buyBtcLocked=false;
	buyBtcChanged(ui.buyTotalBtc->value());
	setZeroProfitPrice();
	buyBtcChanged(ui.buyTotalBtc->value());//I'll remove this soon
	setZeroProfitPrice();//and this too

	ui.singleInstance->setChecked(mainWindow.feeCalculatorSingleInstance);

	julyTranslator.translateUi(this);

	languageChanged();
	connect(&julyTranslator,SIGNAL(languageChanged()),this,SLOT(languageChanged()));

	ui.groupBox->setStyleSheet("QGroupBox {background: rgba(255,255,255,60); border: 1px solid "+baseValues.appTheme.gray.name()+";border-radius: 3px;margin-top: 7px;}");

	if(mainWindow.ui.widgetStaysOnTop->isChecked())ui.widgetStaysOnTop->setChecked(true);
	else setStaysOnTop(false);
}
Exemplo n.º 3
0
void FeeCalculator::feeChanged(double)
{
	buyBtcChanged(ui.buyTotalBtc->value());
}