예제 #1
0
파일: about.cpp 프로젝트: pnkfelix/glx-gle
QWidget* AboutBox::createContributorsPanel()
{
	QString html(tr(""
	"<h2>Contributors</h2>"
	"<p>"
	"The following people have given their time and talent to help support the GLE/QGLE effort (in alphabetical order)."
	"</p>"
	""
	"<ul>"
	"<li>A. S. Budden: programming (QGLE), packager for Arch Linux</li>"
	"<li>Andrey G. Grozin: packager for Gentoo Linux</li>"
	"<li>Axel Rohde: 3.3f-h versions (these were 32 bit DOS and OS/2 ports)</li>"
	"<li>Bryn Jeffries: programming (Linux)</li>"
	"<li>Chris Pugmire: original program creation and design</li>"
	"<li>Christoph Brendes: programming</li>"
	"<li>David Parfitt: documentation (GLE users guide)</li>"
	"<li>Edd Edmondson: packager for Mac OS/X"
	"<li>Jan Struyf: programming (and current 4.x series maintainer)</li>"
	"<li>Laurence Abbott: programming</li>"
	"<li>Michal Vyskocil: packager for openSUSE</li>"
	"<li>Stephen Blundell: documentation (GLE users guide)</li>"
	"<li>Steve Wilkinson: programming (user interface)</li>"
	"<li>Terje R&oslash;sten: packager for Fedora Core</li>"
	"<li>Vincent LaBella: resurrected 3.3h to GLE 4.0 C++ code base</li>"
	"<li>Zbigniew Kisiel: testing</li>"
	"</ul>"
	"<p>&nbsp;</p>"
	""));
	QTextBrowser* label = new QTextBrowser();
	label->setOpenLinks(false);
	label->setHtml(html);
	return label;
}
예제 #2
0
 OpenLinksFromFileSystem::OpenLinksFromFileSystem(QObject *parent) :
     QObject(parent)
 {
     QTextBrowser * TextBrowser = qobject_cast<QTextBrowser *>(parent);
     TextBrowser->setOpenExternalLinks(false);
     TextBrowser->setOpenLinks(false);
     connect(TextBrowser,SIGNAL(anchorClicked(QUrl)),this,SLOT(AnchorClicked(QUrl)));
 }
