diff options
Diffstat (limited to 'juk/tageditor.cpp')
-rw-r--r-- | juk/tageditor.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/juk/tageditor.cpp b/juk/tageditor.cpp index eb2dfa88..4e5299ae 100644 --- a/juk/tageditor.cpp +++ b/juk/tageditor.cpp @@ -46,11 +46,11 @@ using namespace ActionCollection; -class FileNameValidator : public QValidator +class FileNameValidator : public TQValidator { public: - FileNameValidator(TQObject *parent, const char *name = 0) : - TQValidator(parent, name) {} + FileNameValidator(TQObject *tqparent, const char *name = 0) : + TQValidator(tqparent, name) {} virtual void fixup(TQString &s) const { @@ -59,13 +59,13 @@ public: virtual State validate(TQString &s, int &) const { - if(s.find('/') != -1) + if(s.tqfind('/') != -1) return Invalid; return Acceptable; } }; -class FileBoxToolTip : public QToolTip +class FileBoxToolTip : public TQToolTip { public: FileBoxToolTip(TagEditor *editor, TQWidget *widget) : @@ -73,28 +73,28 @@ public: protected: virtual void maybeTip(const TQPoint &) { - tip(parentWidget()->rect(), m_editor->items().first()->file().absFilePath()); + tip(tqparentWidget()->rect(), m_editor->items().first()->file().absFilePath()); } private: TagEditor *m_editor; }; -class FixedHLayout : public QHBoxLayout +class FixedHLayout : public TQHBoxLayout { public: - FixedHLayout(TQWidget *parent, int margin = 0, int spacing = -1, const char *name = 0) : - TQHBoxLayout(parent, margin, spacing, name), + FixedHLayout(TQWidget *tqparent, int margin = 0, int spacing = -1, const char *name = 0) : + TQHBoxLayout(tqparent, margin, spacing, name), m_width(-1) {} - FixedHLayout(TQLayout *parentLayout, int spacing = -1, const char *name = 0) : - TQHBoxLayout(parentLayout, spacing, name), + FixedHLayout(TQLayout *tqparentLayout, int spacing = -1, const char *name = 0) : + TQHBoxLayout(tqparentLayout, spacing, name), m_width(-1) {} void setWidth(int w = -1) { - m_width = w == -1 ? TQHBoxLayout::minimumSize().width() : w; + m_width = w == -1 ? TQHBoxLayout::tqminimumSize().width() : w; } - virtual TQSize minimumSize() const + virtual TQSize tqminimumSize() const { - TQSize s = TQHBoxLayout::minimumSize(); + TQSize s = TQHBoxLayout::tqminimumSize(); s.setWidth(m_width); return s; } @@ -105,9 +105,9 @@ private: class CollectionObserver : public PlaylistObserver { public: - CollectionObserver(TagEditor *parent) : + CollectionObserver(TagEditor *tqparent) : PlaylistObserver(CollectionList::instance()), - m_parent(parent) + m_parent(tqparent) { } @@ -127,8 +127,8 @@ private: // public members //////////////////////////////////////////////////////////////////////////////// -TagEditor::TagEditor(TQWidget *parent, const char *name) : - TQWidget(parent, name), +TagEditor::TagEditor(TQWidget *tqparent, const char *name) : + TQWidget(tqparent, name), m_currentPlaylist(0), m_observer(0), m_performingSave(false) @@ -234,8 +234,8 @@ void TagEditor::slotRefresh() m_bitrateBox->setText(TQString::number(tag->bitrate())); m_lengthBox->setText(tag->lengthString()); - if(m_genreList.findIndex(tag->genre()) >= 0) - m_genreBox->setCurrentItem(m_genreList.findIndex(tag->genre()) + 1); + if(m_genreList.tqfindIndex(tag->genre()) >= 0) + m_genreBox->setCurrentItem(m_genreList.tqfindIndex(tag->genre()) + 1); else { m_genreBox->setCurrentItem(0); m_genreBox->setEditText(tag->genre()); @@ -287,43 +287,43 @@ void TagEditor::slotRefresh() if(tag) { if(m_artistNameBox->currentText() != tag->artist() && - m_enableBoxes.contains(m_artistNameBox)) + m_enableBoxes.tqcontains(m_artistNameBox)) { m_artistNameBox->lineEdit()->clear(); m_enableBoxes[m_artistNameBox]->setChecked(false); } if(m_trackNameBox->text() != tag->title() && - m_enableBoxes.contains(m_trackNameBox)) + m_enableBoxes.tqcontains(m_trackNameBox)) { m_trackNameBox->clear(); m_enableBoxes[m_trackNameBox]->setChecked(false); } if(m_albumNameBox->currentText() != tag->album() && - m_enableBoxes.contains(m_albumNameBox)) + m_enableBoxes.tqcontains(m_albumNameBox)) { m_albumNameBox->lineEdit()->clear(); m_enableBoxes[m_albumNameBox]->setChecked(false); } if(m_genreBox->currentText() != tag->genre() && - m_enableBoxes.contains(m_genreBox)) + m_enableBoxes.tqcontains(m_genreBox)) { m_genreBox->lineEdit()->clear(); m_enableBoxes[m_genreBox]->setChecked(false); } if(m_trackSpin->value() != tag->track() && - m_enableBoxes.contains(m_trackSpin)) + m_enableBoxes.tqcontains(m_trackSpin)) { m_trackSpin->setValue(0); m_enableBoxes[m_trackSpin]->setChecked(false); } if(m_yearSpin->value() != tag->year() && - m_enableBoxes.contains(m_yearSpin)) + m_enableBoxes.tqcontains(m_yearSpin)) { m_yearSpin->setValue(0); m_enableBoxes[m_yearSpin]->setChecked(false); } if(m_commentBox->text() != tag->comment() && - m_enableBoxes.contains(m_commentBox)) + m_enableBoxes.tqcontains(m_commentBox)) { m_commentBox->clear(); m_enableBoxes[m_commentBox]->setChecked(false); @@ -409,7 +409,7 @@ void TagEditor::updateCollection() m_genreList.sort(); m_genreBox->listBox()->clear(); - m_genreBox->listBox()->insertItem(TQString::null); + m_genreBox->listBox()->insertItem(TQString()); m_genreBox->listBox()->insertStringList(m_genreList); m_genreBox->completionObject()->setItems(m_genreList); } @@ -440,7 +440,7 @@ void TagEditor::readConfig() m_genreList.sort(); m_genreBox->clear(); - m_genreBox->insertItem(TQString::null); + m_genreBox->insertItem(TQString()); m_genreBox->insertStringList(m_genreList); m_genreBox->completionObject()->setItems(m_genreList); } @@ -469,11 +469,11 @@ void TagEditor::saveConfig() void TagEditor::setupActions() { - KToggleAction *show = new KToggleAction(i18n("Show &Tag Editor"), "edit", 0, actions(), "showEditor"); + KToggleAction *show = new KToggleAction(i18n("Show &Tag Editor"), "edit", 0, ActionCollection::actions(), "showEditor"); show->setCheckedState(i18n("Hide &Tag Editor")); connect(show, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setShown(bool))); - new KAction(i18n("&Save"), "filesave", "CTRL+t", this, TQT_SLOT(slotSave()), actions(), "saveItem"); + new KAction(i18n("&Save"), "filesave", "CTRL+t", TQT_TQOBJECT(this), TQT_SLOT(slotSave()), ActionCollection::actions(), "saveItem"); } void TagEditor::setupLayout() @@ -481,16 +481,16 @@ void TagEditor::setupLayout() static const int horizontalSpacing = 12; static const int verticalSpacing = 2; - TQHBoxLayout *layout = new TQHBoxLayout(this, 6, horizontalSpacing); + TQHBoxLayout *tqlayout = new TQHBoxLayout(this, 6, horizontalSpacing); ////////////////////////////////////////////////////////////////////////////// - // define two columns of the bottem layout + // define two columns of the bottem tqlayout ////////////////////////////////////////////////////////////////////////////// - TQVBoxLayout *leftColumnLayout = new TQVBoxLayout(layout, verticalSpacing); - TQVBoxLayout *rightColumnLayout = new TQVBoxLayout(layout, verticalSpacing); + TQVBoxLayout *leftColumnLayout = new TQVBoxLayout(tqlayout, verticalSpacing); + TQVBoxLayout *rightColumnLayout = new TQVBoxLayout(tqlayout, verticalSpacing); - layout->setStretchFactor(leftColumnLayout, 2); - layout->setStretchFactor(rightColumnLayout, 3); + tqlayout->setStretchFactor(leftColumnLayout, 2); + tqlayout->setStretchFactor(rightColumnLayout, 3); ////////////////////////////////////////////////////////////////////////////// // put stuff in the left column -- all of the field names are class wide @@ -524,7 +524,7 @@ void TagEditor::setupLayout() horizontalSpacing); m_fileNameBox = new KLineEdit(this, "fileNameBox"); - m_fileNameBox->setValidator(new FileNameValidator(m_fileNameBox)); + m_fileNameBox->setValidator(new FileNameValidator(TQT_TQOBJECT(m_fileNameBox))); TQLabel *fileNameIcon = new TQLabel(this); fileNameIcon->setPixmap(SmallIcon("sound")); @@ -560,7 +560,7 @@ void TagEditor::setupLayout() // addItem(i18n("Length:"), m_lengthBox, trackRowLayout); m_lengthBox->setMinimumWidth(fontMetrics().width("00:00") + trackRowLayout->spacing()); m_lengthBox->setMaximumWidth(50); - m_lengthBox->setAlignment(Qt::AlignRight); + m_lengthBox->tqsetAlignment(TQt::AlignRight); m_lengthBox->setReadOnly(true); trackRowLayout->addWidget(addHidden(m_lengthBox)); @@ -572,7 +572,7 @@ void TagEditor::setupLayout() // addItem(i18n("Bitrate:"), m_bitrateBox, trackRowLayout); m_bitrateBox->setMinimumWidth(fontMetrics().width("000") + trackRowLayout->spacing()); m_bitrateBox->setMaximumWidth(50); - m_bitrateBox->setAlignment(Qt::AlignRight); + m_bitrateBox->tqsetAlignment(TQt::AlignRight); m_bitrateBox->setReadOnly(true); trackRowLayout->addWidget(addHidden(m_bitrateBox)); @@ -580,7 +580,7 @@ void TagEditor::setupLayout() } m_commentBox = new KEdit(this, "commentBox"); - m_commentBox->setTextFormat(Qt::PlainText); + m_commentBox->setTextFormat(TQt::PlainText); addItem(i18n("&Comment:"), m_commentBox, rightColumnLayout, "edit"); fileNameLabel->setMinimumHeight(m_trackSpin->height()); @@ -618,7 +618,7 @@ void TagEditor::save(const PlaylistItemList &list) { if(!list.isEmpty() && m_dataChanged) { - KApplication::setOverrideCursor(Qt::waitCursor); + KApplication::setOverrideCursor(TQt::waitCursor); m_dataChanged = false; m_performingSave = true; @@ -711,9 +711,9 @@ void TagEditor::saveChangesPrompt() } } -void TagEditor::addItem(const TQString &text, TQWidget *item, TQBoxLayout *layout, const TQString &iconName) +void TagEditor::addItem(const TQString &text, TQWidget *item, TQBoxLayout *tqlayout, const TQString &iconName) { - if(!item || !layout) + if(!item || !tqlayout) return; TQLabel *label = new TQLabel(item, text, this); @@ -727,14 +727,14 @@ void TagEditor::addItem(const TQString &text, TQWidget *item, TQBoxLayout *layou label->setMinimumHeight(enableBox->height()); - if(layout->direction() == TQBoxLayout::LeftToRight) { - layout->addWidget(iconLabel); - layout->addWidget(label); - layout->addWidget(item); - layout->addWidget(enableBox); + if(tqlayout->direction() == TQBoxLayout::LeftToRight) { + tqlayout->addWidget(iconLabel); + tqlayout->addWidget(label); + tqlayout->addWidget(item); + tqlayout->addWidget(enableBox); } else { - TQHBoxLayout *l = new TQHBoxLayout(layout); + TQHBoxLayout *l = new TQHBoxLayout(tqlayout); l->addWidget(iconLabel); l->addWidget(label); @@ -745,7 +745,7 @@ void TagEditor::addItem(const TQString &text, TQWidget *item, TQBoxLayout *layou l->addWidget(enableBox); l->setStretchFactor(enableBox, 0); - layout->addWidget(item); + tqlayout->addWidget(item); } enableBox->hide(); @@ -766,7 +766,7 @@ void TagEditor::showEvent(TQShowEvent *e) bool TagEditor::eventFilter(TQObject *watched, TQEvent *e) { - TQKeyEvent *ke = static_cast<TQKeyEvent*>(e); + TQKeyEvent *ke = TQT_TQKEYEVENT(e); if(watched->inherits(TQSPINBOX_OBJECT_NAME_STRING) && e->type() == TQEvent::KeyRelease && ke->state() == 0) slotDataChanged(); |