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