KNewStuff
kdxstranslation.cpp
Go to the documentation of this file.
00001 /* 00002 This file is part of KNewStuff2. 00003 Copyright (c) 2006, 2007 Josef Spillner <spillner@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #include "kdxstranslation.h" 00020 00021 #include <QtGui/QLabel> 00022 #include <QtGui/QLayout> 00023 00024 #include <kcombobox.h> 00025 #include <klineedit.h> 00026 #include <klocale.h> 00027 #include <ktextedit.h> 00028 #include <kurlrequester.h> 00029 00030 KDXSTranslation::KDXSTranslation(QWidget *parent) 00031 : KDialog(parent) 00032 { 00033 setCaption(i18n("Translate this entry")); 00034 setButtons(KDialog::Ok | KDialog::Cancel); 00035 00036 QWidget *root = new QWidget(this); 00037 setMainWidget(root); 00038 00039 m_name = new KLineEdit(root); 00040 m_description = new KTextEdit(root); 00041 m_payload = new KUrlRequester(root); 00042 00043 KLineEdit *oname = new KLineEdit(root); 00044 KTextEdit *odescription = new KTextEdit(root); 00045 00046 QLabel *lname = new QLabel(i18n("Name"), root); 00047 QLabel *ldescription = new QLabel(i18n("Description"), root); 00048 QLabel *lpayload = new QLabel(i18n("Payload"), root); 00049 00050 KComboBox *languagebox = new KComboBox(root); 00051 languagebox->addItem("English"); 00052 languagebox->addItem("German"); 00053 00054 oname->setEnabled(false); 00055 odescription->setEnabled(false); 00056 00057 QVBoxLayout *vbox = new QVBoxLayout(root); 00058 00059 QHBoxLayout *hbox = new QHBoxLayout(); 00060 hbox->addStretch(1); 00061 hbox->addWidget(languagebox); 00062 00063 QGridLayout *grid = new QGridLayout(); 00064 grid->addWidget(lname, 0, 0); 00065 grid->addWidget(oname, 0, 1); 00066 grid->addWidget(m_name, 0, 2); 00067 grid->addWidget(ldescription, 1, 0); 00068 grid->addWidget(odescription, 1, 1); 00069 grid->addWidget(m_description, 1, 2); 00070 grid->addWidget(lpayload, 2, 0); 00071 grid->addWidget(m_payload, 2, 2); 00072 00073 vbox->addLayout(hbox); 00074 vbox->addLayout(grid); 00075 } 00076 00077 #include "kdxstranslation.moc"
KDE 4.6 API Reference