5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
22 #include "ui_trainer.h"
24 TrainerPanel::TrainerPanel(QWidget
* parent
, GeneralSettings
& generalSettings
, Firmware
* firmware
):
25 GeneralPanel(parent
, generalSettings
, firmware
),
31 ui
->trnMode_1
->setCurrentIndex(generalSettings
.trainer
.mix
[0].mode
);
32 ui
->trnChn_1
->setCurrentIndex(generalSettings
.trainer
.mix
[0].src
);
33 ui
->trnWeight_1
->setValue(generalSettings
.trainer
.mix
[0].weight
);
34 ui
->trnMode_2
->setCurrentIndex(generalSettings
.trainer
.mix
[1].mode
);
35 ui
->trnChn_2
->setCurrentIndex(generalSettings
.trainer
.mix
[1].src
);
36 ui
->trnWeight_2
->setValue(generalSettings
.trainer
.mix
[1].weight
);
37 ui
->trnMode_3
->setCurrentIndex(generalSettings
.trainer
.mix
[2].mode
);
38 ui
->trnChn_3
->setCurrentIndex(generalSettings
.trainer
.mix
[2].src
);
39 ui
->trnWeight_3
->setValue(generalSettings
.trainer
.mix
[2].weight
);
40 ui
->trnMode_4
->setCurrentIndex(generalSettings
.trainer
.mix
[3].mode
);
41 ui
->trnChn_4
->setCurrentIndex(generalSettings
.trainer
.mix
[3].src
);
42 ui
->trnWeight_4
->setValue(generalSettings
.trainer
.mix
[3].weight
);
46 TrainerPanel::~TrainerPanel()
51 void TrainerPanel::on_trnMode_1_currentIndexChanged(int index
)
53 generalSettings
.trainer
.mix
[0].mode
= index
;
57 void TrainerPanel::on_trnChn_1_currentIndexChanged(int index
)
59 generalSettings
.trainer
.mix
[0].src
= index
;
63 void TrainerPanel::on_trnWeight_1_editingFinished()
65 generalSettings
.trainer
.mix
[0].weight
= ui
->trnWeight_1
->value();
69 void TrainerPanel::on_trnMode_2_currentIndexChanged(int index
)
71 generalSettings
.trainer
.mix
[1].mode
= index
;
75 void TrainerPanel::on_trnChn_2_currentIndexChanged(int index
)
77 generalSettings
.trainer
.mix
[1].src
= index
;
81 void TrainerPanel::on_trnWeight_2_editingFinished()
83 generalSettings
.trainer
.mix
[1].weight
= ui
->trnWeight_2
->value();
87 void TrainerPanel::on_trnMode_3_currentIndexChanged(int index
)
89 generalSettings
.trainer
.mix
[2].mode
= index
;
93 void TrainerPanel::on_trnChn_3_currentIndexChanged(int index
)
95 generalSettings
.trainer
.mix
[2].src
= index
;
99 void TrainerPanel::on_trnWeight_3_editingFinished()
101 generalSettings
.trainer
.mix
[2].weight
= ui
->trnWeight_3
->value();
105 void TrainerPanel::on_trnMode_4_currentIndexChanged(int index
)
107 generalSettings
.trainer
.mix
[3].mode
= index
;
111 void TrainerPanel::on_trnChn_4_currentIndexChanged(int index
)
113 generalSettings
.trainer
.mix
[3].src
= index
;
117 void TrainerPanel::on_trnWeight_4_editingFinished()
119 generalSettings
.trainer
.mix
[3].weight
= ui
->trnWeight_4
->value();