Vidalia 0.2.15
LicenseDialog.cpp
Go to the documentation of this file.
00001 /*
00002 **  This file is part of Vidalia, and is subject to the license terms in the
00003 **  LICENSE file, found in the top level directory of this distribution. If you
00004 **  did not receive the LICENSE file with this file, you may obtain it from the
00005 **  Vidalia source package distributed by the Vidalia Project at
00006 **  http://www.torproject.org/projects/vidalia.html. No part of Vidalia, 
00007 **  including this file, may be copied, modified, propagated, or distributed 
00008 **  except according to the terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file LicenseDialog.cpp
00013 ** \brief Displays HTML-formatted license information for Vidalia and related
00014 ** software.
00015 */
00016 
00017 #include "LicenseDialog.h"
00018 
00019 #include <QFile>
00020 #include <QString>
00021 
00022 
00023 LicenseDialog::LicenseDialog(QWidget *parent)
00024   : QDialog(parent)
00025 {
00026   ui.setupUi(this);
00027 
00028   ui.txtLicense->setHtml(loadHtml(":/docs/license.html"));
00029   ui.txtCredits->setHtml(loadHtml(":/docs/credits.html"));
00030 }
00031 
00032 QString
00033 LicenseDialog::loadHtml(const QString &source) const
00034 {
00035   QFile file(source);
00036   if (! file.open(QIODevice::ReadOnly | QIODevice::Text))
00037     return QString();
00038   return QString(file.readAll());
00039 }
00040