Changeset View
Changeset View
Standalone View
Standalone View
src/optiondialog.cpp
Show First 20 Lines • Show All 1459 Lines • ▼ Show 20 Line(s) | 1450 | */ | |||
---|---|---|---|---|---|
1460 | 1460 | | |||
1461 | QGridLayout* gbox = new QGridLayout(); | 1461 | QGridLayout* gbox = new QGridLayout(); | ||
1462 | gbox->setColumnStretch(1, 5); | 1462 | gbox->setColumnStretch(1, 5); | ||
1463 | topLayout->addLayout(gbox); | 1463 | topLayout->addLayout(gbox); | ||
1464 | int line = 0; | 1464 | int line = 0; | ||
1465 | 1465 | | |||
1466 | QLabel* label; | 1466 | QLabel* label; | ||
1467 | 1467 | | |||
1468 | #ifdef KREPLACEMENTS_H | | |||
1469 | | ||||
1470 | static const char* countryMap[] = { | | |||
1471 | "af Afrikaans", | | |||
1472 | "ar Arabic", | | |||
1473 | "az Azerbaijani", | | |||
1474 | "be Belarusian", | | |||
1475 | "bg Bulgarian", | | |||
1476 | "bn Bengali", | | |||
1477 | "bo Tibetan", | | |||
1478 | "br Breton", | | |||
1479 | "bs Bosnian", | | |||
1480 | "ca Catalan", | | |||
1481 | "ca@valencia Catalan (Valencian)", | | |||
1482 | "cs Czech", | | |||
1483 | "cy Welsh", | | |||
1484 | "da Danish", | | |||
1485 | "de German", | | |||
1486 | "el Greek", | | |||
1487 | "en_GB British English", | | |||
1488 | "eo Esperanto", | | |||
1489 | "es Spanish", | | |||
1490 | "et Estonian", | | |||
1491 | "eu Basque", | | |||
1492 | "fa Farsi (Persian)", | | |||
1493 | "fi Finnish", | | |||
1494 | "fo Faroese", | | |||
1495 | "fr French", | | |||
1496 | "ga Irish Gaelic", | | |||
1497 | "gl Galician", | | |||
1498 | "gu Gujarati", | | |||
1499 | "he Hebrew", | | |||
1500 | "hi Hindi", | | |||
1501 | "hne Chhattisgarhi", | | |||
1502 | "hr Croatian", | | |||
1503 | "hsb Upper Sorbian", | | |||
1504 | "hu Hungarian", | | |||
1505 | "id Indonesian", | | |||
1506 | "is Icelandic", | | |||
1507 | "it Italian", | | |||
1508 | "ja Japanese", | | |||
1509 | "ka Georgian", | | |||
1510 | "ko Korean", | | |||
1511 | "ku Kurdish", | | |||
1512 | "lo Lao", | | |||
1513 | "lt Lithuanian", | | |||
1514 | "lv Latvian", | | |||
1515 | "mi Maori", | | |||
1516 | "mk Macedonian", | | |||
1517 | "ml Malayalam" | | |||
1518 | "mn Mongolian", | | |||
1519 | "ms Malay", | | |||
1520 | "mt Maltese", | | |||
1521 | "nb Norwegian Bookmal", | | |||
1522 | "nds Low Saxon", | | |||
1523 | "nl Dutch", | | |||
1524 | "nn Norwegian Nynorsk", | | |||
1525 | "nso Northern Sotho", | | |||
1526 | "oc Occitan", | | |||
1527 | "pl Polish", | | |||
1528 | "pt Portuguese", | | |||
1529 | "pt_BR Brazilian Portuguese", | | |||
1530 | "ro Romanian", | | |||
1531 | "ru Russian", | | |||
1532 | "rw Kinyarwanda", | | |||
1533 | "se Northern Sami", | | |||
1534 | "sk Slovak", | | |||
1535 | "sl Slovenian", | | |||
1536 | "sq Albanian", | | |||
1537 | "sr Serbian", | | |||
1538 | "sr@Latn Serbian", | | |||
1539 | "ss Swati", | | |||
1540 | "sv Swedish", | | |||
1541 | "ta Tamil", | | |||
1542 | "tg Tajik", | | |||
1543 | "th Thai", | | |||
1544 | "tr Turkish", | | |||
1545 | "uk Ukrainian", | | |||
1546 | "uz Uzbek", | | |||
1547 | "ven Venda", | | |||
1548 | "vi Vietnamese", | | |||
1549 | "wa Walloon", | | |||
1550 | "xh Xhosa", | | |||
1551 | "zh_CN Chinese Simplified", | | |||
1552 | "zh_TW Chinese Traditional", | | |||
1553 | "zu Zulu"}; | | |||
1554 | | ||||
1555 | label = new QLabel(i18n("Language (restart required)"), page); | | |||
1556 | gbox->addWidget(label, line, 0); | | |||
1557 | OptionComboBox* pLanguage = new OptionComboBox(0, "Language", &m_options.m_language, page, this); | | |||
1558 | gbox->addWidget(pLanguage, line, 1); | | |||
1559 | pLanguage->addItem("Auto"); // Must not translate, won't work otherwise! | | |||
1560 | pLanguage->addItem("en_orig"); | | |||
1561 | | ||||
1562 | #if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) | | |||
1563 | // Read directory: Find all kdiff3_*.qm-files and insert the found files here | | |||
1564 | QDir localeDir("/usr/share/locale"); // See also kreplacements.cpp: getTranslationDir() | | |||
1565 | QStringList dirList = localeDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); | | |||
1566 | | ||||
1567 | for(int i = 0; i < dirList.size(); ++i) | | |||
1568 | { | | |||
1569 | QString languageId = dirList[i]; | | |||
1570 | if(!QFile::exists("/usr/share/locale/" + languageId + "/LC_MESSAGES/kdiff3.qm")) | | |||
1571 | continue; | | |||
1572 | #else | | |||
1573 | // Read directory: Find all kdiff3_*.qm-files and insert the found files here | | |||
1574 | | ||||
1575 | QDir localeDir(getTranslationDir(QString())); | | |||
1576 | QStringList fileList = localeDir.entryList(QStringList("kdiff3_*.qm"), QDir::Files, QDir::Name); | | |||
1577 | for(int i = 0; i < fileList.size(); ++i) | | |||
1578 | { | | |||
1579 | QString fileName = fileList[i]; | | |||
1580 | // Skip the "kdiff3_" and omit the .qm | | |||
1581 | QString languageId = fileName.mid(7, fileName.length() - 10); | | |||
1582 | #endif | | |||
1583 | | ||||
1584 | unsigned int countryIdx = 0; | | |||
1585 | for(countryIdx = 0; countryIdx < sizeof(countryMap) / sizeof(countryMap[0]); ++countryIdx) | | |||
1586 | { | | |||
1587 | QString fullName = countryMap[countryIdx]; | | |||
1588 | if(QString(languageId + " ") == fullName.left(languageId.length() + 1)) | | |||
1589 | { | | |||
1590 | languageId += " (" + fullName.mid(languageId.length() + 1) + ")"; | | |||
1591 | } | | |||
1592 | } | | |||
1593 | | ||||
1594 | pLanguage->addItem(languageId); | | |||
1595 | } | | |||
1596 | | ||||
1597 | label->setToolTip(i18n( | | |||
1598 | "Choose the language of the GUI strings or \"Auto\".\n" | | |||
1599 | "For a change of language to take place, quit and restart KDiff3.")); | | |||
1600 | ++line; | | |||
1601 | /* | | |||
1602 | label = new QLabel( i18n("Codec for file contents"), page ); | | |||
1603 | gbox->addWidget( label, line, 0 ); | | |||
1604 | OptionComboBox* pFileCodec = new OptionComboBox( 0, "FileCodec", &m_options.m_fileCodec, page, this ); | | |||
1605 | gbox->addWidget( pFileCodec, line, 1 ); | | |||
1606 | insertCodecs( pFileCodec ); | | |||
1607 | label->setToolTip( i18n( | | |||
1608 | "Choose the codec that should be used for your input files\n" | | |||
1609 | "or \"Auto\" if unsure." ) | | |||
1610 | ); | | |||
1611 | ++line; | | |||
1612 | */ | | |||
1613 | #endif | | |||
1614 | | ||||
1615 | m_pSameEncoding = new OptionCheckBox(i18n("Use the same encoding for everything:"), true, "SameEncoding", &m_options.m_bSameEncoding, page, this); | 1468 | m_pSameEncoding = new OptionCheckBox(i18n("Use the same encoding for everything:"), true, "SameEncoding", &m_options.m_bSameEncoding, page, this); | ||
1616 | gbox->addWidget(m_pSameEncoding, line, 0, 1, 2); | 1469 | gbox->addWidget(m_pSameEncoding, line, 0, 1, 2); | ||
1617 | m_pSameEncoding->setToolTip(i18n( | 1470 | m_pSameEncoding->setToolTip(i18n( | ||
1618 | "Enable this allows to change all encodings by changing the first only.\n" | 1471 | "Enable this allows to change all encodings by changing the first only.\n" | ||
1619 | "Disable this if different individual settings are needed.")); | 1472 | "Disable this if different individual settings are needed.")); | ||
1620 | ++line; | 1473 | ++line; | ||
1621 | 1474 | | |||
1622 | label = new QLabel(i18n("Note: Local Encoding is ") + "\"" + QTextCodec::codecForLocale()->name() + "\"", page); | 1475 | label = new QLabel(i18n("Note: Local Encoding is ") + "\"" + QTextCodec::codecForLocale()->name() + "\"", page); | ||
▲ Show 20 Lines • Show All 430 Lines • Show Last 20 Lines |