KNewStuff
kdxschanges.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 "kdxschanges.h"
00022
00023 #include <klocale.h>
00024 #include <ktextbrowser.h>
00025
00026 #include <QtGui/QTextDocument>
00027 #include <QtGui/QLayout>
00028 #include <QtGui/QApplication>
00029
00030 KDXSChanges::KDXSChanges(QWidget *parent)
00031 : KDialog(parent)
00032 {
00033 setCaption(i18n("Changelog"));
00034 setButtons(KDialog::Close);
00035
00036 QVBoxLayout *vbox;
00037
00038 m_log = new KTextBrowser(this);
00039 setMainWidget(m_log);
00040
00041 vbox = new QVBoxLayout(m_log);
00042 vbox->addWidget(m_log);
00043 }
00044
00045 void KDXSChanges::addChangelog(const QString& version, const QString& log)
00046 {
00047 QString t = QLatin1String("<qt>");
00048
00049 t += m_log->toHtml();
00050
00051 t += QLatin1String("<table class='itemBox'>")
00052 + "<tr>"
00053 + "<td class='contentsColumn'>"
00054 + "<table class='contentsHeader' cellspacing='2' cellpadding='0'><tr>"
00055 + "<td>" + i18n("Version %1", Qt::escape(version)) + "</td>"
00056 + "</tr></table>"
00057 + "<div class='contentsBody'>"
00058 + Qt::escape(log)
00059 + "</div>";
00060
00061 m_log->setHtml(t);
00062 }
00063
00064 #include "kdxschanges.moc"