From 4aed2c8219774f5d797760606b8489a92ddc5163 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcontrol/css/Makefile.am | 16 ++ kcontrol/css/cssconfig.ui | 242 +++++++++++++++++++ kcontrol/css/csscustom.ui | 554 ++++++++++++++++++++++++++++++++++++++++++++ kcontrol/css/kcmcss.cpp | 385 ++++++++++++++++++++++++++++++ kcontrol/css/kcmcss.desktop | 233 +++++++++++++++++++ kcontrol/css/kcmcss.h | 60 +++++ kcontrol/css/preview.ui | 95 ++++++++ kcontrol/css/template.cpp | 45 ++++ kcontrol/css/template.css | 77 ++++++ kcontrol/css/template.h | 21 ++ 10 files changed, 1728 insertions(+) create mode 100644 kcontrol/css/Makefile.am create mode 100644 kcontrol/css/cssconfig.ui create mode 100644 kcontrol/css/csscustom.ui create mode 100644 kcontrol/css/kcmcss.cpp create mode 100644 kcontrol/css/kcmcss.desktop create mode 100644 kcontrol/css/kcmcss.h create mode 100644 kcontrol/css/preview.ui create mode 100644 kcontrol/css/template.cpp create mode 100644 kcontrol/css/template.css create mode 100644 kcontrol/css/template.h (limited to 'kcontrol/css') diff --git a/kcontrol/css/Makefile.am b/kcontrol/css/Makefile.am new file mode 100644 index 000000000..9f55b5a75 --- /dev/null +++ b/kcontrol/css/Makefile.am @@ -0,0 +1,16 @@ +AM_CPPFLAGS = $(all_includes) + +template_DATA = template.css +templatedir = $(kde_datadir)/kcmcss + +kde_module_LTLIBRARIES = kcm_css.la +kcm_css_la_SOURCES = template.cpp cssconfig.ui csscustom.ui kcmcss.cpp preview.ui +kcm_css_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +kcm_css_la_LIBADD = -lkdeui $(LIB_KIO) + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kcmcss.pot + +xdg_apps_DATA = kcmcss.desktop diff --git a/kcontrol/css/cssconfig.ui b/kcontrol/css/cssconfig.ui new file mode 100644 index 000000000..c3d064b48 --- /dev/null +++ b/kcontrol/css/cssconfig.ui @@ -0,0 +1,242 @@ + +CSSConfigDialog + + + CSSConfigDialog + + + + 0 + 0 + 487 + 195 + + + + + + + + <b>Stylesheets</b><p>See http://www.w3.org/Style/CSS for further information on cascading style sheets.</p> + + + + unnamed + + + 0 + + + 0 + + + + ButtonGroup1 + + + + 3 + 5 + 0 + 0 + + + + Stylesheets + + + true + + + <b>Stylesheets</b><p>Use this groupbox to determine how Konqueror will render style sheets.</p> + + + + unnamed + + + 11 + + + 6 + + + + useDefault + + + Us&e default stylesheet + + + true + + + <b>Use default stylesheet</b><p>Select this option to use the default stylesheet.</p> + + + + + useUser + + + Use &user-defined stylesheet + + + <b>Use user-defined stylesheet</b><p>If this box is checked, Konqueror will try to load a user-defined style sheet as specified in the location below. The style sheet allows you to completely override the way web pages are rendered in your browser. The file specified should contain a valid style sheet (see http://www.w3.org/Style/CSS for further information on cascading style sheets).</p> + + + + + layout3 + + + + unnamed + + + + spacer9_2 + + + Horizontal + + + Fixed + + + + 16 + 20 + + + + + + urlRequester + + + false + + + + + + + useAccess + + + + 3 + 0 + 0 + 0 + + + + U&se accessibility stylesheet + + + <b>Use accessibility stylesheet</b><p>Selecting this option will allow you to define a default font, font size, and font color with a few simple clicks of the mouse. Simply wander over to the Customize... dialog and pick out your desired options.</p> + + + + + layout2 + + + + unnamed + + + + spacer9 + + + Horizontal + + + Fixed + + + + 16 + 20 + + + + + + customize + + + false + + + Custom&ize... + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 451 + 20 + + + + + + + + + + spacer11 + + + Vertical + + + Expanding + + + + 20 + 50 + + + + + + + + useAccess + toggled(bool) + customize + setEnabled(bool) + + + useUser + toggled(bool) + urlRequester + setEnabled(bool) + + + + kdialog.h + + + + + kurlrequester.h + klineedit.h + kpushbutton.h + + diff --git a/kcontrol/css/csscustom.ui b/kcontrol/css/csscustom.ui new file mode 100644 index 000000000..b19e08baf --- /dev/null +++ b/kcontrol/css/csscustom.ui @@ -0,0 +1,554 @@ + +CSSCustomDialog + + + CSSCustomDialog + + + + 0 + 0 + 584 + 456 + + + + <b>Stylesheets</b><p>See http://www.w3.org/Style/CSS for further information on cascading style sheets.</p> + + + + unnamed + + + + GroupBox3 + + + + 5 + 3 + 0 + 0 + + + + Font Size + + + + unnamed + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 12 + + + + + 14 + + + + + 16 + + + + + 20 + + + + + 24 + + + + + 32 + + + + + 48 + + + + + 64 + + + + basefontsize + + + + 3 + 1 + 0 + 0 + + + + true + + + + + txtFontsize + + + Base font si&ze: + + + basefontsize + + + + + dontScale + + + + 3 + 0 + 0 + 0 + + + + &Use same size for all elements + + + <b>Use same size for all elements</b><p>Select this option to override custom font sizes in favor of the base font size. All fonts will be displayed in the same size.</p> + + + + + + + GroupBox3_2 + + + Images + + + <b>Images</b><p> + + + + unnamed + + + + hideImages + + + &Suppress images + + + <b>Suppress images</b><p>Selecting this will prevent Konqueror from loading images.</p> + + + + + hideBackground + + + Suppress background images + + + true + + + <b>Suppress background images</b><p>Selecting this option will prevent Konqueror from loading background images.</p> + + + + + + + GroupBox7 + + + Font Family + + + <b>Font family</b><p>A font family is a group of fonts that resemble one another, with family members that are e.g. bold, italic, or any number of the above.</p> + + + + unnamed + + + + txtBaseFontFamily + + + Base fa&mily: + + + fontFamily + + + + + fontFamily + + + + 3 + 0 + 0 + 0 + + + + <p>This is the currently selected font family</p> + + + + + Spacer7 + + + Horizontal + + + Expanding + + + + 0 + 20 + + + + + + sameFamily + + + Use same family for all text + + + <b>Use same family for all text</b><p>Select this option to override custom fonts everywhere in favor of the base font.</p> + + + + + + + Spacer5_2 + + + Vertical + + + Expanding + + + + 20 + 0 + + + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + preview + + + &Preview + + + <b>Preview</b><p>Click on this button to see what your selections look like in action.</p> + + + + + Spacer1_4 + + + Horizontal + + + Expanding + + + + 0 + 20 + + + + + + + + ButtonGroup2 + + + Colors + + + false + + + true + + + + unnamed + + + + blackOnWhite + + + &Black on white + + + true + + + <b>Black on White</b><p>This is what you normally see.</p> + + + + + whiteOnBlack + + + &White on black + + + <b>White on Black</b><p>This is your classic inverse color scheme.</p> + + + + + customColor + + + Cus&tom + + + <b>Custom</b><p>Select this option to define a custom color for the default font.</p> + + + + + Layout2 + + + + unnamed + + + 0 + + + 6 + + + + foregroundColor + + + + + + <b>Foreground color</b><p>The foreground color is the color that the text is drawn in.</p> + + + + + Spacer9 + + + Horizontal + + + Expanding + + + + 0 + 20 + + + + + + Spacer1 + + + Horizontal + + + Fixed + + + + 21 + 20 + + + + + + Spacer1_2 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + + + + Spacer8 + + + Horizontal + + + Expanding + + + + 0 + 20 + + + + + + txtForeground + + + &Foreground: + + + foregroundColor + + + <b>Foreground color</b><p>The foreground color is the color that the text is drawn in.</p> + + + + + backgroundColor + + + + + + <b>Background</b><p>Behind this door lays the ability to choose a custom default background.</p> + + + + + txtBackground + + + Bac&kground: + + + backgroundColor + + + <b>Background</b><p>This background color is the one displayed behind the text by default. A background image will override this.</p> + + + + + + + sameColor + + + Use same color for all text + + + <b>Use same color for all text</b><p>Select this option to apply your chosen color to the default font as well as any custom fonts as specified in a stylesheet.</p> + + + + + + + + + + fontFamily + sameFamily + basefontsize + dontScale + blackOnWhite + backgroundColor + foregroundColor + sameColor + hideImages + hideBackground + preview + + + kcolorbutton.h + kdialog.h + + + + + kcolorbutton.h + kcolorbutton.h + + diff --git a/kcontrol/css/kcmcss.cpp b/kcontrol/css/kcmcss.cpp new file mode 100644 index 000000000..bd72a1375 --- /dev/null +++ b/kcontrol/css/kcmcss.cpp @@ -0,0 +1,385 @@ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cssconfig.h" +#include "csscustom.h" +#include "template.h" +#include "preview.h" + +#include "kcmcss.h" + +typedef KGenericFactory CSSFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_css, CSSFactory("kcmcss") ) + +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("

