18#include "moc_qgsauthcerttrustpolicycombobox.cpp"
34 QList < QPair<QgsAuthCertUtils::CertTrustPolicy, QString> > policies;
36 defaultTrustText( defaultpolicy ) )
42 for (
int i = 0; i < policies.size(); i++ )
45 const QString name = policies.at( i ).second;
46 addItem( name, QVariant(
static_cast<int>( polcy ) ) );
56 connect(
this,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
57 this, &QgsAuthCertTrustPolicyComboBox::highlightCurrentIndex );
75 const int idx = findData( QVariant(
static_cast<int>( policy ) ) );
76 setCurrentIndex( idx == -1 ? 0 : idx );
82 setItemText( idx, defaultTrustText( defaultpolicy ) );
85void QgsAuthCertTrustPolicyComboBox::highlightCurrentIndex(
int indx )
105 QgsDebugMsgLevel( QStringLiteral(
"Set Stylesheet to : %1" ).arg( ss ), 2 );
123 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)