From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcontrol/css/kcmcss.cpp | 134 +++++++++++++++++++++++----------------------- kcontrol/css/kcmcss.h | 6 +-- kcontrol/css/template.cpp | 18 +++---- kcontrol/css/template.h | 10 ++-- 4 files changed, 84 insertions(+), 84 deletions(-) (limited to 'kcontrol/css') diff --git a/kcontrol/css/kcmcss.cpp b/kcontrol/css/kcmcss.cpp index bd72a1375..552afd3a3 100644 --- a/kcontrol/css/kcmcss.cpp +++ b/kcontrol/css/kcmcss.cpp @@ -1,9 +1,9 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -22,13 +22,13 @@ #include "kcmcss.h" -typedef KGenericFactory CSSFactory; +typedef KGenericFactory CSSFactory; K_EXPORT_COMPONENT_FACTORY( kcm_css, CSSFactory("kcmcss") ) -CSSConfig::CSSConfig(QWidget *parent, const char *name, const QStringList &) +CSSConfig::CSSConfig(TQWidget *parent, const char *name, const TQStringList &) : KCModule(CSSFactory::instance(), parent, name) { - customDialogBase = new KDialogBase(this, "customCSSDialog", true, QString::null, + customDialogBase = new KDialogBase(this, "customCSSDialog", true, TQString::null, KDialogBase::Close, KDialogBase::Close, true ); customDialog = new CSSCustomDialog(customDialogBase); customDialogBase->setMainWidget(customDialog); @@ -46,52 +46,52 @@ CSSConfig::CSSConfig(QWidget *parent, const char *name, const QStringList &) " that are unreadable due to bad design.")); - QStringList fonts; + TQStringList 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); + connect(configDialog->useDefault, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(configDialog->useAccess, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(configDialog->useUser, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(configDialog->urlRequester, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(changed())); + connect(configDialog->customize, TQT_SIGNAL(clicked()), + TQT_SLOT(slotCustomize())); + connect(customDialog->basefontsize, TQT_SIGNAL(highlighted(int)), + TQT_SLOT(changed())); + connect(customDialog->basefontsize, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(changed())); + connect(customDialog->dontScale, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(customDialog->blackOnWhite, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(customDialog->whiteOnBlack, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(customDialog->customColor, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(customDialog->foregroundColor, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(changed())); + connect(customDialog->backgroundColor, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(changed())); + connect(customDialog->fontFamily, TQT_SIGNAL(highlighted(int)), + TQT_SLOT(changed())); + connect(customDialog->fontFamily, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(changed())); + connect(customDialog->sameFamily, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(customDialog->preview, TQT_SIGNAL(clicked()), + TQT_SLOT(slotPreview())); + connect(customDialog->sameColor, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(customDialog->hideImages, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + connect(customDialog->hideBackground, TQT_SIGNAL(clicked()), + TQT_SLOT(changed())); + + TQVBoxLayout *vbox = new TQVBoxLayout(this, 0, 0); vbox->addWidget(configDialog); load(); @@ -108,17 +108,17 @@ void CSSConfig::load( bool useDefaults ) c->setReadDefaults( useDefaults ); c->setGroup("Stylesheet"); - QString u = c->readEntry("Use", "default"); + TQString 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->basefontsize->setEditText(TQString::number(c->readNumEntry("BaseSize", 12))); customDialog->dontScale->setChecked(c->readBoolEntry("DontScale", false)); - QString fname = c->readEntry("Family", "Arial"); + TQString fname = c->readEntry("Family", "Arial"); for (int i=0; i < customDialog->fontFamily->count(); ++i) if (customDialog->fontFamily->text(i) == fname) { @@ -129,7 +129,7 @@ void CSSConfig::load( bool useDefaults ) customDialog->sameFamily->setChecked(c->readBoolEntry("SameFamily", false)); c->setGroup("Colors"); - QString m = c->readEntry("Mode", "black-on-white"); + TQString 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"); @@ -187,8 +187,8 @@ void CSSConfig::save() delete c; // generate CSS template - QString templ = locate("data", "kcmcss/template.css"); - QString dest; + TQString templ = locate("data", "kcmcss/template.css"); + TQString dest; if (!templ.isEmpty()) { CSSTemplate css(templ); @@ -222,18 +222,18 @@ void CSSConfig::defaults() } -QString px(int i, double scale) +TQString px(int i, double scale) { - QString px; + TQString px; px.setNum(static_cast(i * scale)); px += "px"; return px; } -QMap CSSConfig::cssDict() +TQMap CSSConfig::cssDict() { - QMap dict; + TQMap dict; // Fontsizes ------------------------------------------------------ @@ -314,10 +314,10 @@ void CSSConfig::slotCustomize() 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"); + TQStyleSheetItem *h1 = new TQStyleSheetItem(TQStyleSheet::defaultSheet(), "h1"); + TQStyleSheetItem *h2 = new TQStyleSheetItem(TQStyleSheet::defaultSheet(), "h2"); + TQStyleSheetItem *h3 = new TQStyleSheetItem(TQStyleSheet::defaultSheet(), "h3"); + TQStyleSheetItem *text = new TQStyleSheetItem(TQStyleSheet::defaultSheet(), "p"); // Fontsize @@ -338,7 +338,7 @@ void CSSConfig::slotPreview() // Colors - QColor back, fore; + TQColor back, fore; if (customDialog->blackOnWhite->isChecked()) { @@ -371,7 +371,7 @@ void CSSConfig::slotPreview() // Show the preview PreviewDialog *dlg = new PreviewDialog(this, 0, true); dlg->preview->setPaper(back); - dlg->preview->viewport()->setFont(QFont(KGlobalSettings::generalFont().family(), bfs)); + dlg->preview->viewport()->setFont(TQFont(KGlobalSettings::generalFont().family(), bfs)); dlg->exec(); diff --git a/kcontrol/css/kcmcss.h b/kcontrol/css/kcmcss.h index decf5c3a3..164f22dae 100644 --- a/kcontrol/css/kcmcss.h +++ b/kcontrol/css/kcmcss.h @@ -19,7 +19,7 @@ #define __KCMCSS_H__ -#include +#include #include @@ -35,7 +35,7 @@ class CSSConfig : public KCModule public: - CSSConfig(QWidget *parent = 0L, const char *name = 0L, const QStringList &list =QStringList() ); + CSSConfig(TQWidget *parent = 0L, const char *name = 0L, const TQStringList &list =TQStringList() ); void load(); void load( bool useDefaults ); @@ -49,7 +49,7 @@ public slots: private: - QMap cssDict(); + TQMap cssDict(); CSSConfigDialog *configDialog; CSSCustomDialog *customDialog; diff --git a/kcontrol/css/template.cpp b/kcontrol/css/template.cpp index 94eba6053..e237ed796 100644 --- a/kcontrol/css/template.cpp +++ b/kcontrol/css/template.cpp @@ -1,24 +1,24 @@ -#include +#include #include "template.h" -bool CSSTemplate::expand(QString destname, const QMap &dict) +bool CSSTemplate::expand(TQString destname, const TQMap &dict) { - QFile inf(_filename); + TQFile inf(_filename); if (!inf.open(IO_ReadOnly)) return false; - QTextStream is(&inf); + TQTextStream is(&inf); - QFile outf(destname); + TQFile outf(destname); if (!outf.open(IO_WriteOnly)) return false; - QTextStream os(&outf); + TQTextStream os(&outf); - QString line; + TQString line; while (!is.eof()) { line = is.readLine(); @@ -29,8 +29,8 @@ bool CSSTemplate::expand(QString destname, const QMap &dict) int end = line.find('$', start+1); if (end >= 0) { - QString expr = line.mid(start+1, end-start-1); - QString res = dict[expr]; + TQString expr = line.mid(start+1, end-start-1); + TQString res = dict[expr]; line.replace(start, end-start+1, res); } diff --git a/kcontrol/css/template.h b/kcontrol/css/template.h index 2b701a238..bdcc8ad63 100644 --- a/kcontrol/css/template.h +++ b/kcontrol/css/template.h @@ -2,18 +2,18 @@ #define __TEMPLATE_H__ -#include -#include +#include +#include class CSSTemplate { public: - CSSTemplate(QString fname) : _filename(fname) {}; - bool expand(QString destname, const QMap &dict); + CSSTemplate(TQString fname) : _filename(fname) {}; + bool expand(TQString destname, const TQMap &dict); protected: - QString _filename; + TQString _filename; }; -- cgit v1.2.1