26 using namespace Kontact;
28 #include <KontactInterface/Core>
29 #include <KontactInterface/Plugin>
32 #include <KComponentData>
34 #include <KTextBrowser>
43 setCaption( i18n(
"About Kontact" ) );
45 setDefaultButton( Close );
47 showButtonSeparator(
true );
48 setFaceType( KPageDialog::List );
49 addAboutData( i18n(
"Kontact Container" ), QLatin1String(
"kontact" ),
50 KGlobal::mainComponent().aboutData() );
55 for ( ; it != end; ++it ) {
61 setInitialSize( QSize( 600, 400 ) );
62 restoreDialogSize( KConfigGroup( KGlobal::config(),
"AboutDialog" ) );
63 connect(
this, SIGNAL(finished(
int)),
this, SLOT(saveSize()) );
66 void AboutDialog::saveSize()
68 KConfigGroup group( KGlobal::config(),
"AboutDialog" );
69 saveDialogSize( group );
75 addAboutData( plugin->title(), plugin->icon(), plugin->aboutData() );
79 const KAboutData *about )
81 QIcon pixmap = KIcon( icon );
84 KPageWidgetItem *pageItem =
new KPageWidgetItem( topFrame, title );
85 pageItem->setIcon( KIcon( pixmap ) );
89 QBoxLayout *topLayout =
new QVBoxLayout( topFrame );
92 QLabel *label =
new QLabel( i18n(
"No about information available." ), topFrame );
93 topLayout->addWidget( label );
97 text += QLatin1String(
"<p>");
98 text += QLatin1String(
"<b>") + about->programName() + QLatin1String(
"</b>");
99 text += QLatin1String(
"<br>");
101 text += i18n(
"Version %1", about->version() );
102 text += QLatin1String(
"</p>");
104 if ( !about->shortDescription().isEmpty() ) {
105 text += QLatin1String(
"<p>") + about->shortDescription() +QLatin1String(
"<br>") +
106 about->copyrightStatement() + QLatin1String(
"</p>");
109 QString home = about->homepage();
110 if ( !home.isEmpty() ) {
111 text += QLatin1String(
"<a href=\"") + home + QLatin1String(
"\">") + home + QLatin1String(
"</a><br>");
114 text.replace( QLatin1Char(
'\n'), QLatin1String(
"<br>") );
117 label->setAlignment( Qt::AlignTop );
118 label->setOpenExternalLinks(
true);
119 label->setTextInteractionFlags(
120 Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard | Qt::LinksAccessibleByMouse );
121 topLayout->addWidget( label );
123 KTextBrowser *personView =
new KTextBrowser( topFrame );
124 personView->setReadOnly(
true );
125 topLayout->addWidget( personView, 1 );
129 if ( !authors.isEmpty() ) {
130 text += i18n(
"<p><b>Authors:</b></p>" );
134 for ( it = authors.begin(); it != end; ++it ) {
135 text +=
formatPerson( (*it).name(), (*it).emailAddress() );
136 if ( !(*it).task().isEmpty() ) {
137 text += QLatin1String(
"<i>") + (*it).task() + QLatin1String(
"</i><br>");
143 if ( !credits.isEmpty() ) {
144 text += i18n(
"<p><b>Thanks to:</b></p>" );
148 for ( it = credits.begin(); it != end; ++it ) {
149 text +=
formatPerson( (*it).name(), (*it).emailAddress() );
150 if ( !(*it).task().isEmpty() ) {
151 text += QLatin1String(
"<i>") + (*it).task() + QLatin1String(
"</i><br>");
157 if ( !translators.isEmpty() ) {
158 text += i18n(
"<p><b>Translators:</b></p>" );
162 for ( it = translators.begin(); it != end; ++it ) {
163 text +=
formatPerson( (*it).name(), (*it).emailAddress() );
167 text += i18n(
"<br /><br />\
168 <i>This Free Software product was improved as part of a commercial project:</i>\
170 Project Kowi (March 2007 - )<br /><br />\
172 <b>Production / Project Coordination</b><br />\
173 Bernhard Reiter<br />\
174 <b>Director of Development</b><br />\
178 <table border=\"0\" width=\"100%\"> \
181 <b>Osnabrück Unit, Intevation GmbH</b>\
187 Senior QA, Packaging<br />\
189 Additional NSIS<br />\
193 Bernhard Reiter<br />\
194 Bernhard Herzog<br />\
196 Emanuel Schütze<br />\
197 Dr. Jan-Oliver Wagner\
203 <table border=\"0\" width=\"100%\">\
206 <b>Berlin Unit, Klarälvdalens Datakonsult AB</b>\
214 Additional D. + Crypto<br />\
215 Crypto GUI Development\
219 Jaroslaw Staniek<br />\
221 Frank Osterfeld<br />\
228 <table border=\"0\" width=\"100%\">\
231 <b>Düsseldorf Unit, g10 Code GmbH</b>\
236 Crypto-Backend Porting<br />\
247 <table border=\"0\" width=\"100%\">\
250 <b>External QA Darmstadt, basysKom GmbH</b>\
261 </table><br /><br />");
263 personView->setText( text );
270 if ( !email.isEmpty() ) {
271 text += QLatin1String(
" <<a href=\"mailto:") + email + QLatin1String(
"\">") + email + QLatin1String(
"</a>>");
274 text += QLatin1String(
"<br>");
280 if ( !about || about->license().isEmpty() ) {
284 QPixmap pixmap = KIconLoader::global()->loadIcon( QLatin1String(
"help-about"),
285 KIconLoader::Desktop, 48 );
287 const QString title = i18n(
"%1 License", about->programName() );
290 KPageWidgetItem *page =
new KPageWidgetItem( topFrame, title );
291 page->setIcon( KIcon( pixmap ) );
293 QBoxLayout *topLayout =
new QVBoxLayout( topFrame );
295 KTextBrowser *textBrowser =
new KTextBrowser( topFrame );
296 textBrowser->setHtml( QString::fromLatin1(
"<pre>%1</pre>" ).arg( about->license() ) );
298 topLayout->addWidget( textBrowser );
301 #include "aboutdialog.moc"
void addAboutData(const QString &title, const QString &icon, const KAboutData *about)
virtual QByteArray text(quint32 serialNumber) const =0
void addAboutPlugin(KontactInterface::Plugin *plugin)
QString formatPerson(const QString &name, const QString &email)
void addLicenseText(const KAboutData *about)
AboutDialog(KontactInterface::Core *core)