DefineTimeZoneWindow.cpp   DefineTimeZoneWindow.cpp 
skipping to change at line 24 skipping to change at line 24
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "TimeZoneConfigurationWindow.hpp" #include "TimeZoneConfigurationWindow.hpp"
#include "DefineTimeZoneWindow.hpp" #include "DefineTimeZoneWindow.hpp"
#include "ui_defineTimeZone.h" #include "ui_defineTimeZone.h"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelTranslator.hpp"
#include <cmath> #include <cmath>
#include <QRegExpValidator> #include <QRegExpValidator>
DefineTimeZoneWindow::DefineTimeZoneWindow() DefineTimeZoneWindow::DefineTimeZoneWindow()
{ {
ui = new Ui_defineTimeZoneForm(); ui = new Ui_defineTimeZoneForm();
timeZoneNameValidator = new QRegExpValidator(QRegExp("[^:\\d,+-/]{3, }"), this); timeZoneNameValidator = new QRegExpValidator(QRegExp("[^:\\d,+-/]{3, }"), this);
} }
DefineTimeZoneWindow::~DefineTimeZoneWindow() DefineTimeZoneWindow::~DefineTimeZoneWindow()
{ {
delete ui; delete ui;
delete timeZoneNameValidator; delete timeZoneNameValidator;
} }
void DefineTimeZoneWindow::languageChanged() void DefineTimeZoneWindow::retranslate()
{ {
if (dialog) if (dialog)
{
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
int startDateMonthIndex = ui->comboBoxDstStartDateMonth->cur
rentIndex();
int startDayIndex = ui->comboBoxDstStartDay->currentIndex();
int startMonthIndex = ui->comboBoxDstStartMonth->currentInde
x();
int startWeekIndex = ui->comboBoxDstStartWeek->currentIndex(
);
int endDateMonthIndex = ui->comboBoxDstEndDateMonth->current
Index();
int endDayIndex = ui->comboBoxDstEndDay->currentIndex();
int endMonthIndex = ui->comboBoxDstEndMonth->currentIndex();
int endWeekIndex = ui->comboBoxDstEndWeek->currentIndex();
populateDateLists();
ui->comboBoxDstStartDateMonth->setCurrentIndex(startDateMont
hIndex);
ui->comboBoxDstStartDay->setCurrentIndex(startDayIndex);
ui->comboBoxDstStartMonth->setCurrentIndex(startMonthIndex);
ui->comboBoxDstStartWeek->setCurrentIndex(startWeekIndex);
ui->comboBoxDstEndDateMonth->setCurrentIndex(endDateMonthInd
ex);
ui->comboBoxDstEndDay->setCurrentIndex(endDayIndex);
ui->comboBoxDstEndMonth->setCurrentIndex(endMonthIndex);
ui->comboBoxDstEndWeek->setCurrentIndex(endWeekIndex);
}
} }
void DefineTimeZoneWindow::createDialogContent() void DefineTimeZoneWindow::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), connect(&StelApp::getInstance(), SIGNAL(languageChanged()),
this, SLOT(languageChanged())); this, SLOT(retranslate()));
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
connect(ui->pushButtonUseDefinition, SIGNAL(clicked()), connect(ui->pushButtonUseDefinition, SIGNAL(clicked()),
this, SLOT(useDefinition())); this, SLOT(useDefinition()));
connect(ui->doubleSpinBoxOffset, SIGNAL(valueChanged(double)), connect(ui->doubleSpinBoxOffset, SIGNAL(valueChanged(double)),
this, SLOT(updateDstOffset(double))); this, SLOT(updateDstOffset(double)));
connect(ui->comboBoxDstStartDateMonth, SIGNAL(currentIndexChanged(in t)), connect(ui->comboBoxDstStartDateMonth, SIGNAL(currentIndexChanged(in t)),
this, SLOT(updateDayNumberMaximumDstStart(int))); this, SLOT(updateDayNumberMaximumDstStart(int)));
skipping to change at line 222 skipping to change at line 242
ui->timeEditDstStart->setEnabled(false); ui->timeEditDstStart->setEnabled(false);
ui->timeEditDstStart->setTime(QTime(2, 0, 0, 0)); ui->timeEditDstStart->setTime(QTime(2, 0, 0, 0));
ui->checkBoxDstEndTime->setChecked(false); ui->checkBoxDstEndTime->setChecked(false);
ui->timeEditDstEnd->setEnabled(false); ui->timeEditDstEnd->setEnabled(false);
ui->timeEditDstEnd->setTime(QTime(2, 0, 0, 0)); ui->timeEditDstEnd->setTime(QTime(2, 0, 0, 0));
} }
void DefineTimeZoneWindow::populateDateLists() void DefineTimeZoneWindow::populateDateLists()
{ {
QStringList monthList; QStringList monthList;
monthList.append("January"); monthList.append(q_("January"));
monthList.append("February"); monthList.append(q_("February"));
monthList.append("March"); monthList.append(q_("March"));
monthList.append("April"); monthList.append(q_("April"));
monthList.append("May"); monthList.append(q_("May"));
monthList.append("June"); monthList.append(q_("June"));
monthList.append("July"); monthList.append(q_("July"));
monthList.append("August"); monthList.append(q_("August"));
monthList.append("September"); monthList.append(q_("September"));
monthList.append("October"); monthList.append(q_("October"));
monthList.append("November"); monthList.append(q_("November"));
monthList.append("December"); monthList.append(q_("December"));
ui->comboBoxDstStartMonth->clear(); ui->comboBoxDstStartMonth->clear();
ui->comboBoxDstStartMonth->addItems(monthList); ui->comboBoxDstStartMonth->addItems(monthList);
ui->comboBoxDstEndMonth->clear(); ui->comboBoxDstEndMonth->clear();
ui->comboBoxDstEndMonth->addItems(monthList); ui->comboBoxDstEndMonth->addItems(monthList);
ui->comboBoxDstStartDateMonth->clear(); ui->comboBoxDstStartDateMonth->clear();
ui->comboBoxDstStartDateMonth->addItems(monthList); ui->comboBoxDstStartDateMonth->addItems(monthList);
ui->comboBoxDstEndDateMonth->clear(); ui->comboBoxDstEndDateMonth->clear();
ui->comboBoxDstEndDateMonth->addItems(monthList); ui->comboBoxDstEndDateMonth->addItems(monthList);
//TODO: For the translators: refers to any day of the week, if not p ossible, translate as "First week"
QStringList weekList; QStringList weekList;
weekList.append("First"); weekList.append(q_("First week"));
weekList.append("Second"); weekList.append(q_("Second week"));
weekList.append("Third"); weekList.append(q_("Third week"));
weekList.append("Fourth"); weekList.append(q_("Fourth week"));
weekList.append("Last"); weekList.append(q_("Last week"));
ui->comboBoxDstStartWeek->clear(); ui->comboBoxDstStartWeek->clear();
ui->comboBoxDstStartWeek->addItems(weekList); ui->comboBoxDstStartWeek->addItems(weekList);
ui->comboBoxDstEndWeek->clear(); ui->comboBoxDstEndWeek->clear();
ui->comboBoxDstEndWeek->addItems(weekList); ui->comboBoxDstEndWeek->addItems(weekList);
//Starts from Sunday deliberately //Starts from Sunday deliberately
QStringList dayList; QStringList dayList;
dayList.append("Sunday"); dayList.append(q_("Sunday"));
dayList.append("Monday"); dayList.append(q_("Monday"));
dayList.append("Tuesday"); dayList.append(q_("Tuesday"));
dayList.append("Wednesday"); dayList.append(q_("Wednesday"));
dayList.append("Thursday"); dayList.append(q_("Thursday"));
dayList.append("Friday"); dayList.append(q_("Friday"));
dayList.append("Saturday"); dayList.append(q_("Saturday"));
ui->comboBoxDstStartDay->clear(); ui->comboBoxDstStartDay->clear();
ui->comboBoxDstStartDay->addItems(dayList); ui->comboBoxDstStartDay->addItems(dayList);
ui->comboBoxDstEndDay->clear(); ui->comboBoxDstEndDay->clear();
ui->comboBoxDstEndDay->addItems(dayList); ui->comboBoxDstEndDay->addItems(dayList);
} }
void DefineTimeZoneWindow::updateDayNumberMaximum(int monthIndex, QSpinBox *spinBoxDay) void DefineTimeZoneWindow::updateDayNumberMaximum(int monthIndex, QSpinBox *spinBoxDay)
{ {
int maximum = 31; int maximum = 31;
switch (monthIndex) switch (monthIndex)
 End of changes. 9 change blocks. 
27 lines changed or deleted 52 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/