1 /* |
1 /* |
2 * Hedgewars, a free turn based strategy game |
2 * Hedgewars, a free turn based strategy game |
3 * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
3 * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com> |
4 * |
4 * |
5 * This program is free software; you can redistribute it and/or modify |
5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License as published by |
6 * it under the terms of the GNU General Public License as published by |
7 * the Free Software Foundation; version 2 of the License |
7 * the Free Software Foundation; version 2 of the License |
8 * |
8 * |
273 QLabel *winLabelX = new QLabel(groupGame); |
273 QLabel *winLabelX = new QLabel(groupGame); |
274 winLabelX->setText("x"); // decorational x |
274 winLabelX->setText("x"); // decorational x |
275 winLabelX->setFixedWidth(40); |
275 winLabelX->setFixedWidth(40); |
276 winLabelX->setAlignment(Qt::AlignCenter); |
276 winLabelX->setAlignment(Qt::AlignCenter); |
277 |
277 |
278 windowWidthEdit = new QLineEdit(groupGame); |
278 // TODO: less random max. also: |
279 windowWidthEdit->setValidator(new QIntValidator(this)); |
279 // make some min/max-consts, shared with engine? |
|
280 windowWidthEdit = new QSpinBox(groupGame); |
|
281 windowWidthEdit->setRange(640, 102400); |
280 windowWidthEdit->setFixedSize(55, CBResolution->height()); |
282 windowWidthEdit->setFixedSize(55, CBResolution->height()); |
281 windowHeightEdit = new QLineEdit(groupGame); |
283 windowHeightEdit = new QSpinBox(groupGame); |
282 windowHeightEdit->setValidator(new QIntValidator(this)); |
284 windowHeightEdit->setRange(480, 102400); |
283 windowHeightEdit->setFixedSize(55, CBResolution->height()); |
285 windowHeightEdit->setFixedSize(55, CBResolution->height()); |
284 |
286 |
285 winResLayout->addWidget(windowWidthEdit, 0); |
287 winResLayout->addWidget(windowWidthEdit, 0); |
286 winResLayout->addWidget(winLabelX, 0); |
288 winResLayout->addWidget(winLabelX, 0); |
287 winResLayout->addWidget(windowHeightEdit, 0); |
289 winResLayout->addWidget(windowHeightEdit, 0); |
583 groupMisc->layout()->addWidget(labelLanguage, 0, 0); |
585 groupMisc->layout()->addWidget(labelLanguage, 0, 0); |
584 |
586 |
585 CBLanguage = new QComboBox(groupMisc); |
587 CBLanguage = new QComboBox(groupMisc); |
586 groupMisc->layout()->addWidget(CBLanguage, 0, 1); |
588 groupMisc->layout()->addWidget(CBLanguage, 0, 1); |
587 QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm")); |
589 QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm")); |
588 CBLanguage->addItem(QComboBox::tr("(System default)"), QString("")); |
590 CBLanguage->addItem(QComboBox::tr("(System default)"), QString()); |
589 for(int i = 0; i < locs.count(); i++) |
591 for(int i = 0; i < locs.count(); i++) |
590 { |
592 { |
591 QLocale loc(locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1")); |
593 QString lname = locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"); |
592 CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name()); |
594 QLocale loc(lname); |
|
595 CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", lname); |
593 } |
596 } |
|
597 |
|
598 QLabel *restartNoticeLabel = new QLabel(groupMisc); |
|
599 restartNoticeLabel->setText(QLabel::tr("This setting will be effective at next restart.")); |
|
600 groupMisc->layout()->addWidget(restartNoticeLabel, 1, 1); |
|
601 |
594 |
602 |
595 // Divider |
603 // Divider |
596 |
604 |
597 groupMisc->addDivider(); // row 1 |
605 groupMisc->addDivider(); // row 1 |
598 |
606 |
599 // Append date and time to record file name |
607 // Append date and time to record file name |
600 |
608 |
601 CBNameWithDate = new QCheckBox(groupMisc); |
609 CBNameWithDate = new QCheckBox(groupMisc); |
602 CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name")); |
610 CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name")); |
603 groupMisc->layout()->addWidget(CBNameWithDate, 2, 0, 1, 2); |
611 groupMisc->layout()->addWidget(CBNameWithDate, 3, 0, 1, 2); |
604 |
612 |
605 // Associate file extensions |
613 // Associate file extensions |
606 |
614 |
607 BtnAssociateFiles = new QPushButton(groupMisc); |
615 BtnAssociateFiles = new QPushButton(groupMisc); |
608 BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions")); |
616 BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions")); |
609 BtnAssociateFiles->setVisible(!custom_data && !custom_config); |
617 BtnAssociateFiles->setVisible(!custom_data && !custom_config); |
610 groupMisc->layout()->addWidget(BtnAssociateFiles, 3, 0, 1, 2); |
618 groupMisc->layout()->addWidget(BtnAssociateFiles, 4, 0, 1, 2); |
611 } |
619 } |
612 |
620 |
613 #ifdef __APPLE__ |
621 #ifdef __APPLE__ |
614 #ifdef SPARKLE_ENABLED |
622 #ifdef SPARKLE_ENABLED |
615 { // group: updates |
623 { // group: updates |