Vidalia  0.2.21
LicenseDialog.cpp
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 /*
12 ** \file LicenseDialog.cpp
13 ** \brief Displays HTML-formatted license information for Vidalia and related
14 ** software.
15 */
16 
17 #include "LicenseDialog.h"
18 
19 #include <QFile>
20 #include <QString>
21 
22 
24  : QDialog(parent)
25 {
26  ui.setupUi(this);
27 
28  ui.txtLicense->setHtml(loadHtml(":/docs/license.html"));
29  ui.txtCredits->setHtml(loadHtml(":/docs/credits.html"));
30 }
31 
32 QString
33 LicenseDialog::loadHtml(const QString &source) const
34 {
35  QFile file(source);
36  if (! file.open(QIODevice::ReadOnly | QIODevice::Text))
37  return QString();
38  return QString(file.readAll());
39 }
40