~ubuntu-branches/debian/jessie/stellarium/jessie

« back to all changes in this revision

Viewing changes to plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.cpp

  • Committer: Package Import Robot
  • Author(s): Tomasz Buchert
  • Date: 2012-05-18 13:26:18 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20120518132618-3uso09fo68c218cx
Tags: 0.11.2-1
* Imported Upstream version 0.11.1 and then 0.11.2 (Closes: #658431)
* Change maintainer (Closes: #668916)
* Machine-readable copyright file
* Bump Standards-Version to 3.9.3
* Update debhelper compat to 9
* Fix lintian duplicate-font-file warning
* Fix copyright-refers-to-symlink-license lintian tag
* Add lintian override for embedded-library error

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "DefineTimeZoneWindow.hpp"
22
22
#include "ui_defineTimeZone.h"
23
23
#include "StelApp.hpp"
 
24
#include "StelTranslator.hpp"
24
25
 
25
26
#include <cmath>
26
27
#include <QRegExpValidator>
37
38
        delete timeZoneNameValidator;
38
39
}
39
40
 
40
 
void DefineTimeZoneWindow::languageChanged()
 
41
void DefineTimeZoneWindow::retranslate()
41
42
{
42
43
        if (dialog)
 
44
        {
43
45
                ui->retranslateUi(dialog);
 
46
                int startDateMonthIndex = ui->comboBoxDstStartDateMonth->currentIndex();
 
47
                int startDayIndex = ui->comboBoxDstStartDay->currentIndex();
 
48
                int startMonthIndex = ui->comboBoxDstStartMonth->currentIndex();
 
49
                int startWeekIndex = ui->comboBoxDstStartWeek->currentIndex();
 
50
                int endDateMonthIndex = ui->comboBoxDstEndDateMonth->currentIndex();
 
51
                int endDayIndex = ui->comboBoxDstEndDay->currentIndex();
 
52
                int endMonthIndex = ui->comboBoxDstEndMonth->currentIndex();
 
53
                int endWeekIndex = ui->comboBoxDstEndWeek->currentIndex();
 
54
                populateDateLists();
 
55
                ui->comboBoxDstStartDateMonth->setCurrentIndex(startDateMonthIndex);
 
56
                ui->comboBoxDstStartDay->setCurrentIndex(startDayIndex);
 
57
                ui->comboBoxDstStartMonth->setCurrentIndex(startMonthIndex);
 
58
                ui->comboBoxDstStartWeek->setCurrentIndex(startWeekIndex);
 
59
                ui->comboBoxDstEndDateMonth->setCurrentIndex(endDateMonthIndex);
 
60
                ui->comboBoxDstEndDay->setCurrentIndex(endDayIndex);
 
61
                ui->comboBoxDstEndMonth->setCurrentIndex(endMonthIndex);
 
62
                ui->comboBoxDstEndWeek->setCurrentIndex(endWeekIndex);
 
63
        }
44
64
}
45
65
 
46
66
void DefineTimeZoneWindow::createDialogContent()
47
67
{
48
68
        ui->setupUi(dialog);
49
69
        connect(&StelApp::getInstance(), SIGNAL(languageChanged()),
50
 
                this, SLOT(languageChanged()));
 
70
                this, SLOT(retranslate()));
51
71
 
52
72
        connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
53
73
        connect(ui->pushButtonUseDefinition, SIGNAL(clicked()),
219
239
void DefineTimeZoneWindow::populateDateLists()
220
240
{
221
241
        QStringList monthList;
222
 
        monthList.append("January");
223
 
        monthList.append("February");
224
 
        monthList.append("March");
225
 
        monthList.append("April");
226
 
        monthList.append("May");
227
 
        monthList.append("June");
228
 
        monthList.append("July");
229
 
        monthList.append("August");
230
 
        monthList.append("September");
231
 
        monthList.append("October");
232
 
        monthList.append("November");
233
 
        monthList.append("December");
 
242
        monthList.append(q_("January"));
 
243
        monthList.append(q_("February"));
 
244
        monthList.append(q_("March"));
 
245
        monthList.append(q_("April"));
 
246
        monthList.append(q_("May"));
 
247
        monthList.append(q_("June"));
 
248
        monthList.append(q_("July"));
 
249
        monthList.append(q_("August"));
 
250
        monthList.append(q_("September"));
 
251
        monthList.append(q_("October"));
 
252
        monthList.append(q_("November"));
 
253
        monthList.append(q_("December"));
234
254
 
235
255
        ui->comboBoxDstStartMonth->clear();
236
256
        ui->comboBoxDstStartMonth->addItems(monthList);
241
261
        ui->comboBoxDstEndDateMonth->clear();
242
262
        ui->comboBoxDstEndDateMonth->addItems(monthList);
243
263
 
244
 
        //TODO: For the translators: refers to any day of the week, if not possible, translate as "First week"
245
264
        QStringList weekList;
246
 
        weekList.append("First");
247
 
        weekList.append("Second");
248
 
        weekList.append("Third");
249
 
        weekList.append("Fourth");
250
 
        weekList.append("Last");
 
265
        weekList.append(q_("First week"));
 
266
        weekList.append(q_("Second week"));
 
267
        weekList.append(q_("Third week"));
 
268
        weekList.append(q_("Fourth week"));
 
269
        weekList.append(q_("Last week"));
251
270
 
252
271
        ui->comboBoxDstStartWeek->clear();
253
272
        ui->comboBoxDstStartWeek->addItems(weekList);
256
275
 
257
276
        //Starts from Sunday deliberately
258
277
        QStringList dayList;
259
 
        dayList.append("Sunday");
260
 
        dayList.append("Monday");
261
 
        dayList.append("Tuesday");
262
 
        dayList.append("Wednesday");
263
 
        dayList.append("Thursday");
264
 
        dayList.append("Friday");
265
 
        dayList.append("Saturday");
 
278
        dayList.append(q_("Sunday"));
 
279
        dayList.append(q_("Monday"));
 
280
        dayList.append(q_("Tuesday"));
 
281
        dayList.append(q_("Wednesday"));
 
282
        dayList.append(q_("Thursday"));
 
283
        dayList.append(q_("Friday"));
 
284
        dayList.append(q_("Saturday"));
266
285
 
267
286
        ui->comboBoxDstStartDay->clear();
268
287
        ui->comboBoxDstStartDay->addItems(dayList);