void QgsAuthSslErrorsDialog::widgetReadyToSaveChanged( bool cansave )
{
  ignoreButton()->setDefault( false );
  abortButton()->setDefault( !cansave );
  saveButton()->setEnabled( cansave );
  saveButton()->setDefault( cansave );
}
ImageViewer::ImageViewer (const KUrl &url, const QString &capText, QWidget *parent) :
    KDialog( parent ),
    m_ImageUrl(url),
    fileIsImage(false),
    downloadJob(0)
{
    init(url.fileName(), capText);
    // Add save button
    setButtons( KDialog::User2 | KDialog::User1 | KDialog::Close );

    KGuiItem saveButton( i18n("Save"), "document-save", i18n("Save the image to disk") );
    setButtonGuiItem( KDialog::User1, saveButton );

    // FIXME: Add more options, and do this more nicely
    KGuiItem invertButton( i18n("Invert colors"), "", i18n("Reverse colors of the image. This is useful to enhance contrast at times. This affects only the display and not the saving.") );
    setButtonGuiItem( KDialog::User2, invertButton );

    connect( this, SIGNAL( user1Clicked() ), this, SLOT ( saveFileToDisc() ) );
    connect( this, SIGNAL( user2Clicked() ), this, SLOT ( invertColors() ) );
    // check URL
    if (!m_ImageUrl.isValid())
        kDebug() << "URL is malformed: " << m_ImageUrl;
    
    // FIXME: check the logic with temporary files. Races are possible
    {
        KTemporaryFile tempfile;
        tempfile.open();
        file.setFileName( tempfile.fileName() );
    }// we just need the name and delete the tempfile from disc; if we don't do it, a dialog will be show

    loadImageFromURL();
}
// Constructor/Destructor
qt_toolkit::qt_toolkit(toolkit_callback *setCallback, int setDebugLevel) :
    window(),
    callback(setCallback),
    debugLevel(setDebugLevel)
{
    // get notification, when user click on button
    QObject::connect((const QObject *)&window.toolbar.saveButton,   SIGNAL(clicked()),          this, SLOT(saveButton()));
    QObject::connect((const QObject *)&window.toolbar.saveAsButton, SIGNAL(clicked()),          this, SLOT(saveAsButton()));
    QObject::connect((const QObject *)&window.toolbar.loadButton,   SIGNAL(clicked()),          this, SLOT(saveAsButton()));
    QObject::connect((const QObject *)&window.editor.webView,       SIGNAL(loadFinished(bool)), this, SLOT(webViewloadFinished(bool)));
}
ScreenOption::ScreenOption(unsigned int _button)
:m_character_array(0),
 m_gravityType(NoSliding),
 m_nbButton(_button),
 m_quit(false)
{

   m_window = sfg::Window::Create();
   m_window->SetTitle( "Option" );

   m_box = sfg::Box::Create(sfg::Box::Orientation::VERTICAL, 10.0f);
   m_boxClose = sfg::Box::Create(sfg::Box::Orientation::VERTICAL);
   m_layoutPhysics = sfg::Box::Create( sfg::Box::Orientation::HORIZONTAL);
   m_layoutCharacter = sfg::Box::Create( sfg::Box::Orientation::HORIZONTAL);

   m_framePhysics = sfg::Frame::Create("Gravity Type");
   m_frameCharacter = sfg::Frame::Create("Select a character");

   m_background.setTexture(*TextureManager::getTextureManager()->getResource(std::string(FilenameBackGroundMenu)));
   m_background.setColor(sf::Color(backgroundColor,backgroundColor,backgroundColor));

    for ( unsigned int i = 0 ; i < m_nbButton ; i++)
    {
        std::ostringstream oss;

        oss << i + 1;
        ChoiceCharacter temp = ChoiceCharacter(i+1);
        m_character_array.push_back(temp);
        sfg::Button::Ptr button (sfg::Button::Create("Character_" + oss.str()));

        button->GetSignal( sfg::Widget::OnLeftClick ).Connect( std::bind(&ChoiceCharacter::defineCharacter , &(m_character_array.at(i))));
        m_layoutCharacter->Pack(button);

    }

    sfg::RadioButton::Ptr radio1(sfg::RadioButton::Create("Sliging"));
    sfg::RadioButton::Ptr radio2(sfg::RadioButton::Create("No Sliding", radio1->GetGroup()));
    radio1->GetSignal(sfg::Widget::OnLeftClick).Connect(std::bind(&ScreenOption::activateSliding, this));
    radio2->GetSignal(sfg::Widget::OnLeftClick).Connect(std::bind(&ScreenOption::desactivateSliding, this));

    sfg::Button::Ptr saveButton(sfg::Button::Create("Save"));
    saveButton->GetSignal(sfg::Widget::OnLeftClick).Connect(std::bind(&ScreenOption::save, this));

    sfg::Button::Ptr quitButton(sfg::Button::Create("Go back main menu"));
    quitButton->GetSignal(sfg::Widget::OnLeftClick).Connect(std::bind(&ScreenOption::quit, this));
    quitButton->SetId("quitButton");

    m_layoutPhysics->Pack(radio1);
    m_layoutPhysics->Pack(radio2);

    m_frameCharacter->Add(m_layoutCharacter);
    m_framePhysics->Add(m_layoutPhysics);

    m_box->Pack(m_frameCharacter);
    m_box->Pack(m_framePhysics);
    m_box->Pack(saveButton);
    m_box->Pack(quitButton);

	m_window->Add(m_box);

    //m_desktop.LoadThemeFromFile(FilenameTheme);
    m_desktop.Add(m_window);


}
Beispiel #5
0
toMain::toMain()
        : toMainWindow()
{
    qApp->setMainWidget ( this );
    setDockMenuEnabled ( true );

    Edit = NULL;

    FileMenu = new QPopupMenu ( this );
    FileMenu->insertItem ( QPixmap ( ( const char ** ) connect_xpm ),
                           "&New Connection...", TO_NEW_CONNECTION );
    FileMenu->insertItem ( QPixmap ( ( const char ** ) disconnect_xpm ),
                           "&Close Connection", this, SLOT ( delConnection() ), 0, TO_CLOSE_CONNECTION );
    FileMenu->insertSeparator();
    FileMenu->insertItem ( QPixmap ( ( const char ** ) commit_xpm ), "&Commit Connection", TO_FILE_COMMIT );
    FileMenu->insertItem ( QPixmap ( ( const char ** ) rollback_xpm ), "&Rollback Connection", TO_FILE_ROLLBACK );
    FileMenu->insertItem ( "C&urrent Connection", TO_FILE_CURRENT );
    FileMenu->insertItem ( QPixmap ( ( const char ** ) trash_xpm ), "Reread Object Cache", TO_FILE_CLEARCACHE );
    FileMenu->insertSeparator();
    FileMenu->insertItem ( QPixmap ( ( const char ** ) fileopen_xpm ), "&Open File...", TO_FILE_OPEN );
    FileMenu->insertItem ( QPixmap ( ( const char ** ) filesave_xpm ), "&Save", TO_FILE_SAVE );
    FileMenu->insertItem ( "Save A&s...", TO_FILE_SAVE_AS );
    FileMenu->insertSeparator();
    FileMenu->insertItem ( QPixmap ( ( const char ** ) print_xpm ), "&Print..", TO_FILE_PRINT );
    FileMenu->insertSeparator();
    FileMenu->insertItem ( "&Quit", TO_FILE_QUIT );
    menuBar() ->insertItem ( "&File", FileMenu, TO_FILE_MENU );
    FileMenu->setAccel ( Key_G | CTRL, TO_NEW_CONNECTION );
    FileMenu->setAccel ( Key_O | CTRL, TO_FILE_OPEN );
    FileMenu->setAccel ( Key_S | CTRL, TO_FILE_SAVE );
    FileMenu->setAccel ( Key_W | CTRL, TO_FILE_COMMIT );
    FileMenu->setAccel ( Key_R | CTRL, TO_FILE_ROLLBACK );
    FileMenu->setAccel ( Key_U | CTRL, TO_FILE_CURRENT );
    connect ( FileMenu, SIGNAL ( aboutToShow() ), this, SLOT ( editFileMenu() ) );

    EditMenu = new QPopupMenu ( this );
    EditMenu->insertItem ( QPixmap ( ( const char ** ) undo_xpm ), "&Undo", TO_EDIT_UNDO );
    EditMenu->insertItem ( QPixmap ( ( const char ** ) redo_xpm ), "&Redo", TO_EDIT_REDO );
    EditMenu->insertSeparator();
    EditMenu->insertItem ( QPixmap ( ( const char ** ) cut_xpm ), "Cu&t", TO_EDIT_CUT );
    EditMenu->insertItem ( QPixmap ( ( const char ** ) copy_xpm ), "&Copy", TO_EDIT_COPY );
    EditMenu->insertItem ( QPixmap ( ( const char ** ) paste_xpm ), "&Paste", TO_EDIT_PASTE );
    EditMenu->insertSeparator();
    EditMenu->insertItem ( "&Search && Replace", TO_EDIT_SEARCH );
    EditMenu->insertItem ( "Search &Next", TO_EDIT_SEARCH_NEXT );
    EditMenu->insertItem ( "Select &All", TO_EDIT_SELECT_ALL );
    EditMenu->insertItem ( "Read All &Items", TO_EDIT_READ_ALL );
    EditMenu->insertSeparator();
    EditMenu->insertItem ( "&Options...", TO_EDIT_OPTIONS );
    EditMenu->setAccel ( Key_Z | CTRL, TO_EDIT_UNDO );
    EditMenu->setAccel ( Key_Y | CTRL, TO_EDIT_REDO );
    EditMenu->setAccel ( Key_X | CTRL, TO_EDIT_CUT );
    EditMenu->setAccel ( Key_C | CTRL, TO_EDIT_COPY );
    EditMenu->setAccel ( Key_V | CTRL, TO_EDIT_PASTE );
    EditMenu->setAccel ( Key_F | CTRL, TO_EDIT_SEARCH );
    EditMenu->setAccel ( Key_F3, TO_EDIT_SEARCH_NEXT );
    connect ( EditMenu, SIGNAL ( aboutToShow() ), this, SLOT ( editFileMenu() ) );
    menuBar() ->insertItem ( "&Edit", EditMenu, TO_EDIT_MENU );

    std::map<QString, toTool *> &tools = toTool::tools();

    QToolBar *toolbar = toAllocBar ( this, "Application", QString::null );

    LoadButton = new QToolButton ( QPixmap ( ( const char ** ) fileopen_xpm ),
                                   "Load file into editor",
                                   "Load file into editor",
                                   this, SLOT ( loadButton() ), toolbar );
    SaveButton = new QToolButton ( QPixmap ( ( const char ** ) filesave_xpm ),
                                   "Save file from editor",
                                   "Save file from editor",
                                   this, SLOT ( saveButton() ), toolbar );
    PrintButton = new QToolButton ( QPixmap ( ( const char ** ) print_xpm ),
                                    "Print",
                                    "Print",
                                    this, SLOT ( printButton() ), toolbar );
    PrintButton->setEnabled ( false );
    LoadButton->setEnabled ( false );
    SaveButton->setEnabled ( false );
    toolbar->addSeparator();
    UndoButton = new QToolButton ( QPixmap ( ( const char ** ) undo_xpm ),
                                   "Undo",
                                   "Undo",
                                   this, SLOT ( undoButton() ), toolbar );
    RedoButton = new QToolButton ( QPixmap ( ( const char ** ) redo_xpm ),
                                   "Redo",
                                   "Redo",
                                   this, SLOT ( redoButton() ), toolbar );
    CutButton = new QToolButton ( QPixmap ( ( const char ** ) cut_xpm ),
                                  "Cut to clipboard",
                                  "Cut to clipboard",
                                  this, SLOT ( cutButton() ), toolbar );
    CopyButton = new QToolButton ( QPixmap ( ( const char ** ) copy_xpm ),
                                   "Copy to clipboard",
                                   "Copy to clipboard",
                                   this, SLOT ( copyButton() ), toolbar );
    PasteButton = new QToolButton ( QPixmap ( ( const char ** ) paste_xpm ),
                                    "Paste from clipboard",
                                    "Paste from clipboard",
                                    this, SLOT ( pasteButton() ), toolbar );
    UndoButton->setEnabled ( false );
    RedoButton->setEnabled ( false );
    CutButton->setEnabled ( false );
    CopyButton->setEnabled ( false );
    PasteButton->setEnabled ( false );

    ToolsMenu = new QPopupMenu ( this );

#ifdef TOOL_TOOLBAR
    toolbar = new toAllocBar ( this, "Tools", QString::null );
#else
    toolbar->addSeparator();
#endif

    int toolID = TO_TOOLS;
    int lastPriorityPix = 0;
    int lastPriorityMenu = 0;
    SQLEditor = -1;
    DefaultTool = toolID;
    QString defName = toTool::globalConfig ( CONF_DEFAULT_TOOL, "" );

    HelpMenu = new QPopupMenu ( this );
    HelpMenu->insertItem ( "C&urrent Context", TO_HELP_CONTEXT );
    HelpMenu->insertItem ( "&Contents", TO_HELP_CONTENTS );
    HelpMenu->insertSeparator();
    HelpMenu->insertItem ( "&About TOra", TO_HELP_ABOUT );
    HelpMenu->insertItem ( "&License", TO_HELP_LICENSE );
    HelpMenu->insertItem ( "&Quotes", TO_HELP_QUOTES );
    HelpMenu->setAccel ( Key_F1, TO_HELP_CONTEXT );
    if ( !toFreeware() ) {
        HelpMenu->insertSeparator();
        HelpMenu->insertItem ( "&Register", TO_HELP_REGISTER );
    }
    QPopupMenu *toolAbout = NULL;

    for ( std::map<QString, toTool *>::iterator i = tools.begin();i != tools.end();i++ ) {
        const QPixmap *pixmap = ( *i ).second->toolbarImage();
        const char *toolTip = ( *i ).second->toolbarTip();
        const char *menuName = ( *i ).second->menuItem();

        QString tmp = ( *i ).second->name();
        tmp += CONF_TOOL_ENABLE;
        if ( toTool::globalConfig ( tmp, "Yes" ).isEmpty() )
            continue;

        if ( defName == menuName )
            DefaultTool = toolID;

        int priority = ( *i ).second->priority();
        if ( priority / 100 != lastPriorityPix / 100 &&
                pixmap ) {
            toolbar->addSeparator();
            lastPriorityPix = priority;
        }
        if ( priority / 100 != lastPriorityMenu / 100 &&
                menuName ) {
            ToolsMenu->insertSeparator();
            lastPriorityMenu = priority;
        }

        if ( pixmap ) {
            if ( !toolTip )
                toolTip = "";
            NeedConnection[new QToolButton ( *pixmap,
                                             toolTip,
                                             toolTip,
                                             ( *i ).second,
                                             SLOT ( createWindow ( void ) ),
                                             toolbar ) ] = ( *i ).second;
        }

        if ( menuName ) {
            if ( pixmap )
                ToolsMenu->insertItem ( *pixmap, menuName, toolID );
            else
                ToolsMenu->insertItem ( menuName, toolID );
            ToolsMenu->setItemEnabled ( toolID, false );
        }

        if ( ( *i ).second->hasAbout() && menuName ) {
            if ( !toolAbout ) {
                toolAbout = new QPopupMenu ( this );
                HelpMenu->insertItem ( "Tools", toolAbout );
            }
            if ( pixmap )
                toolAbout->insertItem ( *pixmap, menuName, toolID + TO_ABOUT_ID_OFFSET );
            else
                toolAbout->insertItem ( menuName, toolID + TO_ABOUT_ID_OFFSET );
        }

        Tools[toolID] = ( *i ).second;

        toolID++;
    }

#ifndef TOOL_TOOLBAR
    toolbar->setStretchableWidget ( new QLabel ( "", toolbar ) );
#endif

    new QToolButton ( QPixmap ( ( const char ** ) connect_xpm ),
                      "Connect to database",
                      "Connect to database",
                      this, SLOT ( addConnection() ), toolbar );
    DisconnectButton = new QToolButton ( QPixmap ( ( const char ** ) disconnect_xpm ),
                                         "Disconnect current connection",
                                         "Disconnect current connection",
                                         this, SLOT ( delConnection() ), toolbar );
    DisconnectButton->setEnabled ( false );
    toolbar->addSeparator();
    NeedConnection[new QToolButton ( QPixmap ( ( const char ** ) commit_xpm ),
                                     "Commit connection",
                                     "Commit connection",
                                     this,SLOT ( commitButton() ),toolbar ) ] = NULL;
    NeedConnection[new QToolButton ( QPixmap ( ( const char ** ) rollback_xpm ),
                                     "Rollback connection",
                                     "Rollback connection",
                                     this,SLOT ( rollbackButton() ),toolbar ) ] = NULL;
    toolbar->addSeparator();
    ConnectionSelection = new QComboBox ( toolbar );
    ConnectionSelection->setFixedWidth ( 200 );
    ConnectionSelection->setFocusPolicy ( NoFocus );
    connect ( ConnectionSelection, SIGNAL ( activated ( int ) ), this, SLOT ( changeConnection() ) );

    menuBar() ->insertItem ( "&Tools", ToolsMenu, TO_TOOLS_MENU );

    WindowsMenu = new QPopupMenu ( this );
    WindowsMenu->setCheckable ( true );
    connect ( WindowsMenu, SIGNAL ( aboutToShow() ), this, SLOT ( windowsMenu() ) );
    menuBar() ->insertItem ( "&Window", WindowsMenu, TO_WINDOWS_MENU );

    menuBar() ->insertSeparator();

    menuBar() ->insertItem ( "&Help", HelpMenu, TO_HELP_MENU );

    char buffer[100];
    sprintf ( buffer, DEFAULT_TITLE, TOVERSION );
    setCaption ( buffer );

#ifdef TO_KDE
    KDockWidget *mainDock = createDockWidget ( buffer, QPixmap ( ( const char ** ) toramini_xpm ) );
    Workspace = new QWorkspace ( mainDock );
    mainDock->setWidget ( Workspace );
    setView ( mainDock );
    setMainDockWidget ( mainDock );
    mainDock->setEnableDocking ( KDockWidget::DockNone );
#else
    Workspace = new QWorkspace ( this );
    setCentralWidget ( Workspace );
#endif
    setIcon ( QPixmap ( ( const char ** ) toramini_xpm ) );

    statusBar() ->message ( "Ready" );
    menuBar() ->setItemEnabled ( TO_CLOSE_CONNECTION, false );
    menuBar() ->setItemEnabled ( TO_FILE_COMMIT, false );
    menuBar() ->setItemEnabled ( TO_FILE_ROLLBACK, false );
    menuBar() ->setItemEnabled ( TO_FILE_CLEARCACHE, false );
    DisconnectButton->setEnabled ( false );

    for ( std::map<QToolButton *, toTool *>::iterator j = NeedConnection.begin();
            j != NeedConnection.end();j++ )
        ( *j ).first->setEnabled ( false );

    connect ( menuBar(), SIGNAL ( activated ( int ) ), this, SLOT ( commandCallback ( int ) ) );

    RowLabel = new QLabel ( statusBar() );
    statusBar() ->addWidget ( RowLabel, 0, true );
    RowLabel->setMinimumWidth ( 60 );
    RowLabel->hide();

    ColumnLabel = new QLabel ( statusBar() );
    statusBar() ->addWidget ( ColumnLabel, 0, true );
    ColumnLabel->setMinimumWidth ( 60 );
    ColumnLabel->hide();

    QToolButton *dispStatus = new toPopupButton ( statusBar() );
    dispStatus->setIconSet ( QPixmap ( ( const char ** ) up_xpm ) );
    statusBar() ->addWidget ( dispStatus, 0, true );
    StatusMenu = new QPopupMenu ( dispStatus );
    dispStatus->setPopup ( StatusMenu );
    connect ( StatusMenu, SIGNAL ( aboutToShow() ),
              this, SLOT ( statusMenu() ) );
    connect ( StatusMenu, SIGNAL ( activated ( int ) ), this, SLOT ( commandCallback ( int ) ) );

    toolID = TO_TOOLS;
    for ( std::map<QString, toTool *>::iterator k = tools.begin();k != tools.end();k++ ) {
        ( *k ).second->customSetup ( toolID );
        toolID++;
    }
    Search = NULL;

    if ( !toTool::globalConfig ( CONF_MAXIMIZE_MAIN, "Yes" ).isEmpty() )
        showMaximized();
    show();

    QString welcome;

    do {
        welcome = toCheckLicense ( false );
    } while ( welcome.isNull() );

    toStatusMessage ( welcome, true );

    connect ( &Poll, SIGNAL ( timeout() ), this, SLOT ( checkCaching() ) );

    try {
        toNewConnection newConnection ( this, "First connection", true );

        toConnection *conn;

        do {
            conn = NULL;
            if ( newConnection.exec() ) {
                conn = newConnection.makeConnection();
            } else {
                break;
            }
        } while ( !conn );

        if ( conn )
            addConnection ( conn );
    }
    TOCATCH
    connect ( toMainWidget() ->workspace(), SIGNAL ( windowActivated ( QWidget * ) ),
              this, SLOT ( windowActivated ( QWidget * ) ) );
}
QgsAuthSslImportDialog::QgsAuthSslImportDialog( QWidget *parent )
    : QDialog( parent )
    , mSocket( nullptr )
    , mExecErrorsDialog( false )
    , mTimer( nullptr )
    , mSslErrors( QList<QSslError>() )
    , mTrustedCAs( QList<QSslCertificate>() )
    , mAuthNotifyLayout( nullptr )
    , mAuthNotify( nullptr )
{
  if ( QgsAuthManager::instance()->isDisabled() )
  {
    mAuthNotifyLayout = new QVBoxLayout;
    this->setLayout( mAuthNotifyLayout );
    mAuthNotify = new QLabel( QgsAuthManager::instance()->disabledMessage(), this );
    mAuthNotifyLayout->addWidget( mAuthNotify );
  }
  else
  {
    setupUi( this );
    QStyle *style = QApplication::style();
    lblWarningIcon->setPixmap( style->standardIcon( QStyle::SP_MessageBoxWarning ).pixmap( 48, 48 ) );
    lblWarningIcon->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );

    closeButton()->setDefault( false );
    saveButton()->setEnabled( false );

    leServer->setSelection( 0, leServer->text().size() );
    pteSessionStatus->setReadOnly( true );
    spinbxTimeout->setValue( 15 );

    grpbxServer->setCollapsed( false );
    radioServerImport->setChecked( true );
    frameServerImport->setEnabled( true );
    radioFileImport->setChecked( false );
    frameFileImport->setEnabled( false );

    connect( radioServerImport, SIGNAL( toggled( bool ) ),
             this, SLOT( radioServerImportToggled( bool ) ) );
    connect( radioFileImport, SIGNAL( toggled( bool ) ),
             this, SLOT( radioFileImportToggled( bool ) ) );

    connect( leServer, SIGNAL( textChanged( QString ) ),
             this, SLOT( updateEnabledState() ) );
    connect( btnConnect, SIGNAL( clicked() ),
             this, SLOT( secureConnect() ) );
    connect( leServer, SIGNAL( returnPressed() ),
             btnConnect, SLOT( click() ) );

    connect( buttonBox, SIGNAL( accepted() ),
             this, SLOT( accept() ) );
    connect( buttonBox, SIGNAL( rejected() ),
             this, SLOT( reject() ) );

    connect( wdgtSslConfig, SIGNAL( readyToSaveChanged( bool ) ),
             this, SLOT( widgetReadyToSaveChanged( bool ) ) );
    wdgtSslConfig->setEnabled( false );

    mTrustedCAs = QgsAuthManager::instance()->getTrustedCaCertsCache();
  }
}
QgsAuthSslErrorsDialog::QgsAuthSslErrorsDialog( QNetworkReply *reply,
    const QList<QSslError> &sslErrors,
    QWidget *parent,
    const QString &digest,
    const QString &hostport )
  : QDialog( parent )
  , mSslConfiguration( reply->sslConfiguration() )
  , mSslErrors( sslErrors )
  , mDigest( digest )
  , mHostPort( hostport )
{
  if ( mDigest.isEmpty() )
  {
    mDigest = QgsAuthCertUtils::shaHexForCert( mSslConfiguration.peerCertificate() );
  }
  if ( mHostPort.isEmpty() )
  {
    mHostPort = QStringLiteral( "%1:%2" )
                .arg( reply->url().host() )
                .arg( reply->url().port() != -1 ? reply->url().port() : 443 )
                .trimmed();
  }

  setupUi( this );
  connect( buttonBox, &QDialogButtonBox::clicked, this, &QgsAuthSslErrorsDialog::buttonBox_clicked );
  connect( btnChainInfo, &QToolButton::clicked, this, &QgsAuthSslErrorsDialog::btnChainInfo_clicked );
  connect( btnChainCAs, &QToolButton::clicked, this, &QgsAuthSslErrorsDialog::btnChainCAs_clicked );
  connect( grpbxSslErrors, &QgsCollapsibleGroupBoxBasic::collapsedStateChanged, this, &QgsAuthSslErrorsDialog::grpbxSslErrors_collapsedStateChanged );
  QStyle *style = QApplication::style();
  lblWarningIcon->setPixmap( style->standardIcon( QStyle::SP_MessageBoxWarning ).pixmap( 48, 48 ) );
  lblWarningIcon->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );

  lblErrorsText->setStyleSheet( QStringLiteral( "QLabel{ font-weight: bold; }" ) );
  leUrl->setText( reply->request().url().toString() );

  ignoreButton()->setDefault( false );
  abortButton()->setDefault( true );

  if ( !QgsApplication::authManager()->isDisabled() )
  {
    saveButton()->setEnabled( false );

    saveButton()->setText( QStringLiteral( "%1 && %2" ).arg( saveButton()->text(),
                           ignoreButton()->text() ) );

    grpbxSslConfig->setChecked( false );
    grpbxSslConfig->setCollapsed( true );
    connect( grpbxSslConfig, &QGroupBox::toggled,
             this, &QgsAuthSslErrorsDialog::loadUnloadCertificate );

    connect( wdgtSslConfig, &QgsAuthSslConfigWidget::readyToSaveChanged,
             this, &QgsAuthSslErrorsDialog::widgetReadyToSaveChanged );
    wdgtSslConfig->setConfigCheckable( false );
    wdgtSslConfig->certificateGroupBox()->setFlat( true );
  }
  else
  {
    btnChainInfo->setVisible( false );
    btnChainCAs->setVisible( false );
    grpbxSslConfig->setVisible( false );
    saveButton()->setVisible( false );
  }

  populateErrorsList();
}