diff --git a/src/lib/other/siteinfopermissionitem.cpp b/src/lib/other/siteinfopermissionitem.cpp index 79de28a6b..3eb00a4cd 100644 --- a/src/lib/other/siteinfopermissionitem.cpp +++ b/src/lib/other/siteinfopermissionitem.cpp @@ -91,6 +91,8 @@ void SiteInfoPermissionItem::setPermission(SiteSettingsManager::Permission permi qWarning() << "Unknown permission" << permission; m_ui->radioDefault->setChecked(true); } + + m_ui->labelDefaultPermission->setText(mApp->siteSettingsManager()->getPermissionName(mApp->siteSettingsManager()->getDefaultPermission(m_option))); } SiteSettingsManager::Permission SiteInfoPermissionItem::permission() const diff --git a/src/lib/other/siteinfopermissionitem.ui b/src/lib/other/siteinfopermissionitem.ui index 053661887..e05fbabeb 100644 --- a/src/lib/other/siteinfopermissionitem.ui +++ b/src/lib/other/siteinfopermissionitem.ui @@ -33,6 +33,16 @@ + + + + false + + + + + + diff --git a/src/lib/other/sitesettingsmanager.cpp b/src/lib/other/sitesettingsmanager.cpp index 7b0ea2c6c..cddae20a1 100644 --- a/src/lib/other/sitesettingsmanager.cpp +++ b/src/lib/other/sitesettingsmanager.cpp @@ -447,3 +447,20 @@ QString SiteSettingsManager::getOptionName(const QWebEnginePage::Feature& featur { return getOptionName(optionFromWebEngineFeature(feature)); } + +QString SiteSettingsManager::getPermissionName(const SiteSettingsManager::Permission permission) +{ + switch (permission) { + case Allow: + return QSL("Allow"); + case Ask: + return QSL("ASK"); + case Deny: + return QSL("Deny"); + case Default: + return QSL("Default"); + default: + qWarning() << "Uknown permission" << permission; + return QSL("Unknown"); + } +} diff --git a/src/lib/other/sitesettingsmanager.h b/src/lib/other/sitesettingsmanager.h index 72c3cacf3..c6347429e 100644 --- a/src/lib/other/sitesettingsmanager.h +++ b/src/lib/other/sitesettingsmanager.h @@ -112,6 +112,8 @@ public: QString getOptionName(const SiteSettingsManager::PageOptions &option); QString getOptionName(const QWebEnginePage::Feature &feature); + QString getPermissionName(const Permission permission); + private: QString optionToSqlColumn(const PageOptions &option); bool getDefaultOptionValue(const PageOptions &option);