From e654398e46e37abf457b2b1122ab898d2c51c49f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:43:15 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- noatun/library/equalizerview.cpp | 136 +++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'noatun/library/equalizerview.cpp') diff --git a/noatun/library/equalizerview.cpp b/noatun/library/equalizerview.cpp index 5e406e13..098226a7 100644 --- a/noatun/library/equalizerview.cpp +++ b/noatun/library/equalizerview.cpp @@ -11,18 +11,18 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define EQ (napp->vequalizer()) @@ -30,14 +30,14 @@ //////////////////////////////////////////////// // PresetList -PresetList::PresetList(QWidget *parent, const char *name) +PresetList::PresetList(TQWidget *parent, const char *name) : KListView(parent, name) { setItemsRenameable(true); setRenameable(0, true); addColumn(""); // first column is the visible one addColumn("", 0); // create one column to store cruft in - setColumnWidthMode(0, QListView::Maximum); + setColumnWidthMode(0, TQListView::Maximum); header()->setStretchEnabled(true,0); header()->hide(); // a try to set a sne minimum width. unfortuately the custom item @@ -45,14 +45,14 @@ PresetList::PresetList(QWidget *parent, const char *name) setMinimumWidth(kapp->fontMetrics().boundingRect(i18n("Custom")).width()+2*itemMargin()); } -void PresetList::rename(QListViewItem *item, int c) +void PresetList::rename(TQListViewItem *item, int c) { // We can't rename the "Custom" metapreset if (item->text(0)==i18n("Custom")) return; // Or presets we don't have write access to - if (!QFileInfo(item->text(1)).isWritable()) + if (!TQFileInfo(item->text(1)).isWritable()) return; KListView::rename(item, c); @@ -61,18 +61,18 @@ void PresetList::rename(QListViewItem *item, int c) //////////////////////////////////////////////// // EqualizerLevel -EqualizerLevel::EqualizerLevel(QWidget *parent, VBand band) - : QWidget(parent), mBand(band) +EqualizerLevel::EqualizerLevel(TQWidget *parent, VBand band) + : TQWidget(parent), mBand(band) { - QVBoxLayout *layout = new QVBoxLayout(this, + TQVBoxLayout *layout = new TQVBoxLayout(this, 0, 0, "EqualizerLevel::layout"); - mSlider = new QSlider(-200, 200, 25, 0, Qt::Vertical, this, "EqualizerLevel::mSlider"); - mSlider->setTickmarks(QSlider::Left); + mSlider = new TQSlider(-200, 200, 25, 0, Qt::Vertical, this, "EqualizerLevel::mSlider"); + mSlider->setTickmarks(TQSlider::Left); mSlider->setTickInterval(25); layout->addWidget(mSlider); - connect(mSlider, SIGNAL(valueChanged(int)), SLOT(changed(int))); - mLabel = new QLabel("", this, "EqualizerLevel::mLabel"); + connect(mSlider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed(int))); + mLabel = new TQLabel("", this, "EqualizerLevel::mLabel"); mLabel->setAlignment(AlignHCenter | AlignVCenter); layout->addWidget(mLabel); @@ -82,8 +82,8 @@ EqualizerLevel::EqualizerLevel(QWidget *parent, VBand band) setBand(band); - connect(EQ, SIGNAL(modified()), SLOT(changed())); - connect(mSlider, SIGNAL(valueChanged(int)), SLOT(changed(int))); + connect(EQ, TQT_SIGNAL(modified()), TQT_SLOT(changed())); + connect(mSlider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed(int))); } void EqualizerLevel::setBand(VBand band) @@ -123,56 +123,56 @@ void EqualizerView::show() mWidget = new EqualizerWidget(this, "mWidget"); setMainWidget(mWidget); - bandsLayout = new QHBoxLayout(mWidget->bandsFrame, + bandsLayout = new TQHBoxLayout(mWidget->bandsFrame, 0, KDialog::spacingHint(), "bandsLayout"); - connect(mWidget->preampSlider, SIGNAL(valueChanged(int)), - this, SLOT(setPreamp(int))); - connect(EQ, SIGNAL(preampChanged(int)), - this, SLOT(changedPreamp(int))); + connect(mWidget->preampSlider, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(setPreamp(int))); + connect(EQ, TQT_SIGNAL(preampChanged(int)), + this, TQT_SLOT(changedPreamp(int))); mWidget->bandCount->setRange(EQ->minBands(), EQ->maxBands()); - connect(mWidget->bandCount, SIGNAL(valueChanged(int)), - EQ, SLOT(setBands(int))); + connect(mWidget->bandCount, TQT_SIGNAL(valueChanged(int)), + EQ, TQT_SLOT(setBands(int))); - QVBoxLayout *l = new QVBoxLayout(mWidget->presetFrame); + TQVBoxLayout *l = new TQVBoxLayout(mWidget->presetFrame); mPresets = new PresetList(mWidget->presetFrame, "mPresets"); l->addWidget(mPresets); - connect(mWidget->removePresetButton, SIGNAL(clicked()), SLOT(remove())); - connect(mWidget->addPresetButton, SIGNAL(clicked()), SLOT(create())); - connect(mWidget->resetEqButton, SIGNAL(clicked()), SLOT(reset())); + connect(mWidget->removePresetButton, TQT_SIGNAL(clicked()), TQT_SLOT(remove())); + connect(mWidget->addPresetButton, TQT_SIGNAL(clicked()), TQT_SLOT(create())); + connect(mWidget->resetEqButton, TQT_SIGNAL(clicked()), TQT_SLOT(reset())); new KListViewItem(mPresets, i18n("Custom")); - connect(mPresets, SIGNAL(currentChanged(QListViewItem*)), - this, SLOT(select(QListViewItem*))); + connect(mPresets, TQT_SIGNAL(currentChanged(TQListViewItem*)), + this, TQT_SLOT(select(TQListViewItem*))); - connect(mPresets, SIGNAL(itemRenamed(QListViewItem*)), - this, SLOT(rename(QListViewItem*))); + connect(mPresets, TQT_SIGNAL(itemRenamed(TQListViewItem*)), + this, TQT_SLOT(rename(TQListViewItem*))); // populate the preset list - QValueList presets = EQ->presets(); - QValueList::Iterator it; + TQValueList presets = EQ->presets(); + TQValueList::Iterator it; for (it=presets.begin(); it!=presets.end(); ++it) { created(*it); } - connect(EQ, SIGNAL(created(VPreset)), SLOT(created(VPreset))); - connect(EQ, SIGNAL(renamed(VPreset)), SLOT(renamed(VPreset))); - connect(EQ, SIGNAL(removed(VPreset)), SLOT(removed(VPreset))); + connect(EQ, TQT_SIGNAL(created(VPreset)), TQT_SLOT(created(VPreset))); + connect(EQ, TQT_SIGNAL(renamed(VPreset)), TQT_SLOT(renamed(VPreset))); + connect(EQ, TQT_SIGNAL(removed(VPreset)), TQT_SLOT(removed(VPreset))); mWidget->enabledCheckBox->setChecked(EQ->isEnabled()); - connect(mWidget->enabledCheckBox, SIGNAL(toggled(bool)), - EQ, SLOT(setEnabled(bool))); - connect(EQ, SIGNAL(enabled(bool)), - mWidget->enabledCheckBox, SLOT(setChecked(bool))); + connect(mWidget->enabledCheckBox, TQT_SIGNAL(toggled(bool)), + EQ, TQT_SLOT(setEnabled(bool))); + connect(EQ, TQT_SIGNAL(enabled(bool)), + mWidget->enabledCheckBox, TQT_SLOT(setChecked(bool))); - connect(EQ, SIGNAL(changed()), - this, SLOT(changedEq())); - connect(EQ, SIGNAL(changedBands()), - this, SLOT(changedBands())); + connect(EQ, TQT_SIGNAL(changed()), + this, TQT_SLOT(changedEq())); + connect(EQ, TQT_SIGNAL(changedBands()), + this, TQT_SLOT(changedBands())); changedBands(); changedEq(); @@ -184,23 +184,23 @@ void EqualizerView::show() KDialogBase::show(); } -QListViewItem *EqualizerView::itemFor(const QString &filename) +TQListViewItem *EqualizerView::itemFor(const TQString &filename) { - for (QListViewItem *i=mPresets->firstChild(); i!=0; i=i->itemBelow()) + for (TQListViewItem *i=mPresets->firstChild(); i!=0; i=i->itemBelow()) { - QString t = i->text(1); + TQString t = i->text(1); if ((t.length()==0 && filename.length()==0) || t==filename) return i; } return 0; } -QListViewItem *EqualizerView::itemFor(const VPreset &preset) +TQListViewItem *EqualizerView::itemFor(const VPreset &preset) { return itemFor(preset.file()); } -// why is it that when you move a QSlider up, it goes down? +// why is it that when you move a TQSlider up, it goes down? void EqualizerView::setPreamp(int x) { EQ->setPreamp(-x); @@ -233,7 +233,7 @@ void EqualizerView::changedEq() { if (!mGoingPreset) { - QListViewItem *customitem = itemFor(""); + TQListViewItem *customitem = itemFor(""); if (!customitem) // this should never happen! return; mPresets->setSelected(customitem, true); @@ -247,15 +247,15 @@ void EqualizerView::removed(VPreset p) void EqualizerView::created(VPreset p) { - // store the filename in QListViewItem::text(0) - QString n = p.name(); - QString f = p.file(); + // store the filename in TQListViewItem::text(0) + TQString n = p.name(); + TQString f = p.file(); new KListViewItem(mPresets, n, f); } void EqualizerView::renamed(VPreset p) { - QListViewItem *renamed = itemFor(p); + TQListViewItem *renamed = itemFor(p); if (!renamed) // WTF ! { created(p); @@ -266,10 +266,10 @@ void EqualizerView::renamed(VPreset p) void EqualizerView::remove() { - QListViewItem *current=mPresets->currentItem(); + TQListViewItem *current=mPresets->currentItem(); if (current->text(0)==i18n("Custom")) return; - QListViewItem *then=current->itemAbove(); + TQListViewItem *then=current->itemAbove(); if (!then) then=current->itemBelow(); if (then) @@ -290,7 +290,7 @@ void EqualizerView::create() // We should have just made a list view item for this preset // See EquailizerView::presetAdded() - QListViewItem *i = itemFor(p); + TQListViewItem *i = itemFor(p); if (i) mPresets->setSelected(i, true); @@ -307,13 +307,13 @@ void EqualizerView::reset() } -void EqualizerView::rename(QListViewItem *item) +void EqualizerView::rename(TQListViewItem *item) { EQ->presetByFile(item->text(1)).setName(item->text(0)); item->setText(0, EQ->presetByFile(item->text(1)).name()); } -void EqualizerView::select(QListViewItem *item) +void EqualizerView::select(TQListViewItem *item) { mGoingPreset = true; EQ->presetByFile(item->text(1)).load(); -- cgit v1.2.1