Exemple #1
0
SettingsDialog::SettingsDialog(QWidget *parent)
    : QDialog(parent)
    , m_cacheEnabled(false)
{
    setupUi(this);
    connect(exceptionsButton, SIGNAL(clicked()), this, SLOT(showExceptions()));
    connect(setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT(setHomeToCurrentPage()));
    connect(cookiesButton, SIGNAL(clicked()), this, SLOT(showCookies()));
    connect(standardFontButton, SIGNAL(clicked()), this, SLOT(chooseFont()));
    connect(fixedFontButton, SIGNAL(clicked()), this, SLOT(chooseFixedFont()));
    connect(languageButton, SIGNAL(clicked()), this, SLOT(chooseAcceptLanguage()));
    connect(downloadDirectoryButton, SIGNAL(clicked()), this, SLOT(chooseDownloadDirectory()));
    connect(externalDownloadBrowse, SIGNAL(clicked()), this, SLOT(chooseDownloadProgram()));
    connect(styleSheetBrowseButton, SIGNAL(clicked()), this, SLOT(chooseStyleSheet()));

    connect(editAutoFillUserButton, SIGNAL(clicked()), this, SLOT(editAutoFillUser()));

    // As network cache has too many bugs in 4.5.1, do not allow to enable it.
    if (QLatin1String(qVersion()) == QLatin1String("4.5.1"))
        networkCache->setVisible(false);

    loadDefaults();
    loadFromSettings();
}
    ui.useSystemTrayIcon->hide();
#endif

    initAutoWidgets();
    initStyleComboBox();
    initLanguageComboBox();
    initIconThemeComboBox();

    foreach(QComboBox *comboBox, findChildren<QComboBox *>()) {
        connect(comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(widgetHasChanged()));
    }
    foreach(QCheckBox *checkBox, findChildren<QCheckBox *>()) {
        connect(checkBox, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
    }

    connect(ui.chooseStyleSheet, SIGNAL(clicked()), SLOT(chooseStyleSheet()));

    connect(ui.userNoticesInDefaultBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
    connect(ui.userNoticesInStatusBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
    connect(ui.userNoticesInCurrentBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));

    connect(ui.serverNoticesInDefaultBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
    connect(ui.serverNoticesInStatusBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
    connect(ui.serverNoticesInCurrentBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));

    connect(ui.errorMsgsInDefaultBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
    connect(ui.errorMsgsInStatusBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
    connect(ui.errorMsgsInCurrentBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
}