X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bs%2Fui%2Froidseditview.ui.h;h=075520571d5afac5a7d01f495bab71760bda2f93;hb=6ab17155b82923f4263f1c536133e657970239a4;hp=d5d8b3b83c7b75e22b7e5f50f69cb6930aae4a58;hpb=4cf2f4e52869627146dfc5a0c0d4fe0942777a09;p=hbs.git diff --git a/bs/ui/roidseditview.ui.h b/bs/ui/roidseditview.ui.h index d5d8b3b..0755205 100644 --- a/bs/ui/roidseditview.ui.h +++ b/bs/ui/roidseditview.ui.h @@ -1,46 +1,66 @@ /**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you wish to add, delete or rename slots use Qt Designer which will -** update this file, preserving your code. Create an init() slot in place of -** a constructor, and a destroy() slot in place of a destructor. -*****************************************************************************/ + ** ui.h extension file, included from the uic-generated form implementation. + ** + ** If you wish to add, delete or rename slots use Qt Designer which will + ** update this file, preserving your code. Create an init() slot in place of + ** a constructor, and a destroy() slot in place of a destructor. + *****************************************************************************/ void RoidsEditView::init() { } -void RoidsEditView::setValue( const QString & s, unsigned value ) +void RoidsEditView::setValue( const QString & type, unsigned value ) { - if (type == tr("metal")) - MetalEdit->setText("%1").arg(value); - else if (type == tr("crystall")) - CrystalEdit->setText("%1").arg(value); - else if (type == tr("eoniuml")) - EoniumEdit->setText("%1").arg(value); - else if (type == tr("uninit")) - UninitEdit->setText("%1").arg(value); - else if (type == tr("score")) - ScoreEdit->setText("%1").arg(value); - + if (type == tr("metal")) + MetalEdit->setText(QString("%1").arg(value)); + else if (type == tr("crystal")) + CrystalEdit->setText(QString("%1").arg(value)); + else if (type == tr("eonium")) + EoniumEdit->setText(QString("%1").arg(value)); + else if (type == tr("uninit")) + UninitEdit->setText(QString("%1").arg(value)); + else if (type == tr("score")) + ScoreEdit->setText(QString("%1").arg(value)); + + } -void RoidsEditView::slotValueChanged( const QString & s ) +void RoidsEditView::slotValueChanged() { - QString type = send()->name(); - - if (type == "MetalEdit") - type = tr("metal"); - else if (type == "CrystalEdit") - type = tr("crystal"); - else if (type == "EoniumEdit") - type = tr("eonium"); - else if (type == "UninitEdit") - type = tr("uninit"); - else if (type == "ScoreEdit") - type = tr("score"); - - emit changed(type, s.toInt()); -} \ No newline at end of file + QString type = sender()->name(); + + if (type == "MetalEdit") + type = tr("metal"); + else if (type == "CrystalEdit") + type = tr("crystal"); + else if (type == "EoniumEdit") + type = tr("eonium"); + else if (type == "UninitEdit") + type = tr("uninit"); + else if (type == "ScoreEdit") + type = tr("score"); + test = type; + const QLineEdit *le = dynamic_cast(sender()); + if (le) + emit changed(type, le->text().toInt()); +} + + +void RoidsEditView::slotSetLost( QString type, float i ) +{ + if (type == tr("metal")) + MetalLostEdit->setText(QString("%1").arg(i)); + else if (type == tr("crystal")) + CrystalLostEdit->setText(QString("%1").arg(i)); + else if (type == tr("eonium")) + EoniumLostEdit->setText(QString("%1").arg(i)); + else if (type == tr("uninit")) + UninitLostEdit->setText(QString("%1").arg(i)); + else if (type == tr("scorelost")) + ScoreLostEdit->setText(QString("%1").arg(i)); + else if (type == tr("capping")) + CappingEdit->setText(QString("%1\%").arg(i*100)); +}