KNewStuff
kdxstranslation.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 #include "kdxstranslation.h"
00022
00023 #include <QtGui/QComboBox>
00024 #include <QtGui/QLabel>
00025 #include <QtGui/QLayout>
00026
00027 #include <klineedit.h>
00028 #include <klocale.h>
00029 #include <ktextedit.h>
00030 #include <kurlrequester.h>
00031
00032 KDXSTranslation::KDXSTranslation(QWidget *parent)
00033 : KDialog(parent)
00034 {
00035 setCaption(i18n("Translate this entry"));
00036 setButtons(KDialog::Ok | KDialog::Cancel);
00037
00038 QWidget *root = new QWidget(this);
00039 setMainWidget(root);
00040
00041 m_name = new KLineEdit(root);
00042 m_description = new KTextEdit(root);
00043 m_payload = new KUrlRequester(root);
00044
00045 KLineEdit *oname = new KLineEdit(root);
00046 KTextEdit *odescription = new KTextEdit(root);
00047
00048 QLabel *lname = new QLabel(i18n("Name"), root);
00049 QLabel *ldescription = new QLabel(i18n("Description"), root);
00050 QLabel *lpayload = new QLabel(i18n("Payload"), root);
00051
00052 QComboBox *languagebox = new QComboBox(root);
00053 languagebox->addItem("English");
00054 languagebox->addItem("German");
00055
00056 oname->setEnabled(false);
00057 odescription->setEnabled(false);
00058
00059 QVBoxLayout *vbox = new QVBoxLayout(root);
00060
00061 QHBoxLayout *hbox = new QHBoxLayout();
00062 hbox->addStretch(1);
00063 hbox->addWidget(languagebox);
00064
00065 QGridLayout *grid = new QGridLayout();
00066 grid->setSpacing(spacingHint());
00067 grid->addWidget(lname, 0, 0);
00068 grid->addWidget(oname, 0, 1);
00069 grid->addWidget(m_name, 0, 2);
00070 grid->addWidget(ldescription, 1, 0);
00071 grid->addWidget(odescription, 1, 1);
00072 grid->addWidget(m_description, 1, 2);
00073 grid->addWidget(lpayload, 2, 0);
00074 grid->addWidget(m_payload, 2, 2);
00075
00076 vbox->addLayout(hbox);
00077 vbox->addLayout(grid);
00078 }
00079
00080 #include "kdxstranslation.moc"