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/icons/icons.cpp | 200 +++++++++++++++++++++--------------------- kcontrol/icons/icons.h | 54 ++++++------ kcontrol/icons/iconthemes.cpp | 112 +++++++++++------------ kcontrol/icons/iconthemes.h | 24 ++--- kcontrol/icons/main.cpp | 16 ++-- kcontrol/icons/main.h | 8 +- 6 files changed, 207 insertions(+), 207 deletions(-) (limited to 'kcontrol/icons') diff --git a/kcontrol/icons/icons.cpp b/kcontrol/icons/icons.cpp index 4ce1e4d98..84b6efac3 100644 --- a/kcontrol/icons/icons.cpp +++ b/kcontrol/icons/icons.cpp @@ -11,12 +11,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -32,71 +32,71 @@ /**** KIconConfig ****/ -KIconConfig::KIconConfig(QWidget *parent, const char *name) +KIconConfig::KIconConfig(TQWidget *parent, const char *name) : KCModule(parent, name) { - QGridLayout *top = new QGridLayout(this, 4, 2, + TQGridLayout *top = new TQGridLayout(this, 4, 2, KDialog::marginHint(), KDialog::spacingHint()); top->setColStretch(0, 1); top->setColStretch(1, 1); // Use of Icon at (0,0) - (1, 0) - QGroupBox *gbox = new QGroupBox(i18n("Use of Icon"), this); + TQGroupBox *gbox = new TQGroupBox(i18n("Use of Icon"), this); top->addMultiCellWidget(gbox, 0, 1, 0, 0); - QBoxLayout *g_vlay = new QVBoxLayout(gbox, + TQBoxLayout *g_vlay = new TQVBoxLayout(gbox, KDialog::marginHint(), KDialog::spacingHint()); g_vlay->addSpacing(fontMetrics().lineSpacing()); - mpUsageList = new QListBox(gbox); - connect(mpUsageList, SIGNAL(highlighted(int)), SLOT(slotUsage(int))); + mpUsageList = new TQListBox(gbox); + connect(mpUsageList, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotUsage(int))); g_vlay->addWidget(mpUsageList); KSeparator *sep = new KSeparator( KSeparator::HLine, this ); top->addWidget(sep, 1, 1); // Preview at (2,0) - (2, 1) - QGridLayout *g_lay = new QGridLayout(4, 3, KDialog::marginHint(), 0); + TQGridLayout *g_lay = new TQGridLayout(4, 3, KDialog::marginHint(), 0); top->addMultiCellLayout(g_lay, 2, 2, 0, 1); g_lay->addRowSpacing(0, fontMetrics().lineSpacing()); - QPushButton *push; + TQPushButton *push; mPreviewButton1 = addPreviewIcon(0, i18n("Default"), this, g_lay); - connect(mPreviewButton1, SIGNAL(clicked()), SLOT(slotEffectSetup0())); + connect(mPreviewButton1, TQT_SIGNAL(clicked()), TQT_SLOT(slotEffectSetup0())); mPreviewButton2 = addPreviewIcon(1, i18n("Active"), this, g_lay); - connect(mPreviewButton2, SIGNAL(clicked()), SLOT(slotEffectSetup1())); + connect(mPreviewButton2, TQT_SIGNAL(clicked()), TQT_SLOT(slotEffectSetup1())); mPreviewButton3 = addPreviewIcon(2, i18n("Disabled"), this, g_lay); - connect(mPreviewButton3, SIGNAL(clicked()), SLOT(slotEffectSetup2())); + connect(mPreviewButton3, TQT_SIGNAL(clicked()), TQT_SLOT(slotEffectSetup2())); - m_pTab1 = new QWidget(this, "General Tab"); + m_pTab1 = new TQWidget(this, "General Tab"); top->addWidget(m_pTab1, 0, 1); - QGridLayout *grid = new QGridLayout(m_pTab1, 4, 3, 10, 10); + TQGridLayout *grid = new TQGridLayout(m_pTab1, 4, 3, 10, 10); grid->setColStretch(1, 1); grid->setColStretch(2, 1); // Size - QLabel *lbl = new QLabel(i18n("Size:"), m_pTab1); + TQLabel *lbl = new TQLabel(i18n("Size:"), m_pTab1); lbl->setFixedSize(lbl->sizeHint()); grid->addWidget(lbl, 0, 0, Qt::AlignLeft); - mpSizeBox = new QComboBox(m_pTab1); - connect(mpSizeBox, SIGNAL(activated(int)), SLOT(slotSize(int))); + mpSizeBox = new TQComboBox(m_pTab1); + connect(mpSizeBox, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSize(int))); lbl->setBuddy(mpSizeBox); grid->addWidget(mpSizeBox, 0, 1, Qt::AlignLeft); - mpDPCheck = new QCheckBox(i18n("Double-sized pixels"), m_pTab1); - connect(mpDPCheck, SIGNAL(toggled(bool)), SLOT(slotDPCheck(bool))); + mpDPCheck = new TQCheckBox(i18n("Double-sized pixels"), m_pTab1); + connect(mpDPCheck, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotDPCheck(bool))); grid->addMultiCellWidget(mpDPCheck, 1, 1, 0, 1, Qt::AlignLeft); - mpAnimatedCheck = new QCheckBox(i18n("Animate icons"), m_pTab1); - connect(mpAnimatedCheck, SIGNAL(toggled(bool)), SLOT(slotAnimatedCheck(bool))); + mpAnimatedCheck = new TQCheckBox(i18n("Animate icons"), m_pTab1); + connect(mpAnimatedCheck, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotAnimatedCheck(bool))); grid->addMultiCellWidget(mpAnimatedCheck, 2, 2, 0, 1, Qt::AlignLeft); top->activate(); - mpSystrayConfig = new KSimpleConfig( QString::fromLatin1( "systemtray_panelappletrc" )); - mpKickerConfig = new KSimpleConfig( QString::fromLatin1( "kickerrc" )); + mpSystrayConfig = new KSimpleConfig( TQString::fromLatin1( "systemtray_panelappletrc" )); + mpKickerConfig = new KSimpleConfig( TQString::fromLatin1( "kickerrc" )); init(); read(); @@ -110,15 +110,15 @@ KIconConfig::~KIconConfig() delete mpEffect; } -QPushButton *KIconConfig::addPreviewIcon(int i, const QString &str, QWidget *parent, QGridLayout *lay) +TQPushButton *KIconConfig::addPreviewIcon(int i, const TQString &str, TQWidget *parent, TQGridLayout *lay) { - QLabel *lab = new QLabel(str, parent); + TQLabel *lab = new TQLabel(str, parent); lay->addWidget(lab, 1, i, AlignCenter); - mpPreview[i] = new QLabel(parent); + mpPreview[i] = new TQLabel(parent); mpPreview[i]->setAlignment(AlignCenter); mpPreview[i]->setMinimumSize(105, 105); lay->addWidget(mpPreview[i], 2, i); - QPushButton *push = new QPushButton(i18n("Set Effect..."), parent); + TQPushButton *push = new TQPushButton(i18n("Set Effect..."), parent); lay->addWidget(push, 3, i, AlignCenter); return push; } @@ -166,17 +166,17 @@ void KIconConfig::initDefaults() mDefaultEffect[0].value = 1.0; mDefaultEffect[1].value = 1.0; mDefaultEffect[2].value = 1.0; - mDefaultEffect[0].color = QColor(144,128,248); - mDefaultEffect[1].color = QColor(169,156,255); - mDefaultEffect[2].color = QColor(34,202,0); - mDefaultEffect[0].color2 = QColor(0,0,0); - mDefaultEffect[1].color2 = QColor(0,0,0); - mDefaultEffect[2].color2 = QColor(0,0,0); + mDefaultEffect[0].color = TQColor(144,128,248); + mDefaultEffect[1].color = TQColor(169,156,255); + mDefaultEffect[2].color = TQColor(34,202,0); + mDefaultEffect[0].color2 = TQColor(0,0,0); + mDefaultEffect[1].color2 = TQColor(0,0,0); + mDefaultEffect[2].color2 = TQColor(0,0,0); const int defDefSizes[] = { 32, 22, 22, 16, 32 }; KIcon::Group i; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for(it=mGroups.begin(), i=KIcon::FirstGroup; it!=mGroups.end(); ++it, i++) { mbDP[i] = false; @@ -229,16 +229,16 @@ void KIconConfig::read() else { for (KIcon::Group i=KIcon::FirstGroup; i(); + mAvSizes[i] = TQValueList(); - mTheme = QString::null; - mExample = QString::null; + mTheme = TQString::null; + mExample = TQString::null; } initDefaults(); int i, j, effect; - QStringList::ConstIterator it, it2; + TQStringList::ConstIterator it, it2; for (it=mGroups.begin(), i=0; it!=mGroups.end(); ++it, i++) { mbChanged[i] = false; @@ -250,7 +250,7 @@ void KIconConfig::read() for (it2=mStates.begin(), j=0; it2!=mStates.end(); ++it2, j++) { - QString tmp = mpConfig->readEntry(*it2 + "Effect"); + TQString tmp = mpConfig->readEntry(*it2 + "Effect"); if (tmp == "togray") effect = KIconEffect::ToGray; else if (tmp == "colorize") @@ -288,40 +288,40 @@ void KIconConfig::apply() if (mpUsageList->currentText() == i18n("Panel Buttons")) { mpSizeBox->clear(); - mpSizeBox->insertItem(QString().setNum(16)); - mpSizeBox->insertItem(QString().setNum(22)); - mpSizeBox->insertItem(QString().setNum(32)); - mpSizeBox->insertItem(QString().setNum(48)); - mpSizeBox->insertItem(QString().setNum(64)); - mpSizeBox->insertItem(QString().setNum(128)); + mpSizeBox->insertItem(TQString().setNum(16)); + mpSizeBox->insertItem(TQString().setNum(22)); + mpSizeBox->insertItem(TQString().setNum(32)); + mpSizeBox->insertItem(TQString().setNum(48)); + mpSizeBox->insertItem(TQString().setNum(64)); + mpSizeBox->insertItem(TQString().setNum(128)); for (i=0;i<(mpSizeBox->count());i++) { - if (mpSizeBox->text(i) == QString().setNum(mQuickLaunchSize)) { + if (mpSizeBox->text(i) == TQString().setNum(mQuickLaunchSize)) { mpSizeBox->setCurrentItem(i); } } } else if (mpUsageList->currentText() == i18n("System Tray Icons")) { mpSizeBox->clear(); - mpSizeBox->insertItem(QString().setNum(16)); - mpSizeBox->insertItem(QString().setNum(22)); - mpSizeBox->insertItem(QString().setNum(32)); - mpSizeBox->insertItem(QString().setNum(48)); - mpSizeBox->insertItem(QString().setNum(64)); - mpSizeBox->insertItem(QString().setNum(128)); + mpSizeBox->insertItem(TQString().setNum(16)); + mpSizeBox->insertItem(TQString().setNum(22)); + mpSizeBox->insertItem(TQString().setNum(32)); + mpSizeBox->insertItem(TQString().setNum(48)); + mpSizeBox->insertItem(TQString().setNum(64)); + mpSizeBox->insertItem(TQString().setNum(128)); for (i=0;i<(mpSizeBox->count());i++) { - if (mpSizeBox->text(i) == QString().setNum(mSysTraySize)) { + if (mpSizeBox->text(i) == TQString().setNum(mSysTraySize)) { mpSizeBox->setCurrentItem(i); } } } else { int delta = 1000, dw, index = -1, size = 0, i; - QValueList::Iterator it; + TQValueList::Iterator it; mpSizeBox->clear(); if (mUsage < KIcon::LastGroup) { for (it=mAvSizes[mUsage].begin(), i=0; it!=mAvSizes[mUsage].end(); ++it, i++) { - mpSizeBox->insertItem(QString().setNum(*it)); + mpSizeBox->insertItem(TQString().setNum(*it)); dw = abs(mSizes[mUsage] - *it); if (dw < delta) { @@ -357,7 +357,7 @@ void KIconConfig::preview(int i) viewedGroup = (mUsage == KIcon::LastGroup) ? KIcon::FirstGroup : mUsage; } - QPixmap pm; + TQPixmap pm; if (mpUsageList->text(mUsage) == i18n("Panel Buttons")) { pm = mpLoader->loadIcon(mExample, KIcon::NoGroup, mQuickLaunchSize); } @@ -367,7 +367,7 @@ void KIconConfig::preview(int i) else { pm = mpLoader->loadIcon(mExample, KIcon::NoGroup, mSizes[viewedGroup]); } - QImage img = pm.convertToImage(); + TQImage img = pm.convertToImage(); if (mbDP[viewedGroup]) { int w = img.width() * 2; @@ -410,7 +410,7 @@ void KIconConfig::load( bool useDefaults ) void KIconConfig::save() { int i, j; - QStringList::ConstIterator it, it2; + TQStringList::ConstIterator it, it2; for (it=mGroups.begin(), i=0; it!=mGroups.end(); ++it, i++) { mpConfig->setGroup(*it + "Icons"); @@ -419,7 +419,7 @@ void KIconConfig::save() mpConfig->writeEntry("Animated", mbAnimated[i], true, true); for (it2=mStates.begin(), j=0; it2!=mStates.end(); ++it2, j++) { - QString tmp; + TQString tmp; switch (mEffects[i][j].type) { case KIconEffect::ToGray: @@ -476,10 +476,10 @@ void KIconConfig::save() } // Signal kicker to reload icon configuration - kapp->dcopClient()->send("kicker", "kicker", "configure()", QByteArray()); + kapp->dcopClient()->send("kicker", "kicker", "configure()", TQByteArray()); // Signal system tray to reload icon configuration - kapp->dcopClient()->send("kicker", "SystemTrayApplet", "iconSizeChanged()", QByteArray()); + kapp->dcopClient()->send("kicker", "SystemTrayApplet", "iconSizeChanged()", TQByteArray()); } void KIconConfig::defaults() @@ -544,15 +544,15 @@ void KIconConfig::EffectSetup(int state) return; } - QPixmap pm = mpLoader->loadIcon(mExample, KIcon::NoGroup, mSizes[viewedGroup]); - QImage img = pm.convertToImage(); + TQPixmap pm = mpLoader->loadIcon(mExample, KIcon::NoGroup, mSizes[viewedGroup]); + TQImage img = pm.convertToImage(); if (mbDP[viewedGroup]) { int w = img.width() * 2; img = img.smoothScale(w, w); } - QString caption; + TQString caption; switch (state) { case 0 : caption = i18n("Setup Default Icon Effect"); break; @@ -562,7 +562,7 @@ void KIconConfig::EffectSetup(int state) KIconEffectSetupDialog dlg(mEffects[viewedGroup][state], mDefaultEffect[state], caption, img); - if (dlg.exec() == QDialog::Accepted) + if (dlg.exec() == TQDialog::Accepted) { if (mUsage == KIcon::LastGroup) { for (int i=0; isetColStretch(0,1); top->addColSpacing(1,10); top->setColStretch(2,2); top->setRowStretch(1,1); - lbl = new QLabel(i18n("&Effect:"), page); + lbl = new TQLabel(i18n("&Effect:"), page); lbl->setFixedSize(lbl->sizeHint()); top->addWidget(lbl, 0, 0, Qt::AlignLeft); - mpEffectBox = new QListBox(page); + mpEffectBox = new TQListBox(page); mpEffectBox->insertItem(i18n("No Effect")); mpEffectBox->insertItem(i18n("To Gray")); mpEffectBox->insertItem(i18n("Colorize")); @@ -667,51 +667,51 @@ KIconEffectSetupDialog::KIconEffectSetupDialog(const Effect &effect, mpEffectBox->insertItem(i18n("Desaturate")); mpEffectBox->insertItem(i18n("To Monochrome")); mpEffectBox->setMinimumWidth( 100 ); - connect(mpEffectBox, SIGNAL(highlighted(int)), SLOT(slotEffectType(int))); + connect(mpEffectBox, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotEffectType(int))); top->addMultiCellWidget(mpEffectBox, 1, 2, 0, 0, Qt::AlignLeft); lbl->setBuddy(mpEffectBox); - mpSTCheck = new QCheckBox(i18n("&Semi-transparent"), page); - connect(mpSTCheck, SIGNAL(toggled(bool)), SLOT(slotSTCheck(bool))); + mpSTCheck = new TQCheckBox(i18n("&Semi-transparent"), page); + connect(mpSTCheck, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotSTCheck(bool))); top->addWidget(mpSTCheck, 3, 0, Qt::AlignLeft); - frame = new QGroupBox(i18n("Preview"), page); + frame = new TQGroupBox(i18n("Preview"), page); top->addMultiCellWidget(frame, 0, 1, 1, 1); - grid = new QGridLayout(frame, 2, 1, marginHint(), spacingHint()); + grid = new TQGridLayout(frame, 2, 1, marginHint(), spacingHint()); grid->addRowSpacing(0, fontMetrics().lineSpacing()); grid->setRowStretch(1, 1); - mpPreview = new QLabel(frame); + mpPreview = new TQLabel(frame); mpPreview->setAlignment(AlignCenter); mpPreview->setMinimumSize(105, 105); grid->addWidget(mpPreview, 1, 0); - mpEffectGroup = new QGroupBox(i18n("Effect Parameters"), page); + mpEffectGroup = new TQGroupBox(i18n("Effect Parameters"), page); top->addMultiCellWidget(mpEffectGroup, 2, 3, 1, 1); - grid = new QGridLayout(mpEffectGroup, 3, 2, marginHint(), spacingHint()); + grid = new TQGridLayout(mpEffectGroup, 3, 2, marginHint(), spacingHint()); grid->addRowSpacing(0, fontMetrics().lineSpacing()); - mpEffectLabel = new QLabel(i18n("&Amount:"), mpEffectGroup); + mpEffectLabel = new TQLabel(i18n("&Amount:"), mpEffectGroup); grid->addWidget(mpEffectLabel, 1, 0); - mpEffectSlider = new QSlider(0, 100, 5, 10, QSlider::Horizontal, mpEffectGroup); + mpEffectSlider = new TQSlider(0, 100, 5, 10, TQSlider::Horizontal, mpEffectGroup); mpEffectLabel->setBuddy( mpEffectSlider ); - connect(mpEffectSlider, SIGNAL(valueChanged(int)), SLOT(slotEffectValue(int))); + connect(mpEffectSlider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotEffectValue(int))); grid->addWidget(mpEffectSlider, 1, 1); - mpEffectColor = new QLabel(i18n("Co&lor:"), mpEffectGroup); + mpEffectColor = new TQLabel(i18n("Co&lor:"), mpEffectGroup); grid->addWidget(mpEffectColor, 2, 0); mpEColButton = new KColorButton(mpEffectGroup); mpEffectColor->setBuddy( mpEColButton ); - connect(mpEColButton, SIGNAL(changed(const QColor &)), - SLOT(slotEffectColor(const QColor &))); + connect(mpEColButton, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotEffectColor(const TQColor &))); grid->addWidget(mpEColButton, 2, 1); - mpEffectColor2 = new QLabel(i18n("&Second color:"), mpEffectGroup); + mpEffectColor2 = new TQLabel(i18n("&Second color:"), mpEffectGroup); grid->addWidget(mpEffectColor2, 3, 0); mpECol2Button = new KColorButton(mpEffectGroup); mpEffectColor2->setBuddy( mpECol2Button ); - connect(mpECol2Button, SIGNAL(changed(const QColor &)), - SLOT(slotEffectColor2(const QColor &))); + connect(mpECol2Button, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotEffectColor2(const TQColor &))); grid->addWidget(mpECol2Button, 3, 1); init(); @@ -741,13 +741,13 @@ void KIconEffectSetupDialog::slotEffectValue(int value) preview(); } -void KIconEffectSetupDialog::slotEffectColor(const QColor &col) +void KIconEffectSetupDialog::slotEffectColor(const TQColor &col) { mEffect.color = col; preview(); } -void KIconEffectSetupDialog::slotEffectColor2(const QColor &col) +void KIconEffectSetupDialog::slotEffectColor2(const TQColor &col) { mEffect.color2 = col; preview(); @@ -780,8 +780,8 @@ void KIconEffectSetupDialog::slotDefault() void KIconEffectSetupDialog::preview() { - QPixmap pm; - QImage img = mExample.copy(); + TQPixmap pm; + TQImage img = mExample.copy(); img = mpEffect->apply(img, mEffect.type, mEffect.value, mEffect.color, mEffect.color2, mEffect.transparant); pm.convertFromImage(img); diff --git a/kcontrol/icons/icons.h b/kcontrol/icons/icons.h index 6fa27eee3..13f20b264 100644 --- a/kcontrol/icons/icons.h +++ b/kcontrol/icons/icons.h @@ -12,9 +12,9 @@ #ifndef __icons_h__ #define __icons_h__ -#include -#include -#include +#include +#include +#include #include #include @@ -43,8 +43,8 @@ struct Effect { int type; float value; - QColor color; - QColor color2; + TQColor color; + TQColor color2; bool transparant; }; @@ -57,7 +57,7 @@ class KIconConfig: public KCModule Q_OBJECT public: - KIconConfig(QWidget *parent, const char *name=0); + KIconConfig(TQWidget *parent, const char *name=0); ~KIconConfig(); virtual void load(); @@ -80,7 +80,7 @@ private slots: private: void preview(int i); void EffectSetup(int state); - QPushButton *addPreviewIcon(int i, const QString &str, QWidget *parent, QGridLayout *lay); + TQPushButton *addPreviewIcon(int i, const TQString &str, TQWidget *parent, TQGridLayout *lay); void init(); void initDefaults(); void read(); @@ -89,14 +89,14 @@ private: bool mbDP[6], mbChanged[6], mbAnimated[6]; int mSizes[6]; - QValueList mAvSizes[6]; + TQValueList mAvSizes[6]; Effect mEffects[6][3]; Effect mDefaultEffect[3]; int mUsage; - QString mTheme, mExample; - QStringList mGroups, mStates; + TQString mTheme, mExample; + TQStringList mGroups, mStates; int mSysTraySize; int mQuickLaunchSize; @@ -107,15 +107,15 @@ private: KSimpleConfig *mpSystrayConfig; KSimpleConfig *mpKickerConfig; - typedef QLabel *QLabelPtr; + typedef TQLabel *QLabelPtr; QLabelPtr mpPreview[3]; - QListBox *mpUsageList; - QComboBox *mpSizeBox; - QCheckBox *mpDPCheck, *wordWrapCB, *underlineCB, *mpAnimatedCheck; - QTabWidget *m_pTabWidget; - QWidget *m_pTab1; - QPushButton *mPreviewButton1, *mPreviewButton2, *mPreviewButton3; + TQListBox *mpUsageList; + TQComboBox *mpSizeBox; + TQCheckBox *mpDPCheck, *wordWrapCB, *underlineCB, *mpAnimatedCheck; + TQTabWidget *m_pTabWidget; + TQWidget *m_pTab1; + TQPushButton *mPreviewButton1, *mPreviewButton2, *mPreviewButton3; }; class KIconEffectSetupDialog: public KDialogBase @@ -124,8 +124,8 @@ class KIconEffectSetupDialog: public KDialogBase public: KIconEffectSetupDialog(const Effect &, const Effect &, - const QString &, const QImage &, - QWidget *parent=0L, char *name=0L); + const TQString &, const TQImage &, + TQWidget *parent=0L, char *name=0L); ~KIconEffectSetupDialog(); Effect effect() { return mEffect; } @@ -135,24 +135,24 @@ protected: protected slots: void slotEffectValue(int value); - void slotEffectColor(const QColor &col); - void slotEffectColor2(const QColor &col); + void slotEffectColor(const TQColor &col); + void slotEffectColor2(const TQColor &col); void slotEffectType(int type); void slotSTCheck(bool b); void slotDefault(); private: KIconEffect *mpEffect; - QListBox *mpEffectBox; - QCheckBox *mpSTCheck; - QSlider *mpEffectSlider; + TQListBox *mpEffectBox; + TQCheckBox *mpSTCheck; + TQSlider *mpEffectSlider; KColorButton *mpEColButton; KColorButton *mpECol2Button; Effect mEffect; Effect mDefaultEffect; - QImage mExample; - QGroupBox *mpEffectGroup; - QLabel *mpPreview, *mpEffectLabel, *mpEffectColor, *mpEffectColor2; + TQImage mExample; + TQGroupBox *mpEffectGroup; + TQLabel *mpPreview, *mpEffectLabel, *mpEffectColor, *mpEffectColor2; }; #endif diff --git a/kcontrol/icons/iconthemes.cpp b/kcontrol/icons/iconthemes.cpp index a79ad6ddf..5d7f924a9 100644 --- a/kcontrol/icons/iconthemes.cpp +++ b/kcontrol/icons/iconthemes.cpp @@ -21,10 +21,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -51,21 +51,21 @@ #include "iconthemes.h" -IconThemesConfig::IconThemesConfig(QWidget *parent, const char *name) +IconThemesConfig::IconThemesConfig(TQWidget *parent, const char *name) : KCModule(parent, name) { - QVBoxLayout *topLayout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - QFrame *m_preview=new QFrame(this); + TQFrame *m_preview=new TQFrame(this); m_preview->setMinimumHeight(50); - QHBoxLayout *lh2=new QHBoxLayout( m_preview ); - m_previewExec=new QLabel(m_preview); + TQHBoxLayout *lh2=new TQHBoxLayout( m_preview ); + m_previewExec=new TQLabel(m_preview); m_previewExec->setPixmap(DesktopIcon("exec")); - m_previewFolder=new QLabel(m_preview); + m_previewFolder=new TQLabel(m_preview); m_previewFolder->setPixmap(DesktopIcon("folder")); - m_previewDocument=new QLabel(m_preview); + m_previewDocument=new TQLabel(m_preview); m_previewDocument->setPixmap(DesktopIcon("document")); lh2->addStretch(10); @@ -82,21 +82,21 @@ IconThemesConfig::IconThemesConfig(QWidget *parent, const char *name) m_iconThemes->addColumn(i18n("Description")); m_iconThemes->setAllColumnsShowFocus( true ); m_iconThemes->setFullWidth(true); - connect(m_iconThemes,SIGNAL(selectionChanged(QListViewItem *)), - SLOT(themeSelected(QListViewItem *))); + connect(m_iconThemes,TQT_SIGNAL(selectionChanged(TQListViewItem *)), + TQT_SLOT(themeSelected(TQListViewItem *))); - QPushButton *installButton=new QPushButton( i18n("Install New Theme..."), + TQPushButton *installButton=new TQPushButton( i18n("Install New Theme..."), this, "InstallNewTheme"); - connect(installButton,SIGNAL(clicked()),SLOT(installNewTheme())); - m_removeButton=new QPushButton( i18n("Remove Theme"), + connect(installButton,TQT_SIGNAL(clicked()),TQT_SLOT(installNewTheme())); + m_removeButton=new TQPushButton( i18n("Remove Theme"), this, "RemoveTheme"); - connect(m_removeButton,SIGNAL(clicked()),SLOT(removeSelectedTheme())); + connect(m_removeButton,TQT_SIGNAL(clicked()),TQT_SLOT(removeSelectedTheme())); topLayout->addWidget( - new QLabel(i18n("Select the icon theme you want to use:"), this)); + new TQLabel(i18n("Select the icon theme you want to use:"), this)); topLayout->addWidget(m_preview); topLayout->addWidget(m_iconThemes); - QHBoxLayout *lg = new QHBoxLayout(topLayout, KDialog::spacingHint()); + TQHBoxLayout *lg = new TQHBoxLayout(topLayout, KDialog::spacingHint()); lg->addWidget(installButton); lg->addWidget(m_removeButton); @@ -111,9 +111,9 @@ IconThemesConfig::~IconThemesConfig() { } -QListViewItem *IconThemesConfig::iconThemeItem(const QString &name) +TQListViewItem *IconThemesConfig::iconThemeItem(const TQString &name) { - QListViewItem *item; + TQListViewItem *item; for ( item=m_iconThemes->firstChild(); item ; item=item->nextSibling() ) if (m_themeNames[item->text(0)]==name) return item; @@ -124,10 +124,10 @@ void IconThemesConfig::loadThemes() { m_iconThemes->clear(); m_themeNames.clear(); - QStringList themelist(KIconTheme::list()); - QString name; - QString tname; - QStringList::Iterator it; + TQStringList themelist(KIconTheme::list()); + TQString name; + TQString tname; + TQStringList::Iterator it; for (it=themelist.begin(); it != themelist.end(); ++it) { KIconTheme icontheme(*it); @@ -139,9 +139,9 @@ void IconThemesConfig::loadThemes() // Just in case we have duplicated icon theme names on separate directories for (int i=2; m_themeNames.find(tname)!=m_themeNames.end() ; i++) - tname=QString("%1-%2").arg(name).arg(i); + tname=TQString("%1-%2").arg(name).arg(i); - m_iconThemes->insertItem(new QListViewItem(m_iconThemes,name, + m_iconThemes->insertItem(new TQListViewItem(m_iconThemes,name, icontheme.description())); m_themeNames.insert(name,*it); @@ -151,17 +151,17 @@ void IconThemesConfig::loadThemes() void IconThemesConfig::installNewTheme() { - KURL themeURL = KURLRequesterDlg::getURL(QString::null, this, + KURL themeURL = KURLRequesterDlg::getURL(TQString::null, this, i18n("Drag or Type Theme URL")); kdDebug() << themeURL.prettyURL() << endl; if (themeURL.url().isEmpty()) return; - QString themeTmpFile; + TQString themeTmpFile; // themeTmpFile contains the name of the downloaded file if (!KIO::NetAccess::download(themeURL, themeTmpFile, this)) { - QString sorryText; + TQString sorryText; if (themeURL.isLocalFile()) sorryText = i18n("Unable to find the icon theme archive %1."); else @@ -171,9 +171,9 @@ void IconThemesConfig::installNewTheme() return; } - QStringList themesNames = findThemeDirs(themeTmpFile); + TQStringList themesNames = findThemeDirs(themeTmpFile); if (themesNames.isEmpty()) { - QString invalidArch(i18n("The file is not a valid icon theme archive.")); + TQString invalidArch(i18n("The file is not a valid icon theme archive.")); KMessageBox::error(this, invalidArch); KIO::NetAccess::removeTempFile(themeTmpFile); @@ -182,8 +182,8 @@ void IconThemesConfig::installNewTheme() if (!installThemes(themesNames, themeTmpFile)) { //FIXME: make me able to know what is wrong.... - // QStringList instead of bool? - QString somethingWrong = + // TQStringList instead of bool? + TQString somethingWrong = i18n("A problem occurred during the installation process; " "however, most of the themes in the archive have been installed"); KMessageBox::error(this, somethingWrong); @@ -194,19 +194,19 @@ void IconThemesConfig::installNewTheme() KGlobal::instance()->newIconLoader(); loadThemes(); - QListViewItem *item=iconThemeItem(KIconTheme::current()); + TQListViewItem *item=iconThemeItem(KIconTheme::current()); m_iconThemes->setSelected(item, true); updateRemoveButton(); } -bool IconThemesConfig::installThemes(const QStringList &themes, const QString &archiveName) +bool IconThemesConfig::installThemes(const TQStringList &themes, const TQString &archiveName) { bool everythingOk = true; - QString localThemesDir(locateLocal("icon", "./")); + TQString localThemesDir(locateLocal("icon", "./")); KProgressDialog progressDiag(this, "themeinstallprogress", i18n("Installing icon themes"), - QString::null, + TQString::null, true); progressDiag.setAutoClose(true); progressDiag.progressBar()->setTotalSteps(themes.count()); @@ -219,7 +219,7 @@ bool IconThemesConfig::installThemes(const QStringList &themes, const QString &a const KArchiveDirectory* rootDir = archive.directory(); KArchiveDirectory* currentTheme; - for (QStringList::ConstIterator it = themes.begin(); + for (TQStringList::ConstIterator it = themes.begin(); it != themes.end(); ++it) { progressDiag.setLabel( @@ -248,9 +248,9 @@ bool IconThemesConfig::installThemes(const QStringList &themes, const QString &a return everythingOk; } -QStringList IconThemesConfig::findThemeDirs(const QString &archiveName) +TQStringList IconThemesConfig::findThemeDirs(const TQString &archiveName) { - QStringList foundThemes; + TQStringList foundThemes; KTar archive(archiveName); archive.open(IO_ReadOnly); @@ -260,8 +260,8 @@ QStringList IconThemesConfig::findThemeDirs(const QString &archiveName) KArchiveDirectory* subDir = 0L; // iterate all the dirs looking for an index.theme or index.desktop file - QStringList entries = themeDir->entries(); - for (QStringList::Iterator it = entries.begin(); + TQStringList entries = themeDir->entries(); + for (TQStringList::Iterator it = entries.begin(); it != entries.end(); ++it) { possibleDir = const_cast(themeDir->entry(*it)); @@ -279,11 +279,11 @@ QStringList IconThemesConfig::findThemeDirs(const QString &archiveName) void IconThemesConfig::removeSelectedTheme() { - QListViewItem *selected = m_iconThemes->selectedItem(); + TQListViewItem *selected = m_iconThemes->selectedItem(); if (!selected) return; - QString question=i18n("Are you sure you want to remove the " + TQString question=i18n("Are you sure you want to remove the " "%1 icon theme?
" "
" "This will delete the files installed by this theme.
"). @@ -298,15 +298,15 @@ void IconThemesConfig::removeSelectedTheme() // delete the index file before the async KIO::del so loadThemes() will // ignore that dir. - unlink(QFile::encodeName(icontheme.dir()+"/index.theme").data()); - unlink(QFile::encodeName(icontheme.dir()+"/index.desktop").data()); + unlink(TQFile::encodeName(icontheme.dir()+"/index.theme").data()); + unlink(TQFile::encodeName(icontheme.dir()+"/index.desktop").data()); KIO::del(KURL( icontheme.dir() )); KGlobal::instance()->newIconLoader(); loadThemes(); - QListViewItem *item=0L; + TQListViewItem *item=0L; //Fallback to the default if we've deleted the current theme if (!deletingCurrentTheme) item=iconThemeItem(KIconTheme::current()); @@ -322,12 +322,12 @@ void IconThemesConfig::removeSelectedTheme() void IconThemesConfig::updateRemoveButton() { - QListViewItem *selected = m_iconThemes->selectedItem(); + TQListViewItem *selected = m_iconThemes->selectedItem(); bool enabled = false; if (selected) { KIconTheme icontheme(m_themeNames[selected->text(0)]); - QFileInfo fi(icontheme.dir()); + TQFileInfo fi(icontheme.dir()); enabled = fi.isWritable(); // Don't let users remove the current theme. if(m_themeNames[selected->text(0)] == KIconTheme::current() || @@ -337,12 +337,12 @@ void IconThemesConfig::updateRemoveButton() m_removeButton->setEnabled(enabled); } -void IconThemesConfig::themeSelected(QListViewItem *item) +void IconThemesConfig::themeSelected(TQListViewItem *item) { #ifdef HAVE_LIBART KSVGIconEngine engine; #endif - QString dirName(m_themeNames[item->text(0)]); + TQString dirName(m_themeNames[item->text(0)]); KIconTheme icontheme(dirName); if (!icontheme.isValid()) kdDebug() << "notvalid\n"; @@ -363,7 +363,7 @@ void IconThemesConfig::themeSelected(QListViewItem *item) #endif } else - m_previewExec->setPixmap(QPixmap(icon.path)); + m_previewExec->setPixmap(TQPixmap(icon.path)); icon=icontheme.iconPath("folder.png",size,KIcon::MatchBest); if (!icon.isValid()) { @@ -379,7 +379,7 @@ void IconThemesConfig::themeSelected(QListViewItem *item) #endif } else - m_previewFolder->setPixmap(QPixmap(icon.path)); + m_previewFolder->setPixmap(TQPixmap(icon.path)); icon=icontheme.iconPath("txt.png",size,KIcon::MatchBest); if (!icon.isValid()) { @@ -395,7 +395,7 @@ void IconThemesConfig::themeSelected(QListViewItem *item) #endif } else - m_previewDocument->setPixmap(QPixmap(icon.path)); + m_previewDocument->setPixmap(TQPixmap(icon.path)); emit changed(true); m_bChanged = true; @@ -415,7 +415,7 @@ void IconThemesConfig::save() { if (!m_bChanged) return; - QListViewItem *selected = m_iconThemes->selectedItem(); + TQListViewItem *selected = m_iconThemes->selectedItem(); if (!selected) return; diff --git a/kcontrol/icons/iconthemes.h b/kcontrol/icons/iconthemes.h index d6d1a9e91..622cedb19 100644 --- a/kcontrol/icons/iconthemes.h +++ b/kcontrol/icons/iconthemes.h @@ -20,7 +20,7 @@ #define ICONTHEMES_H #include -#include +#include #include class QPushButton; @@ -34,12 +34,12 @@ class IconThemesConfig : public KCModule Q_OBJECT public: - IconThemesConfig(QWidget *parent = 0L, const char *name = 0L); + IconThemesConfig(TQWidget *parent = 0L, const char *name = 0L); virtual ~IconThemesConfig(); void loadThemes(); - bool installThemes(const QStringList &themes, const QString &archiveName); - QStringList findThemeDirs(const QString &archiveName); + bool installThemes(const TQStringList &themes, const TQString &archiveName); + TQStringList findThemeDirs(const TQString &archiveName); void updateRemoveButton(); @@ -50,21 +50,21 @@ public: int buttons(); protected slots: - void themeSelected(QListViewItem *item); + void themeSelected(TQListViewItem *item); void installNewTheme(); void removeSelectedTheme(); private: - QListViewItem *iconThemeItem(const QString &name); + TQListViewItem *iconThemeItem(const TQString &name); KListView *m_iconThemes; - QPushButton *m_removeButton; + TQPushButton *m_removeButton; - QLabel *m_previewExec; - QLabel *m_previewFolder; - QLabel *m_previewDocument; - QListViewItem *m_defaultTheme; - QMap m_themeNames; + TQLabel *m_previewExec; + TQLabel *m_previewFolder; + TQLabel *m_previewDocument; + TQListViewItem *m_defaultTheme; + TQMap m_themeNames; bool m_bChanged; }; diff --git a/kcontrol/icons/main.cpp b/kcontrol/icons/main.cpp index fe8c8c1b3..396a6ee4f 100644 --- a/kcontrol/icons/main.cpp +++ b/kcontrol/icons/main.cpp @@ -21,7 +21,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -31,25 +31,25 @@ #include "main.h" /**** DLL Interface ****/ -typedef KGenericFactory IconsFactory; +typedef KGenericFactory IconsFactory; K_EXPORT_COMPONENT_FACTORY( kcm_icons, IconsFactory("kcmicons") ) /**** IconModule ****/ -IconModule::IconModule(QWidget *parent, const char *name, const QStringList &) +IconModule::IconModule(TQWidget *parent, const char *name, const TQStringList &) : KCModule(IconsFactory::instance(), parent, name) { - QVBoxLayout *layout = new QVBoxLayout(this); - tab = new QTabWidget(this); + TQVBoxLayout *layout = new TQVBoxLayout(this); + tab = new TQTabWidget(this); layout->addWidget(tab); tab1 = new IconThemesConfig(this, "themes"); tab->addTab(tab1, i18n("&Theme")); - connect(tab1, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(tab1, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); tab2 = new KIconConfig(this, "effects"); tab->addTab(tab2, i18n("Ad&vanced")); - connect(tab2, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(tab2, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); KAboutData* about = new KAboutData("kcmicons", I18N_NOOP("Icons"), "3.0", I18N_NOOP("Icons Control Panel Module"), @@ -88,7 +88,7 @@ void IconModule::moduleChanged(bool state) emit changed(state); } -QString IconModule::quickHelp() const +TQString IconModule::quickHelp() const { return i18n("

Icons

" "This module allows you to choose the icons for your desktop.

" diff --git a/kcontrol/icons/main.h b/kcontrol/icons/main.h index 90892351f..f9c1efc27 100644 --- a/kcontrol/icons/main.h +++ b/kcontrol/icons/main.h @@ -26,7 +26,7 @@ #define __MAIN_H__ -#include +#include #include class IconModule : public KCModule @@ -34,18 +34,18 @@ class IconModule : public KCModule Q_OBJECT public: - IconModule(QWidget *parent, const char *name, const QStringList &); + IconModule(TQWidget *parent, const char *name, const TQStringList &); void load(); void save(); void defaults(); - QString quickHelp() const; + TQString quickHelp() const; protected slots: void moduleChanged(bool state); private: - QTabWidget *tab; + TQTabWidget *tab; KCModule *tab1; KCModule *tab2; -- cgit v1.2.1