mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Show current default value beside the default option in site info
Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
9f6527ce21
commit
226c1acbd1
|
@ -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
|
||||
|
|
|
@ -33,6 +33,16 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelDefaultPermission">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user