summaryrefslogtreecommitdiffstats
path: root/kmouth/wordcompletion/wordcompletionui.ui.h
blob: f1c3728982a315f27d996d6f4f27b1ac3b099d22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** TQt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/


void WordCompletionUI::init() {
    languageButton = new KLanguageButton (selectedDictionaryDetails, "languageButton");
    selectedDictionaryDetailsLayout->addWidget (languageButton, 1, 1);
    languageLabel->setBuddy (languageButton);
    TQWhatsThis::add (languageButton, i18n("With this combo box you select the language associated with the selected dictionary."));
    
    loadLanguageList(languageButton);
    languageButton->insertLanguage("??", i18n("Other"), TQString::fromLatin1("l10n/"), TQString());
    
   connect (languageButton, TQ_SIGNAL(activated(int)), this, TQ_SLOT(languageButton_activated(int)));
}

void WordCompletionUI::languageButton_activated (int) {
   if (languageButton->currentTag() == "??") {
     TQString customLanguage = KInputDialog::getText(i18n("Create Custom Language"), i18n("Please enter the code for the custom language:"));
     
     if (languageButton->containsTag(customLanguage)) {
        languageButton->setCurrentItem(customLanguage);
     }
     else {
        languageButton->insertLanguage(customLanguage, i18n("without name"), TQString::fromLatin1("l10n/"), TQString());
        languageButton->setCurrentItem(customLanguage);
     }
   }
}