diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch) | |
tree | d3bb9f5d25a2dc09ca81adecf39621d871534297 /kwordquiz/src/dlglanguage.cpp | |
download | tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwordquiz/src/dlglanguage.cpp')
-rw-r--r-- | kwordquiz/src/dlglanguage.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/kwordquiz/src/dlglanguage.cpp b/kwordquiz/src/dlglanguage.cpp new file mode 100644 index 00000000..97a8e6c1 --- /dev/null +++ b/kwordquiz/src/dlglanguage.cpp @@ -0,0 +1,79 @@ +/*************************************************************************** + dlglanguage.cpp - description + ------------------- + copyright : (C) 2004 by Peter Hedlund + email : peter.hedlund@kdemail.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <klocale.h> +#include <klineedit.h> +#include <kiconloader.h> + +#include <qlabel.h> + +#include "prefs.h" +#include "dlglanguage.h" + +DlgLanguage::DlgLanguage(QWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Column Titles"), Ok|Cancel, Ok, parent, name, modal, true) +{ + dlgBase = new DlgLanguageBase( this, "Dlg" ); + setMainWidget(dlgBase); + dlgBase -> picLanguage1 -> setPixmap(KGlobal::iconLoader()->loadIcon("question", KIcon::Panel)); + dlgBase -> picLanguage2 -> setPixmap(KGlobal::iconLoader()->loadIcon("answer", KIcon::Panel)); + + completion1 = new KCompletion(); + completion1->setItems(Prefs::columnTitles1()); + dlgBase -> txtLanguage1->setCompletionObject(completion1); + + completion2 = new KCompletion(); + completion2->setItems(Prefs::columnTitles2()); + dlgBase -> txtLanguage2->setCompletionObject(completion2); + + dlgBase->txtLanguage1->setFocus(); +} + + +DlgLanguage::~DlgLanguage() +{ + delete completion1; + delete completion2; +} + + +void DlgLanguage::setLanguage(int index, const QString &lang) { + if (index == 1) { + dlgBase->txtLanguage1 -> setText(lang); + } + else + { + dlgBase->txtLanguage2 -> setText(lang); + } +} + + +QString DlgLanguage::Language(int index){ + if (index == 1) { + completion1->addItem(dlgBase->txtLanguage1 -> text()); + Prefs::setColumnTitles1(completion1->items()); + return dlgBase->txtLanguage1 -> text(); + } + else + { + completion2->addItem(dlgBase->txtLanguage2 -> text()); + Prefs::setColumnTitles2(completion2->items()); + return dlgBase->txtLanguage2 -> text(); + } +} + + + +#include "dlglanguage.moc" |