1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

AboutDialog: Fix showing authors page

This commit is contained in:
David Rosca 2015-11-08 19:36:02 +01:00
parent 0e52711a07
commit 999bfd3b9a
2 changed files with 10 additions and 8 deletions

View File

@ -28,8 +28,9 @@
#include <QWebEngineProfile>
AboutDialog::AboutDialog(QWidget* parent)
: QDialog(parent),
ui(new Ui::AboutDialog)
: QDialog(parent)
, ui(new Ui::AboutDialog)
, m_showingAuthors(false)
{
setAttribute(Qt::WA_DeleteOnClose);
@ -53,16 +54,15 @@ AboutDialog::AboutDialog(QWidget* parent)
void AboutDialog::buttonClicked()
{
if (ui->authorsButton->text() == tr("Authors and Contributors")) {
showAuthors();
}
else if (ui->authorsButton->text() == tr("< About QupZilla")) {
if (m_showingAuthors)
showAbout();
}
else
showAuthors();
}
void AboutDialog::showAbout()
{
m_showingAuthors = false;
ui->authorsButton->setText(tr("Authors and Contributors"));
if (m_aboutHtml.isEmpty()) {
m_aboutHtml += "<center><div style='margin:10px;'>";
@ -75,7 +75,7 @@ void AboutDialog::showAbout()
);
m_aboutHtml += tr("<b>QtWebEngine version %1</b></p>").arg(QT_VERSION_STR);
m_aboutHtml += QString("<p>&copy; %1 %2<br/>").arg(Qz::COPYRIGHT, Qz::AUTHOR);
m_aboutHtml += QString("<p><a href=%1>%1</a></p>").arg(Qz::WWWADDRESS);
m_aboutHtml += QString("<a href=%1>%1</a></p>").arg(Qz::WWWADDRESS);
m_aboutHtml += "<p>" + mApp->userAgentManager()->defaultUserAgent() + "</p>";
m_aboutHtml += "</div></center>";
}
@ -84,6 +84,7 @@ void AboutDialog::showAbout()
void AboutDialog::showAuthors()
{
m_showingAuthors = true;
ui->authorsButton->setText(tr("< About QupZilla"));
if (m_authorsHtml.isEmpty()) {
m_authorsHtml += "<center><div style='margin:10px;'>";

View File

@ -45,6 +45,7 @@ private:
QString m_aboutHtml;
QString m_authorsHtml;
bool m_showingAuthors;
};
#endif // ABOUTDIALOG_H