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 #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"