Vidalia 0.2.10
|
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.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file LicenseDialog.cpp 00013 ** \version $Id: LicenseDialog.cpp 3735 2009-04-28 20:28:01Z edmanm $ 00014 ** \brief Displays HTML-formatted license information for Vidalia and related 00015 ** software. 00016 */ 00017 00018 #include "LicenseDialog.h" 00019 00020 #include <QFile> 00021 #include <QString> 00022 00023 00024 LicenseDialog::LicenseDialog(QWidget *parent) 00025 : QDialog(parent) 00026 { 00027 ui.setupUi(this); 00028 00029 ui.txtLicense->setHtml(loadHtml(":/docs/license.html")); 00030 ui.txtCredits->setHtml(loadHtml(":/docs/credits.html")); 00031 } 00032 00033 QString 00034 LicenseDialog::loadHtml(const QString &source) const 00035 { 00036 QFile file(source); 00037 if (! file.open(QIODevice::ReadOnly | QIODevice::Text)) 00038 return QString(); 00039 return QString(file.readAll()); 00040 } 00041