18#include "moc_qgsauthcerttrustpolicycombobox.cpp"
32 QList<QPair<QgsAuthCertUtils::CertTrustPolicy, QString>> policies;
37 for (
int i = 0; i < policies.size(); i++ )
40 const QString name = policies.at( i ).second;
41 addItem( name, QVariant(
static_cast<int>( polcy ) ) );
51 connect(
this,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsAuthCertTrustPolicyComboBox::highlightCurrentIndex );
69 const int idx = findData( QVariant(
static_cast<int>( policy ) ) );
70 setCurrentIndex( idx == -1 ? 0 : idx );
76 setItemText( idx, defaultTrustText( defaultpolicy ) );
79void QgsAuthCertTrustPolicyComboBox::highlightCurrentIndex(
int indx )
117 return QStringLiteral(
"%1 (%2)" )
static QgsAuthManager * authManager()
Returns the application's authentication manager instance.
QgsAuthCertUtils::CertTrustPolicy trustPolicyForIndex(int indx)
Gets trust policy for a given index of combobox.
QgsAuthCertUtils::CertTrustPolicy trustPolicy()
Gets currently set trust policy.
void setDefaultTrustPolicy(QgsAuthCertUtils::CertTrustPolicy defaultpolicy)
Sets default trust policy.
void setTrustPolicy(QgsAuthCertUtils::CertTrustPolicy policy)
Sets current trust policy.
QgsAuthCertTrustPolicyComboBox(QWidget *parent=nullptr, QgsAuthCertUtils::CertTrustPolicy policy=QgsAuthCertUtils::DefaultTrust, QgsAuthCertUtils::CertTrustPolicy defaultpolicy=QgsAuthCertUtils::DefaultTrust)
Construct a combo box for defining certificate trust policy.
static QString getCertTrustName(QgsAuthCertUtils::CertTrustPolicy trust)
Gets the general name for certificate trust.
CertTrustPolicy
Type of certificate trust policy.
static QString greenTextStyleSheet(const QString &selector="*")
Green text stylesheet representing valid, trusted, etc. certificate.
static QColor greenColor()
Green color representing valid, trusted, etc. certificate.
static QString redTextStyleSheet(const QString &selector="*")
Red text stylesheet representing invalid, untrusted, etc. certificate.
static QColor redColor()
Red color representing invalid, untrusted, etc. certificate.
QgsAuthCertUtils::CertTrustPolicy defaultCertTrustPolicy()
Gets the default certificate trust policy preferred by user.
#define QgsDebugMsgLevel(str, level)