Ejemplo n.º 1
0
CSSConfig::CSSConfig(QWidget *parent, const QVariantList &)
    : QWidget(parent)
    , configWidget(new CSSConfigWidget(this))
    , customDialogBase(new KDialog(this))
    , customDialog(new CSSCustomDialog(customDialogBase))
{
    customDialogBase->setObjectName(QStringLiteral("customCSSDialog"));
    customDialogBase->setModal(true);
    customDialogBase->setButtons(KDialog::Close);
    customDialogBase->setDefaultButton(KDialog::Close);

    customDialogBase->setMainWidget(customDialog);

//   setQuickHelp( i18n("<h1>Konqueror Stylesheets</h1> This module allows you to apply your own color"
    setWhatsThis(i18n("<h1>Konqueror Stylesheets</h1> This module allows you to apply your own color"
                      " and font settings to Konqueror by using"
                      " stylesheets (CSS). You can either specify"
                      " options or apply your own self-written"
                      " stylesheet by pointing to its location.<br />"
                      " Note that these settings will always have"
                      " precedence before all other settings made"
                      " by the site author. This can be useful to"
                      " visually impaired people or for web pages"
                      " that are unreadable due to bad design."));

    connect(configWidget->useDefault,     SIGNAL(clicked()),      SIGNAL(changed()));
    connect(configWidget->useAccess,      SIGNAL(clicked()),      SIGNAL(changed()));
    connect(configWidget->useUser,        SIGNAL(clicked()),      SIGNAL(changed()));
    connect(configWidget->urlRequester, SIGNAL(textChanged(QString)), SIGNAL(changed()));
    connect(configWidget->customize,      SIGNAL(clicked()),      SLOT(slotCustomize()));
    connect(customDialog,                 SIGNAL(changed()),      SIGNAL(changed()));

    QVBoxLayout *vbox = new QVBoxLayout(this);
    vbox->setMargin(0);
    vbox->addWidget(configWidget);
}
Ejemplo n.º 2
0
CSSConfig::CSSConfig(QWidget *parent, const char *name, const QStringList &)
  : KCModule(CSSFactory::instance(), parent, name)
{
  customDialogBase = new KDialogBase(this, "customCSSDialog", true, QString::null, 
        KDialogBase::Close, KDialogBase::Close, true );
  customDialog = new CSSCustomDialog(customDialogBase);
  customDialogBase->setMainWidget(customDialog);
  configDialog = new CSSConfigDialog(this);

  setQuickHelp( i18n("<h1>Konqueror Stylesheets</h1> This module allows you to apply your own color"
              " and font settings to Konqueror by using"
              " stylesheets (CSS). You can either specify"
              " options or apply your own self-written"
              " stylesheet by pointing to its location.<br>"
              " Note that these settings will always have"
              " precedence before all other settings made"
              " by the site author. This can be useful to"
              " visually impaired people or for web pages"
              " that are unreadable due to bad design."));


  QStringList fonts;
  KFontChooser::getFontList(fonts, 0);
  customDialog->fontFamily->insertStringList(fonts);

  connect(configDialog->useDefault, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(configDialog->useAccess, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(configDialog->useUser, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(configDialog->urlRequester, SIGNAL(textChanged(const QString&)),
	  SLOT(changed()));
  connect(configDialog->customize, SIGNAL(clicked()),
          SLOT(slotCustomize()));
  connect(customDialog->basefontsize, SIGNAL(highlighted(int)),
	  SLOT(changed()));
  connect(customDialog->basefontsize, SIGNAL(textChanged(const QString&)),
	  SLOT(changed()));
  connect(customDialog->dontScale, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->blackOnWhite, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->whiteOnBlack, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->customColor, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->foregroundColor, SIGNAL(changed(const QColor &)),
	  SLOT(changed()));
  connect(customDialog->backgroundColor, SIGNAL(changed(const QColor &)),
	  SLOT(changed()));
  connect(customDialog->fontFamily, SIGNAL(highlighted(int)),
	  SLOT(changed()));
  connect(customDialog->fontFamily, SIGNAL(textChanged(const QString&)),
	  SLOT(changed()));
  connect(customDialog->sameFamily, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->preview, SIGNAL(clicked()),
          SLOT(slotPreview()));
  connect(customDialog->sameColor, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->hideImages, SIGNAL(clicked()),
	  SLOT(changed()));
  connect(customDialog->hideBackground, SIGNAL(clicked()),
	  SLOT(changed()));

  QVBoxLayout *vbox = new QVBoxLayout(this, 0, 0);
  vbox->addWidget(configDialog);

  load();
}