keduca
klangcombo.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
00023
00024
00025 #include <kstandarddirs.h>
00026
00027 #include "klangcombo.h"
00028 #include "klangcombo.moc"
00029
00030 KLanguageCombo::~KLanguageCombo ()
00031 {
00032 }
00033
00034 KLanguageCombo::KLanguageCombo (QWidget * parent, const char *name)
00035 : KTagComboBox(parent, name)
00036 {
00037 }
00038
00039 void KLanguageCombo::insertLanguage(const QString& path, const QString& name, const QString& sub, const QString &submenu)
00040 {
00041 QString output = name + QString::fromLatin1(" (") + path + QString::fromLatin1(")");
00042 QPixmap flag(locate("locale", sub + path + QString::fromLatin1("/flag.png")));
00043 insertItem(QIconSet(flag), output, path, submenu);
00044 }
00045
00046 void KLanguageCombo::changeLanguage(const QString& name, int i)
00047 {
00048 if (i < 0 || i >= count()) return;
00049 QString output = name + QString::fromLatin1(" (") + tag(i) + QString::fromLatin1(")");
00050 changeItem(output, i);
00051 }