parley
firstidentifierlanguagepage.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "firstidentifierlanguagepage.h"
00023
00024 #include <QWizardPage>
00025 #include <QLabel>
00026 #include <QLineEdit>
00027 #include <QTreeView>
00028 #include <QCheckBox>
00029 #include <QVBoxLayout>
00030
00031 #include <KComboBox>
00032 #include <KLocale>
00033
00034 #include "kvtnewdocumentwizard.h"
00035
00040 FirstIdentifierLanguagePage::FirstIdentifierLanguagePage(QWizard * parent)
00041 : QWizardPage(parent)
00042 {
00043 setTitle(i18n("Identifier and language selection"));
00044 setSubTitle(i18n("Please select the first column data:"));
00045
00046 setupUi(this);
00047 registerField("firstIdentifierName*", identifierNameLineEdit);
00048 registerField("firstLocale", languageComboBox, "currentText", "currentTextChanged()");
00049
00050 connect(languageComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(currentLanguageChanged(const QString&)));
00051
00052 QStringList codes = KGlobal::locale()->allLanguagesList();
00053
00054 QStringList languageNames;
00055 foreach (QString code, codes){
00056 languageNames.append( KGlobal::locale()->languageCodeToName(code) );
00057 }
00058 languageNames.sort();
00059
00060 languageComboBox->addItems(languageNames);
00061 }
00062
00063 FirstIdentifierLanguagePage::~FirstIdentifierLanguagePage()
00064 {
00065 }
00066
00067 void FirstIdentifierLanguagePage::currentLanguageChanged(const QString & language)
00068 {
00069 identifierNameLineEdit->setText(language);
00070 }
00071
00072 void FirstIdentifierLanguagePage::initializePage()
00073 {
00074 QString currentCode = KGlobal::locale()->language();
00075 languageComboBox->setCurrentIndex(
00076 languageComboBox->findText(
00077 KGlobal::locale()->languageCodeToName(currentCode) ) );
00078 }
00079
00080
00081 #include "firstidentifierlanguagepage.moc"