1
0
Fork 0
flightgear/src/GUI/EditRatingsFilterDialog.cxx
James Turner 78e8f53312 In-app launcher for Mac, based on Qt5.
The old Mac launcher doesn’t work on Yosemite, add a tiny
Qt-based launcher inside the main process (no need to fork /
exec) which runs before the OSG window is created.

Will be merged for 3.4, hopefully with no impact on other
platforms.
2015-01-06 19:13:30 +00:00

39 lines
No EOL
895 B
C++

#include "EditRatingsFilterDialog.hxx"
#include "ui_EditRatingsFilterDialog.h"
EditRatingsFilterDialog::EditRatingsFilterDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::EditRatingsFilterDialog)
{
ui->setupUi(this);
}
EditRatingsFilterDialog::~EditRatingsFilterDialog()
{
delete ui;
}
void EditRatingsFilterDialog::setRatings(int *ratings)
{
for (int i=0; i<4; ++i) {
QAbstractSlider* s = sliderForIndex(i);
s->setValue(ratings[i]);
}
}
int EditRatingsFilterDialog::getRating(int index) const
{
return sliderForIndex(index)->value();
}
QAbstractSlider* EditRatingsFilterDialog::sliderForIndex(int index) const
{
switch (index) {
case 0: return ui->fdmSlider;
case 1: return ui->systemsSlider;
case 2: return ui->cockpitSlider;
case 3: return ui->modelSlider;
default:
return 0;
}
}