mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kdeui: show only a label from KSwitchLanguageDialog when translations are not installed
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
00b7fdfe54
commit
601193748c
1 changed files with 8 additions and 1 deletions
|
@ -54,7 +54,8 @@ KSwitchLanguageDialog::KSwitchLanguageDialog(QWidget *parent)
|
|||
connect(this, SIGNAL(okClicked()), SLOT(slotOk()));
|
||||
connect(this, SIGNAL(defaultClicked()), SLOT(slotDefault()));
|
||||
|
||||
foreach (const QString &language, KLocale::installedLanguages()) {
|
||||
const QStringList languages = KLocale::installedLanguages();
|
||||
foreach (const QString &language, languages) {
|
||||
QString languagelang;
|
||||
QString languagecntry;
|
||||
QString languagemod;
|
||||
|
@ -77,6 +78,12 @@ KSwitchLanguageDialog::KSwitchLanguageDialog(QWidget *parent)
|
|||
m_languagelabel = new QLabel(m_dialogwidget);
|
||||
m_languagelabel->setText(i18n("Please choose the language which should be used for this application:"));
|
||||
m_dialoglayout->addWidget(m_languagelabel);
|
||||
if (languages.size() == 0) {
|
||||
m_languagelabel->setText(i18n("No translations installed"));
|
||||
m_languagelabel->setAlignment(Qt::AlignCenter);
|
||||
setMainWidget(m_dialogwidget);
|
||||
return;
|
||||
}
|
||||
m_languageedit = new KEditListWidget(m_dialogwidget);
|
||||
m_languagebox = new KComboBox(m_languageedit);
|
||||
// TODO: not having a line editor is not an option, KComboBox creates one and things get ugly.
|
||||
|
|
Loading…
Add table
Reference in a new issue