예제 #3
0
//-----------------------------------------------------------------------------
QWidget* QmitkCmdLineModuleGui::getGui()
{
  if (!d->m_TopLevelWidget)
  {
    // Construct additional widgets to contain full GUI.
    QWidget *aboutBoxContainerWidget = new QWidget();

    ctkCollapsibleGroupBox *aboutBox = new ctkCollapsibleGroupBox(aboutBoxContainerWidget);
    aboutBox->setTitle("About");

    QTextBrowser *aboutBrowser = new QTextBrowser(aboutBox);
    aboutBrowser->setReadOnly(true);
    aboutBrowser->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
    aboutBrowser->setOpenExternalLinks(true);
    aboutBrowser->setOpenLinks(true);

    QVBoxLayout *aboutLayout = new QVBoxLayout(aboutBox);
    aboutLayout->addWidget(aboutBrowser);

    QVBoxLayout *aboutBoxContainerWidgetLayout = new QVBoxLayout(aboutBoxContainerWidget);
    aboutBoxContainerWidgetLayout->addWidget(aboutBox);

    QWidget *helpBoxContainerWidget = new QWidget();

    ctkCollapsibleGroupBox *helpBox = new ctkCollapsibleGroupBox();
    helpBox->setTitle("Help");

    QTextBrowser *helpBrowser = new QTextBrowser(helpBox);
    helpBrowser->setReadOnly(true);
    helpBrowser->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
    helpBrowser->setOpenExternalLinks(true);
    helpBrowser->setOpenLinks(true);

    QVBoxLayout *helpLayout = new QVBoxLayout(helpBox);
    helpLayout->addWidget(helpBrowser);

    QVBoxLayout *helpBoxContainerWidgetLayout = new QVBoxLayout(helpBoxContainerWidget);
    helpBoxContainerWidgetLayout->addWidget(helpBox);

    QObject* guiHandle = this->guiHandle();
    QWidget* generatedGuiWidgets = qobject_cast<QWidget*>(guiHandle);

    QWidget *topLevelWidget = new QWidget();

    QGridLayout *topLevelLayout = new QGridLayout(topLevelWidget);
    topLevelLayout->setContentsMargins(0,0,0,0);
    topLevelLayout->setSpacing(0);
    topLevelLayout->addWidget(aboutBoxContainerWidget, 0, 0);
    topLevelLayout->addWidget(helpBoxContainerWidget, 1, 0);
    topLevelLayout->addWidget(generatedGuiWidgets, 2, 0);

    ctkCmdLineModuleDescription description = this->moduleReference().description();

    QString helpString = "";

    if (!description.title().isEmpty())
    {
      QString titleHtml = "<h1>" + description.title() + "</h1>";
      helpString += titleHtml;
    }

    if (!description.description().isEmpty())
    {
      QString descriptionHtml = "<p>" + description.description() + "</p>";
      helpString += descriptionHtml;
    }

    if (!description.documentationURL().isEmpty())
    {
      QString docUrlHtml = "<p>For more information please see <a href=\"" + description.documentationURL()
          + "\">" + description.documentationURL() + "</a></p>";
      helpString += docUrlHtml;
    }

    QString aboutString = "";

    if (!description.title().isEmpty())
    {
      QString titleHtml = "<h1>" + description.title() + "</h1>";
      aboutString += titleHtml;
    }

    if (!description.contributor().isEmpty())
    {
      QString contributorHtml = "<h2>Contributed By</h2><p>" + description.contributor() + "</p>";
      aboutString += contributorHtml;
    }

    if (!description.license().isEmpty())
    {
      QString licenseHtml = "<h2>License</h2><p>" + description.license() + "</p>";
      aboutString += licenseHtml;
    }

    if (!description.acknowledgements().isEmpty())
    {
      QString acknowledgementsHtml = "<h2>Acknowledgements</h2><p>" + description.acknowledgements() + "</p>";
      aboutString += acknowledgementsHtml;
    }

    helpBrowser->clear();
    helpBrowser->setHtml(helpString);
    helpBox->setCollapsed(true);

    aboutBrowser->clear();
    aboutBrowser->setHtml(aboutString);
    aboutBox->setCollapsed(true);

    d->m_TopLevelWidget.reset(topLevelWidget);
  }

  return d->m_TopLevelWidget.data();
}
예제 #4
0
void OpenconnectAuthWidget::validatePeerCert(const QString &fingerprint,
                                             const QString &peerCert, const QString &reason, bool *accepted)
{
    Q_D(OpenconnectAuthWidget);

    const QString host = QLatin1String(openconnect_get_hostname(d->vpninfo));
    const QString port = QString::number(openconnect_get_port(d->vpninfo));
    const QString key = QString("certificate:%1:%2").arg(host,  port);
    const QString value = d->secrets.value(key);

#if !OPENCONNECT_CHECK_VER(5,0)
#define openconnect_check_peer_cert_hash(v,d) strcmp(d, fingerprint.toUtf8().data())
#endif

    if (openconnect_check_peer_cert_hash(d->vpninfo, value.toUtf8().data())) {
        QWidget *widget = new QWidget();
        QVBoxLayout *verticalLayout;
        QHBoxLayout *horizontalLayout;
        QLabel *icon;
        QLabel *infoText;
        QTextBrowser *certificate;

        verticalLayout = new QVBoxLayout(widget);
        horizontalLayout = new QHBoxLayout(widget);
        icon = new QLabel(widget);
        QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
        sizePolicy.setHorizontalStretch(0);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(icon->sizePolicy().hasHeightForWidth());
        icon->setSizePolicy(sizePolicy);
        icon->setMinimumSize(QSize(48, 48));
        icon->setMaximumSize(QSize(48, 48));

        horizontalLayout->addWidget(icon);

        infoText = new QLabel(widget);
        infoText->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);

        horizontalLayout->addWidget(infoText);

        verticalLayout->addLayout(horizontalLayout);

        certificate = new QTextBrowser(widget);
        certificate->setTextInteractionFlags(Qt::TextSelectableByMouse);
        certificate->setOpenLinks(false);

        verticalLayout->addWidget(certificate);

        icon->setPixmap(QIcon::fromTheme("dialog-information").pixmap(KIconLoader::SizeLarge));
        infoText->setText(i18n("Check failed for certificate from VPN server \"%1\".\n"
                               "Reason: %2\nAccept it anyway?", openconnect_get_hostname(d->vpninfo),reason));
        infoText->setWordWrap(true);
        certificate->setText(peerCert);

        QPointer<QDialog> dialog = new QDialog(this);
        dialog.data()->setWindowModality(Qt::WindowModal);
        dialog->setLayout(new QVBoxLayout);
        QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, dialog);
        connect(buttons, &QDialogButtonBox::accepted, dialog.data(), &QDialog::accept);
        connect(buttons, &QDialogButtonBox::rejected, dialog.data(), &QDialog::reject);
        dialog->layout()->addWidget(widget);
        dialog->layout()->addWidget(buttons);
        if(dialog.data()->exec() == QDialog::Accepted) {
            *accepted = true;
        } else {
            *accepted = false;
        }
        if (dialog) {
            dialog.data()->deleteLater();
        }
        widget->deleteLater();
    } else {
        *accepted = true;
    }
    if (*accepted) {
        d->secrets.insert(key, QString(fingerprint));
    }
    d->mutex.lock();
    d->workerWaiting.wakeAll();
    d->mutex.unlock();
}