1 /****************************************************************************
2 ** ui.h extension file, included from the uic-generated form implementation.
4 ** If you wish to add, delete or rename functions or slots use
5 ** Qt Designer which will update this file, preserving your code. Create an
6 ** init() function in place of a constructor, and a destroy() function in
7 ** place of a destructor.
8 *****************************************************************************/
10 #ifndef WORDCOMPLETIONUI_UI_H
11 #define WORDCOMPLETIONUI_UI_H
13 void WordCompletionUI::init() {
14 languageButton
= new KLanguageButton (selectedDictionaryDetails
);
15 languageLabel
->setBuddy (languageButton
);
16 languageButton
->setWhatsThis( i18n("With this combo box you select the language associated with the selected dictionary."));
18 languageButton
->showLanguageCodes(true);
19 languageButton
->loadAllLanguages();
20 languageButton
->insertLanguage("??", i18n("Other"));
22 connect (languageButton
, SIGNAL(activated(int)), this, SLOT(languageButton_activated(int)));
25 void WordCompletionUI::languageButton_activated (int) {
26 if (languageButton
->current() == "??") {
27 QString customLanguage
= KInputDialog::getText(i18n("Create Custom Language"), i18n("Please enter the code for the custom language:"));
29 if (languageButton
->contains(customLanguage
)) {
30 languageButton
->setCurrentItem(customLanguage
);
33 languageButton
->insertLanguage(customLanguage
, i18n("without name"));
34 languageButton
->setCurrentItem(customLanguage
);
39 #endif // WORDCOMPLETIONUI_UI_H