Konqueror Stylesheets

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.
" + " 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(); +} + +void CSSConfig::load() +{ + load( false ); +} + +void CSSConfig::load( bool useDefaults ) +{ + KConfig *c = new KConfig("kcmcssrc", false, false); + c->setReadDefaults( useDefaults ); + + c->setGroup("Stylesheet"); + QString u = c->readEntry("Use", "default"); + configDialog->useDefault->setChecked(u == "default"); + configDialog->useUser->setChecked(u == "user"); + configDialog->useAccess->setChecked(u == "access"); + configDialog->urlRequester->setURL(c->readEntry("SheetName")); + + c->setGroup("Font"); + customDialog->basefontsize->setEditText(QString::number(c->readNumEntry("BaseSize", 12))); + customDialog->dontScale->setChecked(c->readBoolEntry("DontScale", false)); + + QString fname = c->readEntry("Family", "Arial"); + for (int i=0; i < customDialog->fontFamily->count(); ++i) + if (customDialog->fontFamily->text(i) == fname) + { + customDialog->fontFamily->setCurrentItem(i); + break; + } + + customDialog->sameFamily->setChecked(c->readBoolEntry("SameFamily", false)); + + c->setGroup("Colors"); + QString m = c->readEntry("Mode", "black-on-white"); + customDialog->blackOnWhite->setChecked(m == "black-on-white"); + customDialog->whiteOnBlack->setChecked(m == "white-on-black"); + customDialog->customColor->setChecked(m == "custom"); + customDialog->backgroundColor->setColor(c->readColorEntry("BackColor", &Qt::white)); + customDialog->foregroundColor->setColor(c->readColorEntry("ForeColor", &Qt::black)); + customDialog->sameColor->setChecked(c->readBoolEntry("SameColor", false)); + + // Images + c->setGroup("Images"); + customDialog->hideImages->setChecked(c->readBoolEntry("Hide", false)); + customDialog->hideBackground->setChecked(c->readBoolEntry("HideBackground", true)); + + delete c; + + emit changed( useDefaults ); +} + + +void CSSConfig::save() +{ + // write to config file + KConfig *c = new KConfig("kcmcssrc", false, false); + + c->setGroup("Stylesheet"); + if (configDialog->useDefault->isChecked()) + c->writeEntry("Use", "default"); + if (configDialog->useUser->isChecked()) + c->writeEntry("Use", "user"); + if (configDialog->useAccess->isChecked()) + c->writeEntry("Use", "access"); + c->writeEntry("SheetName", configDialog->urlRequester->url()); + + c->setGroup("Font"); + c->writeEntry("BaseSize", customDialog->basefontsize->currentText()); + c->writeEntry("DontScale", customDialog->dontScale->isChecked()); + c->writeEntry("SameFamily", customDialog->sameFamily->isChecked()); + c->writeEntry("Family", customDialog->fontFamily->currentText()); + + c->setGroup("Colors"); + if (customDialog->blackOnWhite->isChecked()) + c->writeEntry("Mode", "black-on-white"); + if (customDialog->whiteOnBlack->isChecked()) + c->writeEntry("Mode", "white-on-black"); + if (customDialog->customColor->isChecked()) + c->writeEntry("Mode", "custom"); + c->writeEntry("BackColor", customDialog->backgroundColor->color()); + c->writeEntry("ForeColor", customDialog->foregroundColor->color()); + c->writeEntry("SameColor", customDialog->sameColor->isChecked()); + + c->setGroup("Images"); + c->writeEntry("Hide", customDialog->hideImages->isChecked()); + c->writeEntry("HideBackground", customDialog->hideBackground->isChecked()); + + c->sync(); + delete c; + + // generate CSS template + QString templ = locate("data", "kcmcss/template.css"); + QString dest; + if (!templ.isEmpty()) + { + CSSTemplate css(templ); + + dest = kapp->dirs()->saveLocation("data", "kcmcss"); + dest += "/override.css"; + + css.expand(dest, cssDict()); + } + + // make konqueror use the right stylesheet + c = new KConfig("konquerorrc", false, false); + + c->setGroup("HTML Settings"); + c->writeEntry("UserStyleSheetEnabled", !configDialog->useDefault->isChecked()); + + if (configDialog->useUser->isChecked()) + c->writeEntry("UserStyleSheet", configDialog->urlRequester->url()); + if (configDialog->useAccess->isChecked()) + c->writeEntry("UserStyleSheet", dest); + + c->sync(); + delete c; + emit changed(false); +} + + +void CSSConfig::defaults() +{ + load( true ); +} + + +QString px(int i, double scale) +{ + QString px; + px.setNum(static_cast(i * scale)); + px += "px"; + return px; +} + + +QMap CSSConfig::cssDict() +{ + QMap dict; + + // Fontsizes ------------------------------------------------------ + + int bfs = customDialog->basefontsize->currentText().toInt(); + dict.insert("fontsize-base", px(bfs, 1.0)); + + if (customDialog->dontScale->isChecked()) + { + dict.insert("fontsize-small-1", px(bfs, 1.0)); + dict.insert("fontsize-large-1", px(bfs, 1.0)); + dict.insert("fontsize-large-2", px(bfs, 1.0)); + dict.insert("fontsize-large-3", px(bfs, 1.0)); + dict.insert("fontsize-large-4", px(bfs, 1.0)); + dict.insert("fontsize-large-5", px(bfs, 1.0)); + } + else + { + // TODO: use something harmonic here + dict.insert("fontsize-small-1", px(bfs, 0.8)); + dict.insert("fontsize-large-1", px(bfs, 1.2)); + dict.insert("fontsize-large-2", px(bfs, 1.4)); + dict.insert("fontsize-large-3", px(bfs, 1.5)); + dict.insert("fontsize-large-4", px(bfs, 1.6)); + dict.insert("fontsize-large-5", px(bfs, 1.8)); + } + + // Colors -------------------------------------------------------- + + if (customDialog->blackOnWhite->isChecked()) + { + dict.insert("background-color", "White"); + dict.insert("foreground-color", "Black"); + } + else if (customDialog->whiteOnBlack->isChecked()) + { + dict.insert("background-color", "Black"); + dict.insert("foreground-color", "White"); + } + else + { + dict.insert("background-color", customDialog->backgroundColor->color().name()); + dict.insert("foreground-color", customDialog->foregroundColor->color().name()); + } + + if (customDialog->sameColor->isChecked()) + dict.insert("force-color", "! important"); + else + dict.insert("force-color", ""); + + // Fonts ------------------------------------------------------------- + dict.insert("font-family", customDialog->fontFamily->currentText()); + if (customDialog->sameFamily->isChecked()) + dict.insert("force-font", "! important"); + else + dict.insert("force-font", ""); + + // Images + + if (customDialog->hideImages->isChecked()) + dict.insert("display-images", "background-image : none ! important"); + else + dict.insert("display-images", ""); + if (customDialog->hideBackground->isChecked()) + dict.insert("display-background", "background-image : none ! important"); + else + dict.insert("display-background", ""); + + return dict; +} + + +void CSSConfig::slotCustomize() +{ + customDialogBase->exec(); +} + + +void CSSConfig::slotPreview() +{ + + QStyleSheetItem *h1 = new QStyleSheetItem(QStyleSheet::defaultSheet(), "h1"); + QStyleSheetItem *h2 = new QStyleSheetItem(QStyleSheet::defaultSheet(), "h2"); + QStyleSheetItem *h3 = new QStyleSheetItem(QStyleSheet::defaultSheet(), "h3"); + QStyleSheetItem *text = new QStyleSheetItem(QStyleSheet::defaultSheet(), "p"); + + // Fontsize + + int bfs = customDialog->basefontsize->currentText().toInt(); + text->setFontSize(bfs); + if (customDialog->dontScale->isChecked()) + { + h1->setFontSize(bfs); + h2->setFontSize(bfs); + h3->setFontSize(bfs); + } + else + { + h1->setFontSize(static_cast(bfs * 1.8)); + h2->setFontSize(static_cast(bfs * 1.6)); + h3->setFontSize(static_cast(bfs * 1.4)); + } + + // Colors + + QColor back, fore; + + if (customDialog->blackOnWhite->isChecked()) + { + back = Qt::white; + fore = Qt::black; + } + else if (customDialog->whiteOnBlack->isChecked()) + { + back = Qt::black; + fore = Qt::white; + } + else + { + back = customDialog->backgroundColor->color(); + fore = customDialog->foregroundColor->color(); + } + + h1->setColor(fore); + h2->setColor(fore); + h3->setColor(fore); + text->setColor(fore); + + // Fonts + + h1->setFontFamily(customDialog->fontFamily->currentText()); + h2->setFontFamily(customDialog->fontFamily->currentText()); + h3->setFontFamily(customDialog->fontFamily->currentText()); + text->setFontFamily(customDialog->fontFamily->currentText()); + + // Show the preview + PreviewDialog *dlg = new PreviewDialog(this, 0, true); + dlg->preview->setPaper(back); + dlg->preview->viewport()->setFont(QFont(KGlobalSettings::generalFont().family(), bfs)); + + dlg->exec(); + + delete dlg; +} + + + + +#include "kcmcss.moc" + diff --git a/kcontrol/css/kcmcss.desktop b/kcontrol/css/kcmcss.desktop new file mode 100644 index 000000000..d5a1116f6 --- /dev/null +++ b/kcontrol/css/kcmcss.desktop @@ -0,0 +1,233 @@ +[Desktop Entry] +Icon=stylesheet +Type=Application +Exec=kcmshell kcmcss +DocPath=kcontrol/kcmcss/index.html + + +X-KDE-Library=css +X-KDE-FactoryName=kcmcss +X-KDE-ParentApp=kcontrol + +Name=Stylesheets +Name[af]=Stylblaaie +Name[az]=Stylesheet +Name[be]=Табліцы стыляў +Name[bg]=CSS стилове +Name[bn]=স্টাইলশিট +Name[br]=Folennoù c'hiz +Name[ca]=Fulls d'estil +Name[cs]=Soubory se styly +Name[csb]=Bôdżi sztélów +Name[cy]=Dalennau arddull +Name[da]=Stilark +Name[de]=Stilvorlagen +Name[el]=Φύλλα στυλ +Name[eo]=Stildifinoj +Name[es]=Hojas de estilo +Name[et]=Laaditabelid +Name[eu]=Estilo orriak +Name[fa]=صفحه سبکها +Name[fi]=Tyylisivut +Name[fo]=Sniðørk +Name[fr]=Feuilles de style +Name[fy]=Stylblêden +Name[ga]=Stílbhileoga +Name[gl]=Follas de Estilo +Name[he]=גיליונות סגנון +Name[hi]=स्टाइलशीट +Name[hr]=Stilska oblikovanja +Name[hu]=Stíluslapok +Name[is]=Stílblöð +Name[it]=Fogli di stile +Name[ja]=スタイルシート +Name[kk]=CSS стильдері +Name[km]=សន្លឹក​រចនាប័ទ្ម +Name[ko]=스타일시트 +Name[lo]=ສະຕາຍຊິດ +Name[lt]=Stiliaus aprašymai +Name[mk]=Дизајни на страница +Name[mn]=Хэлбэрт хуудас +Name[ms]=Lemabaran Gaya +Name[nb]=Stilsett +Name[nds]=Stilvörlagen +Name[ne]= शैलीपाना +Name[nl]=Stijlbladen +Name[nn]=Stilsett +Name[nso]=Matlakala a mokgwa +Name[pl]=Arkusze stylów +Name[pt]=Folhas de estilo +Name[pt_BR]=Folhas de estilo +Name[ro]=Foi de stil +Name[ru]=Стили CSS +Name[rw]=Impapuromisusire +Name[se]=Stiilaárkkat +Name[sk]=Štýly +Name[sl]=Slogovne predloge +Name[sr]=Описи стилова +Name[sr@Latn]=Opisi stilova +Name[ss]=Emashidi yetitayhela +Name[sv]=Stilmallar +Name[ta]=அமைக்கும் பாணி +Name[tg]=Намуди варақа +Name[th]=สไตล์ชีต +Name[tr]=Stil Kağıtları +Name[tt]=Bizütabaq +Name[uk]=Таблиці стилів +Name[uz]=Staylshitlar +Name[uz@cyrillic]=Стайлшитлар +Name[ven]=Siatari la Tshitaela +Name[vi]=Kiểu dáng mẫu +Name[wa]=Foyes di stîle +Name[xh]=Amakhasi ohlobo oluthile +Name[zh_CN]=样式表 +Name[zh_TW]=樣式表單 +Name[zu]=Amakhasi esitayela +Comment=Configure the stylesheets used to render web pages +Comment[af]=Konfigureer die stylblaaie gebruik word na interpreteer web bladsye +Comment[az]=Veb səhifələrində işlədilən tərz laylarını quraşdır +Comment[be]=Настаўленне табліц стыляў для малявання старонак Сеціва +Comment[bg]=Настройване на използваните CSS стилове в уеб страниците +Comment[bn]=ওয়েব পেজ দেখাতে ব্যবহৃত বিভিন্ন স্টাইলশিট কনফিগার করুন +Comment[br]=Kefluniañ ar folennoù c'hiz evit ar pajennoù gwiad +Comment[bs]=Podesite stilove koji se koriste za prikazivanje web stranica +Comment[ca]=Aquí podeu configurar els fulls d'estil emprats per a renderitzar les pàgines web +Comment[cs]=Zde je možné nastavit styly používané pro zobrazování HTML +Comment[csb]=Kònfigùracëjô bògów sztélów do wëskrzënianiô internetowich starnów +Comment[cy]=Ffurfweddu'r dalennau arddull sy'n trosi tudalennau gwe. +Comment[da]=Indstil stilark brugt til at vise netsider +Comment[de]=Stilvorlagen für die Anzeige von HTML-Seiten einrichten +Comment[el]=Ρυθμίστε τα φύλλα στυλ που χρησιμοποιούνται για την εμφάνιση των ιστοσελίδων +Comment[eo]=Agordo de la stildifinoj por HTML-prezento +Comment[es]=Configuración de las hojas de estilo usadas para mostrar páginas web +Comment[et]=Laaditabelite seadistamine veebilehtede renderdamiseks +Comment[eu]=Kondiguratu HTML errenderizatzeko erabilitako estilo orriak +Comment[fa]=پیکربندی صفحه سبکهای مورد استفادۀ پرداخت صفحات وب +Comment[fi]=WWW-sivuilla käytettävien tyylisivujen asetukset +Comment[fr]=Configuration des feuilles de style utilisées pour l'affichage HTML +Comment[fy]=Hjir kinne jo de stylblêden ynstelle dy brûkt wurde foar de werjefte fan websiden +Comment[ga]=Cumraigh na stílbhileoga a úsáidtear chun leathanaigh ghréasáin a rindreáil +Comment[gl]=Configurar as follas de estilo empregadas para visualizar páxinas +Comment[he]=שינוי הגדרות גיליונות הסגנון המשמשים להצגת דפי אינטרנט +Comment[hi]=वेब पृष्ठ प्रस्तुत करने के लिए उपयोग में आने वाले स्टाइलशीट कॉन्फ़िगर करें +Comment[hr]=Konfiguriranje stilskih oblikovanja koja se upotrebljavaju za prikaz web sadržaja +Comment[hu]=A weboldalak megjelenítéséhez használt stíluslapok beállításai +Comment[is]=Stilla stílblöð sem vinna á HTML skrám +Comment[it]=Configura i fogli di stile da usare per visualizzare le pagine web +Comment[ja]=ウェブページのレンダリングに使用するスタイルシートを設定 +Comment[ka]=CSS კონფიგურაცია ვებ გვერდების ასახვისთვის +Comment[kk]=Веб-парақтарды көрсеткенде қолданатын CSS-стильдерді баптау +Comment[km]=កំណត់​រចនាសម្ព័ន្ធ​សន្លឹក​រចនាប័ទ្ម ដែល​ប្រើ​ដើម្បី​បង្ហាញ​ទំព័រ​បណ្ដាញ +Comment[ko]=웹 페이지를 나타내는 스타일시트를 설정합니다 +Comment[lo]=ປັບແຕ່ງສະຕາຍຊິດໃນການສະແດງຜົນ HTML +Comment[lt]=Konfigūruoti stiliaus aprašymus naudojamus tinklalapių atvaizdavimui +Comment[lv]=Konfigurēt stilus, ko izmantos tīmekļa lapu attainošanai +Comment[mk]=Конфигурирајте ги страниците со дизајн\nшто се користат за прикажување веб-страници +Comment[mn]=Хэлбэрт хуудас хэрэглэдэг HTML-хуудсуудын тохируулга +Comment[ms]=Konfigur lembaran gaya yang digunakan untuk merealisasikan laman web +Comment[mt]=Ikkonfigura l-istylesheets li jintużaw biex juru paġni fuq il-web. +Comment[nb]=Her kan du sette opp stilsett for visning av nettsider +Comment[nds]=Stell de Stilvörlaag in, de för't Wiesen vun Nettsieden bruukt warrt +Comment[ne]=रेन्डर वेब पृष्ठहरू प्रयोग गर्ने शैलीपाना कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u de stijlbladen instellen die gebruikt worden voor de weergave van webpagina's +Comment[nn]=Oppsett av stilsett for vising av nettsider +Comment[nso]=Beakanya matlakala a mokgwa ao a somisitswego go neela matlakala a web +Comment[pa]= ਵੈਬ ਸਫਿਆਂ ਨੂੰ ਪੇਸ਼ ਕਰਨ ਲਈ ਸਾਰਣੀਕਾਰ ਸ਼ੀਟਾਂ ਦੀ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja arkuszy stylów do wyświetlania stron internetowych +Comment[pt]=Configuração das folhas de estilo, usadas para mostrar as páginas Web +Comment[pt_BR]=Configura as folhas de estilo utilizadas para renderizar páginas da web +Comment[ro]=Configurează foile de stil utilizate la randarea paginilor de web +Comment[ru]=Настройка стилей CSS, используемых при показа веб-страниц +Comment[rw]=Kuboneza impapuromisusire zikoreshwa mu gutanga amapaji rubugamakuru +Comment[se]=Heivet stiilaárkkaid mainna čájeha HTML-siidduid +Comment[sk]=Nastavenie štýlov používaných pre zobrazovanie HTML +Comment[sl]=Nastavite slogovne predloge za upodabljanje HTML +Comment[sr]=Подешавање стилова који се користе за приказ веб страница +Comment[sr@Latn]=Podešavanje stilova koji se koriste za prikaz veb stranica +Comment[sv]=Anpassa stilmallarna som används för att visa webbsidor +Comment[ta]=வலை பக்கங்கள் நடைமுறைக்கு பயன்படுத்தப்பட்ட பாணிபட்டியல்களை வடிவமை +Comment[tg]=Танзимоти услуби CSS, дар вақти равшан созии варақаҳои вэб истифода мешаванд. +Comment[th]=ปรับแต่งสไตล์ชีตที่ใช้ในการแสดงผล HTML +Comment[tr]=Stylesheet ayarlarını yapın +Comment[tt]=Web-bitlär eşkärtkändä qullanıla torğan tışlaw caylawları +Comment[uk]=Налаштування таблиць стилів для відображення сторінок Тенет +Comment[uz]=Veb-sahifalarni koʻrsatishda ishlatiladigan CSS uslublarini moslash +Comment[uz@cyrillic]=Веб-саҳифаларни кўрсатишда ишлатиладиган CSS услубларини мослаш +Comment[ven]=Dzudzanyani tshitaela tsha siatari tshino shumiswa u nekedza masiatari a webu +Comment[vi]=Cấu hình kiểu dáng mẫu được dùng để hỗ trợ trang mạng +Comment[wa]=Apontyî les foyes di stîle eployeyes ezès pådjes waibe +Comment[xh]=Qwalasela uhlobo lwamakhasi asebenziswa ukuchaza amaphepha e web +Comment[zh_CN]=配置用来渲染网页的样式表 +Comment[zh_TW]=設定用來顯示網頁的樣式表單 +Comment[zu]=Hlanganisela amakhasi esitayela asetshenziswa ukunikeza amakhasi e-web + +Keywords=CSS,HTML,style,stylesheet,accessibility +Keywords[az]=CSS,HTML,style,tərz,stylesheet,yetişmə,yetişmə qabiliyyəti +Keywords[be]=Стыль,табліца стыляў,даступнасць,CSS,HTML,style,stylesheet,accessibility +Keywords[bg]=стил, стилове, страници, достъпност, CSS, HTML, style, stylesheet, accessibility +Keywords[br]=CSS,HTML,giz,folenn c'hiz,haezadusted +Keywords[ca]=CSS,HTML,estil,full d'estil,accessibilitat +Keywords[cs]=CSS,HTML,styl,style,stylesheet,zpřístupnění +Keywords[csb]=CSS,HTML,sztél,bòga sztélu,przistãpnosc +Keywords[cy]=CSS,HTML,ardull,dalen arddull,hygyrchedd +Keywords[da]=CSS,HTML,stil,stilark,tilgængelighed +Keywords[de]=CSS,HTML,Stylesheet,Stilvorlagen,Zugangshilfen +Keywords[el]=CSS,HTML,στυλ,φύλλο στυλ,προσιτότητα +Keywords[eo]=CSS,HTML,stilo,stildifino,alirebleco +Keywords[es]=CSS,HTML,estilo,hoja de estilo,accesibilidad +Keywords[et]=CSS,HTML,stiil,laaditabel +Keywords[eu]=CSS,HTML,estiloa,estilo orria,erabilerraztasuna +Keywords[fa]=CSS، زنگام، سبک، صفحه سبک، دستیابی‌پذیری +Keywords[fi]=CSS,HTML,tyyli,tyylimäärittely,esteettömyys +Keywords[fo]=CSS,HTML,snið,sniðørk,sniðark +Keywords[fr]=CSS,HTML,style,feuille de style,accessibilité +Keywords[fy]=CSS,HTML,styl,stylblêd,tagonklikens,stylblêden +Keywords[ga]=CSS,HTML,stíl,stílbhileog,inrochtaineacht +Keywords[gl]=CSS,HTML,estilo,follas de estilo,acesibilidade +Keywords[he]=CSS,HTML,סגנון,גיליון סגנון,נגישות,style,stylesheet,accessibility +Keywords[hi]=सीएसएस,एचटीएमएल,स्टाइल,स्टाइलशीट,पहुँच +Keywords[hr]=CSS,HTML,style,stylesheet,accessibility,stil,stilsko oblikovanje,pristupačnost +Keywords[hu]=CSS,HTML,stílus,stíluslap,elérhetőség +Keywords[id]=Gaya,style,theme,themes,tampilan,aksesbilitas +Keywords[is]=CSS,HTML,stíll,stílblað,aðgengi,aðgengilegheit,aðgangur +Keywords[it]=CSS,HTML,stile,fogli di stile,stylesheet,accessibilità +Keywords[ja]=CSS,HTML,スタイル,スタイルシート,アクセシビリティ +Keywords[km]=CSS,HTML,រចនាប័ទ្ម,សន្លឹក​រចនាប័ទ្ម,ភាព​អាច​ចូល​ដំណើរការ​បាន +Keywords[ko]=CSS,HTML,스타일,스타일시트,접근성 +Keywords[lt]=CSS,HTML,style,stylesheet,accessibility,stilius,stiliaus aprašymas +Keywords[lv]=CSS,HTML,stils,stilusaraksts,pieejamība +Keywords[mk]=CSS,HTML,style,stylesheet,accessibility,стил,страница,дизајн,пристапност +Keywords[mn]=CSS,HTML,Stylesheet,Хэлбэрт хуудас,Хэрэглэх тохь +Keywords[mt]=CSS,HTML,style,stylesheet,accessibility,aċċessibbiltà +Keywords[nb]=CSS,HTML,stil,stilsett,tilgjengelighet +Keywords[nds]=CSS,HTML,Stil,Stilvörlaag,Behinnerte +Keywords[ne]=CSS, HTML, शैली, शैलीपाना, पहुँचता +Keywords[nl]=CSS,HTML,stijl,stylesheet,toegankelijkheid,stijlbladen +Keywords[nn]=CSS,HTML,stilsett,tilgjenge,brukarstilsett +Keywords[nso]=CSS,HTML,mokgwa,letlakala la mokgwa,tsenelo +Keywords[pa]=CSS,HTML,style,stylesheet,accessibility, ਸ਼ੈਲੀ +Keywords[pl]=CSS,HTML,styl,arkusz stylu,dostępność +Keywords[pt]=CSS,HTML,estilo,stylesheet,acessibilidade +Keywords[pt_BR]=CSS,HTML,estilo,folha de estilo,acessibilidade +Keywords[ro]=CSS,HTML,stil,foi de stil,accesibilitate +Keywords[rw]=CSS,HTML,imisusire,urupapuromisusire,ukugerwaho +Keywords[se]=CSS,HTML,stiila,stiilaárka +Keywords[sk]=CSS,HTML,štýl,style,stylesheet,prístupnosť +Keywords[sl]=CSS,HTML,slog,slogovne predloge,dostopnost +Keywords[sr]=CSS,HTML,style,stylesheet,accessibility,стил,опис стила,приступачност +Keywords[sr@Latn]=CSS,HTML,style,stylesheet,accessibility,stil,opis stila,pristupačnost +Keywords[sv]=CSS,HTML,stil,stilmall,handikappstöd +Keywords[ta]=CSS,HTML,பாணிe,விரிப்பட்டியல்,அணுகல் +Keywords[tr]=CSS,HTML,style,stil,stylesheet,erişim,erişilebilirlik +Keywords[uk]=CSS,HTML,стиль,таблиця стилів,доступність +Keywords[uz]=CSS,HTML,uslub,stylesheet,qulayliklar +Keywords[uz@cyrillic]=CSS,HTML,услуб,stylesheet,қулайликлар +Keywords[ven]=CSS,HTML,tshitaela,siatari la tshitaela,u dzhenea +Keywords[vi]=CSS,HTML,kiểu dáng,kiểu dáng mẫu,hỗ trợ người tàn tật +Keywords[wa]=CSS,HTML,style,stylesheet,accessibility,stîle,foye di stîle,accessibilité +Keywords[xh]=CSS,HTML,uhlobo,ikhasi lohlobo oluthile,unikezelo +Keywords[zh_CN]=CSS,HTML,style,stylesheet,accessibility,风格,样式表,辅助功能 +Keywords[zh_TW]=CSS,HTML,style,stylesheet,accessibility,風格,風格表單,可用性 +Keywords[zu]=CSS,HTML,isitayela,ikhasi lesitayela,ukungena + +Categories=Qt;KDE;X-KDE-settings-webbrowsing; diff --git a/kcontrol/css/kcmcss.h b/kcontrol/css/kcmcss.h new file mode 100644 index 000000000..decf5c3a3 --- /dev/null +++ b/kcontrol/css/kcmcss.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2000 Matthias Hoelzer-Kluepfel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + */ + +#ifndef __KCMCSS_H__ +#define __KCMCSS_H__ + + +#include + +#include + + +class CSSConfigDialog; +class CSSCustomDialog; +class KDialogBase; + + +class CSSConfig : public KCModule +{ + Q_OBJECT + +public: + + CSSConfig(QWidget *parent = 0L, const char *name = 0L, const QStringList &list =QStringList() ); + + void load(); + void load( bool useDefaults ); + void save(); + void defaults(); + +public slots: + + void slotPreview(); + void slotCustomize(); + +private: + + QMap cssDict(); + + CSSConfigDialog *configDialog; + CSSCustomDialog *customDialog; + KDialogBase *customDialogBase; +}; + + +#endif diff --git a/kcontrol/css/preview.ui b/kcontrol/css/preview.ui new file mode 100644 index 000000000..438d40d37 --- /dev/null +++ b/kcontrol/css/preview.ui @@ -0,0 +1,95 @@ + +PreviewDialog + + + PreviewDialog + + + + 0 + 0 + 558 + 349 + + + + Preview + + + + unnamed + + + + Line1 + + + 5 + + + + + Spacer1 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + preview + + + <qt> + +<h1>Heading 1</h1><br/> +<h2>Heading 2</h2><br/> +<h3>Heading 3</h3><br/> + +<p>User defined stylesheets allow increased +accessibility for visually handicapped +people.</p> + +</qt> + + + + + PushButton2 + + + &OK + + + true + + + + + + + PushButton2 + clicked() + PreviewDialog + accept() + + + + kseparator.h + kdialog.h + + + + + kseparator.h + + diff --git a/kcontrol/css/template.cpp b/kcontrol/css/template.cpp new file mode 100644 index 000000000..94eba6053 --- /dev/null +++ b/kcontrol/css/template.cpp @@ -0,0 +1,45 @@ + + +#include + + +#include "template.h" + + +bool CSSTemplate::expand(QString destname, const QMap &dict) +{ + QFile inf(_filename); + if (!inf.open(IO_ReadOnly)) + return false; + QTextStream is(&inf); + + QFile outf(destname); + if (!outf.open(IO_WriteOnly)) + return false; + QTextStream os(&outf); + + QString line; + while (!is.eof()) + { + line = is.readLine(); + + int start = line.find('$'); + if (start >= 0) + { + int end = line.find('$', start+1); + if (end >= 0) + { + QString expr = line.mid(start+1, end-start-1); + QString res = dict[expr]; + + line.replace(start, end-start+1, res); + } + } + os << line << endl; + } + + inf.close(); + outf.close(); + + return true; +} diff --git a/kcontrol/css/template.css b/kcontrol/css/template.css new file mode 100644 index 000000000..dd2afaba9 --- /dev/null +++ b/kcontrol/css/template.css @@ -0,0 +1,77 @@ +/* + * Font sizes + */ + +* { + font-size : $fontsize-base$ ! important; +} + +SMALL, SUB, SUP { + font-size : $fontsize-small-1$ ! important; +} + +BIG { + font-size : $fontsize-large-1$ ! important; +} + +H1, H1 A { + font-size : $fontsize-large-5$ ! important; +} + +H2, H2 A { + font-size : $fontsize-large-4$ ! important; +} + +H3, H3 A { + font-size : $fontsize-large-3$ ! important; +} + +H4, H4 A { + font-size : $fontsize-large-2$ ! important; +} + +H5, H5 A { + font-size : $fontsize-large-1$ ! important; +} + + +/* + * Colors + */ + +* { + background : $background-color$ ! important; + color : $foreground-color$ + $force-color$; +} + +BODY { + color : $foreground-color$ ! important; +} + +TABLE, TD { + border-color : $foreground-color$; +} + + +/* + * Font family + */ + +* { + font-family : $font-family$ + $force-font$; +} + + +/* + * Images + */ + +IMG { + $display-images$; +} + +BODY { + $display-background$; +} diff --git a/kcontrol/css/template.h b/kcontrol/css/template.h new file mode 100644 index 000000000..2b701a238 --- /dev/null +++ b/kcontrol/css/template.h @@ -0,0 +1,21 @@ +#ifndef __TEMPLATE_H__ +#define __TEMPLATE_H__ + + +#include +#include + +class CSSTemplate +{ +public: + + CSSTemplate(QString fname) : _filename(fname) {}; + bool expand(QString destname, const QMap &dict); + +protected: + QString _filename; + +}; + + +#endif -- cgit v1.2.1