about_dialog.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------
00007 //---------------------------------------------------
00008 
00009 #include "about_dialog.h"
00010 
00011 #include <QTextDocument>
00012 #include <QFile>
00013 #include <QTextCodec>
00014 
00015 namespace imedgine
00016 {
00017 
00018   //---------------------------------------------------
00019 
00020         AboutDialog::AboutDialog(QWidget* parent)
00021   : QDialog(parent)
00022   {
00023     setupUi(this);
00024     initializeGUI();
00025   }
00026 
00027   //---------------------------------------------------
00028 
00029   AboutDialog::~AboutDialog()
00030   {
00031   }
00032 
00033   //---------------------------------------------------
00034 
00035   void AboutDialog::initializeGUI()
00036   {
00037     content_tab_widget_->setCurrentIndex(0);
00038 
00039     QFile about_resource(":/text/about.html");
00040     about_resource.open(QIODevice::ReadOnly | QIODevice::Text);
00041     const QByteArray about_text_data = about_resource.readAll();
00042     about_resource.close();
00043     const QString about_html =
00044       QTextCodec::codecForHtml(about_text_data)->toUnicode(about_text_data);
00045     about_label_->setText(about_html);
00046 
00047     QFile authors_resource(":/text/authors.html");
00048     authors_resource.open(QIODevice::ReadOnly | QIODevice::Text);
00049     const QByteArray authors_text_data = authors_resource.readAll();
00050     authors_resource.close();
00051     const QString authors_html =
00052       QTextCodec::codecForHtml(authors_text_data)->toUnicode(authors_text_data);
00053     authors_text_edit_->setHtml(authors_html);
00054 
00055     QFile thanks_resource(":/text/thanks.html");
00056     thanks_resource.open(QIODevice::ReadOnly | QIODevice::Text);
00057     const QByteArray thanks_text_data = thanks_resource.readAll();
00058     thanks_resource.close();
00059     const QString thanks_html =
00060       QTextCodec::codecForHtml(thanks_text_data)->toUnicode(thanks_text_data);
00061     thanks_text_edit_->setHtml(thanks_html);
00062 
00063     QFile licence_resource(":/text/gpl.txt");
00064     licence_resource.open(QIODevice::ReadOnly | QIODevice::Text);
00065     const QByteArray licence_text_data = licence_resource.readAll();
00066     licence_resource.close();
00067     const QString licence_html = licence_text_data;
00068       //QTextCodec::codecForText(licence_text_data)->toUnicode(licence_text_data);
00069     licence_text_edit_->setPlainText(licence_html);
00070   }
00071 
00072 }

Generated on Sun Aug 13 18:19:39 2006 for iMEDgine by  doxygen 1.4.6