summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/oblique/cmodule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'noatun-plugins/oblique/cmodule.cpp')
-rw-r--r--noatun-plugins/oblique/cmodule.cpp222
1 files changed, 111 insertions, 111 deletions
diff --git a/noatun-plugins/oblique/cmodule.cpp b/noatun-plugins/oblique/cmodule.cpp
index 93b4069..729ff54 100644
--- a/noatun-plugins/oblique/cmodule.cpp
+++ b/noatun-plugins/oblique/cmodule.cpp
@@ -14,72 +14,72 @@
#include <kinputdialog.h>
#include <kconfig.h>
-#include <qgroupbox.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qvbox.h>
-#include <qhbox.h>
-#include <qfileinfo.h>
-#include <qtooltip.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qcombobox.h>
-#include <qwhatsthis.h>
-#include <qtabwidget.h>
-#include <qheader.h>
-
-SchemaConfig::SchemaConfig(QWidget *parent, Oblique *oblique)
- : QWidget(parent)
+#include <tqgroupbox.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqvbox.h>
+#include <tqhbox.h>
+#include <tqfileinfo.h>
+#include <tqtooltip.h>
+#include <tqpushbutton.h>
+#include <tqlayout.h>
+#include <tqcombobox.h>
+#include <tqwhatsthis.h>
+#include <tqtabwidget.h>
+#include <tqheader.h>
+
+SchemaConfig::SchemaConfig(TQWidget *parent, Oblique *oblique)
+ : TQWidget(parent)
{
mOblique = oblique;
mIgnore = true;
mRegexpEditor=0;
{
- QVBoxLayout *layout = new QVBoxLayout(this, 11, 7);
+ TQVBoxLayout *layout = new TQVBoxLayout(this, 11, 7);
layout->setAutoAdd(true);
layout->setSpacing(7);
}
{
- QHBox *box = new QHBox(this);
+ TQHBox *box = new TQHBox(this);
box->setSpacing(7);
- mSchemaList = new QComboBox(box);
+ mSchemaList = new TQComboBox(box);
connect(
- mSchemaList, SIGNAL(activated(const QString&)),
- SLOT(selectSchema(const QString&))
+ mSchemaList, TQT_SIGNAL(activated(const TQString&)),
+ TQT_SLOT(selectSchema(const TQString&))
);
- mAdd = new QPushButton(BarIconSet("filenew"), 0, box);
+ mAdd = new TQPushButton(BarIconSet("filenew"), 0, box);
mAdd->setFixedWidth(mAdd->height());
- QToolTip::add(mAdd, i18n("Create new schema"));
- connect(mAdd, SIGNAL(clicked()), SLOT(newSchema()));
+ TQToolTip::add(mAdd, i18n("Create new schema"));
+ connect(mAdd, TQT_SIGNAL(clicked()), TQT_SLOT(newSchema()));
- mRemove = new QPushButton(BarIconSet("editdelete"), 0, box);
+ mRemove = new TQPushButton(BarIconSet("editdelete"), 0, box);
mRemove->setFixedWidth(mRemove->height());
- QToolTip::add(mRemove, i18n("Remove this schema"));
- connect(mRemove, SIGNAL(clicked()), SLOT(removeSchema()));
+ TQToolTip::add(mRemove, i18n("Remove this schema"));
+ connect(mRemove, TQT_SIGNAL(clicked()), TQT_SLOT(removeSchema()));
- mCopy = new QPushButton(BarIconSet("editcopy"), 0, box);
+ mCopy = new TQPushButton(BarIconSet("editcopy"), 0, box);
mCopy->setFixedWidth(mCopy->height());
- QToolTip::add(mCopy, i18n("Copy this schema"));
- connect(mCopy, SIGNAL(clicked()), SLOT(copySchema()));
+ TQToolTip::add(mCopy, i18n("Copy this schema"));
+ connect(mCopy, TQT_SIGNAL(clicked()), TQT_SLOT(copySchema()));
}
{
- QHBox *middle = new QHBox(this);
+ TQHBox *middle = new TQHBox(this);
middle->setSpacing(7);
mSchemaTree = new KListView(middle);
connect(
- mSchemaTree, SIGNAL(currentChanged(QListViewItem*)),
- SLOT(setCurrent(QListViewItem*))
+ mSchemaTree, TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ TQT_SLOT(setCurrent(TQListViewItem*))
);
connect(
- mSchemaTree, SIGNAL(moved(QListViewItem *, QListViewItem *, QListViewItem *)),
- SLOT(move(QListViewItem *, QListViewItem *, QListViewItem *))
+ mSchemaTree, TQT_SIGNAL(moved(TQListViewItem *, TQListViewItem *, TQListViewItem *)),
+ TQT_SLOT(move(TQListViewItem *, TQListViewItem *, TQListViewItem *))
);
mSchemaTree->setAcceptDrops(true);
@@ -92,79 +92,79 @@ SchemaConfig::SchemaConfig(QWidget *parent, Oblique *oblique)
mSchemaTree->addColumn(i18n("Value"));
mSchemaTree->addColumn(i18n("Presentation"));
- QVBox *buttons = new QVBox(middle);
+ TQVBox *buttons = new TQVBox(middle);
- mAddSibling = new QPushButton(BarIconSet("1rightarrow", KIcon::SizeSmall), "",buttons);
+ mAddSibling = new TQPushButton(BarIconSet("1rightarrow", KIcon::SizeSmall), "",buttons);
mAddSibling->setFixedWidth(mAddSibling->height());
- connect(mAddSibling, SIGNAL(clicked()), SLOT(addSibling()));
- QToolTip::add(mAddSibling, i18n("Create a new item after the selected one"));
+ connect(mAddSibling, TQT_SIGNAL(clicked()), TQT_SLOT(addSibling()));
+ TQToolTip::add(mAddSibling, i18n("Create a new item after the selected one"));
- mAddChild = new QPushButton(BarIconSet("2rightarrow", KIcon::SizeSmall), "", buttons);
+ mAddChild = new TQPushButton(BarIconSet("2rightarrow", KIcon::SizeSmall), "", buttons);
mAddChild->setFixedWidth(mAddChild->height());
- connect(mAddChild, SIGNAL(clicked()), SLOT(addChild()));
- QToolTip::add(mAddChild, i18n("Create a new child item under the selected one"));
+ connect(mAddChild, TQT_SIGNAL(clicked()), TQT_SLOT(addChild()));
+ TQToolTip::add(mAddChild, i18n("Create a new child item under the selected one"));
- mRemoveSelf = new QPushButton(BarIconSet("filenew", KIcon::SizeSmall), "", buttons);
+ mRemoveSelf = new TQPushButton(BarIconSet("filenew", KIcon::SizeSmall), "", buttons);
mRemoveSelf->setFixedWidth(mRemoveSelf->height());
- connect(mRemoveSelf, SIGNAL(clicked()), SLOT(removeSelf()));
- QToolTip::add(mRemoveSelf, i18n("Remove the selected item"));
+ connect(mRemoveSelf, TQT_SIGNAL(clicked()), TQT_SLOT(removeSelf()));
+ TQToolTip::add(mRemoveSelf, i18n("Remove the selected item"));
- new QWidget(buttons);
+ new TQWidget(buttons);
}
{
- QVBox *side = new QVBox(this);
+ TQVBox *side = new TQVBox(this);
side->setSpacing(7);
// the controllers
{
- QWidget *topSide = new QWidget(side);
- QGridLayout *grid = new QGridLayout(topSide);
+ TQWidget *topSide = new TQWidget(side);
+ TQGridLayout *grid = new TQGridLayout(topSide);
- QLabel *label;
+ TQLabel *label;
- label = new QLabel(i18n("&Property:"), topSide);
+ label = new TQLabel(i18n("&Property:"), topSide);
mPropertyEdit = new KLineEdit(topSide);
label->setBuddy(mPropertyEdit);
grid->addWidget(label, 0, 0);
grid->addMultiCellWidget(mPropertyEdit, 0, 0, 1, 2);
- connect(mPropertyEdit, SIGNAL(textChanged(const QString&)), SLOT(updateCurrent()));
+ connect(mPropertyEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(updateCurrent()));
- label = new QLabel(i18n("&Value:"), topSide);
+ label = new TQLabel(i18n("&Value:"), topSide);
mValueEdit = new KLineEdit(topSide);
label->setBuddy(mPropertyEdit);
grid->addWidget(label, 1, 0);
grid->addMultiCellWidget(mValueEdit, 1, 1, 1, 1);
- connect(mValueEdit, SIGNAL(textChanged(const QString&)), SLOT(updateCurrent()));
+ connect(mValueEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(updateCurrent()));
- QPushButton *editRe = new QPushButton(i18n("&Edit..."), topSide);
+ TQPushButton *editRe = new TQPushButton(i18n("&Edit..."), topSide);
grid->addWidget(editRe, 1, 2);
- connect(editRe, SIGNAL(clicked()), SLOT(editValueRegexp()));
+ connect(editRe, TQT_SIGNAL(clicked()), TQT_SLOT(editValueRegexp()));
- label = new QLabel(i18n("Pre&sentation:"), topSide);
+ label = new TQLabel(i18n("Pre&sentation:"), topSide);
mPresentationEdit = new KLineEdit(topSide);
label->setBuddy(mPropertyEdit);
grid->addWidget(label, 2, 0);
grid->addMultiCellWidget(mPresentationEdit, 2, 2, 1, 2);
- connect(mPresentationEdit, SIGNAL(textChanged(const QString&)), SLOT(updateCurrent()));
+ connect(mPresentationEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(updateCurrent()));
}
{
- QGroupBox *groupbox = new QGroupBox(
+ TQGroupBox *groupbox = new TQGroupBox(
3, Qt::Horizontal, i18n("Options"), side
);
- mOptionPlayable = new QCheckBox(i18n("Play&able"), groupbox);
- QWhatsThis::add(mOptionPlayable, i18n("This branch represents an individual file. If two items' presentation match, two items are created."));
- connect(mOptionPlayable, SIGNAL(toggled(bool)), SLOT(updateCurrent()));
+ mOptionPlayable = new TQCheckBox(i18n("Play&able"), groupbox);
+ TQWhatsThis::add(mOptionPlayable, i18n("This branch represents an individual file. If two items' presentation match, two items are created."));
+ connect(mOptionPlayable, TQT_SIGNAL(toggled(bool)), TQT_SLOT(updateCurrent()));
- mOptionChildrenVisible = new QCheckBox(i18n("&Children visible"), groupbox);
- QWhatsThis::add(mOptionChildrenVisible, i18n("Don't create this node, this nodes children become direct children of this node's parent"));
- connect(mOptionChildrenVisible, SIGNAL(toggled(bool)), SLOT(updateCurrent()));
+ mOptionChildrenVisible = new TQCheckBox(i18n("&Children visible"), groupbox);
+ TQWhatsThis::add(mOptionChildrenVisible, i18n("Don't create this node, this nodes children become direct children of this node's parent"));
+ connect(mOptionChildrenVisible, TQT_SIGNAL(toggled(bool)), TQT_SLOT(updateCurrent()));
- mOptionAutoOpen = new QCheckBox(i18n("Auto &open"), groupbox);
- QWhatsThis::add(mOptionAutoOpen, i18n("This branch is marked as open immediately."));
- connect(mOptionAutoOpen, SIGNAL(toggled(bool)), SLOT(updateCurrent()));
+ mOptionAutoOpen = new TQCheckBox(i18n("Auto &open"), groupbox);
+ TQWhatsThis::add(mOptionAutoOpen, i18n("This branch is marked as open immediately."));
+ connect(mOptionAutoOpen, TQT_SIGNAL(toggled(bool)), TQT_SLOT(updateCurrent()));
}
}
@@ -236,10 +236,10 @@ void SchemaConfig::reopen()
mQueries.clear();
mSchemaTree->clear();
- QStringList names = oblique()->schemaNames();
- QString firstTitle;
+ TQStringList names = oblique()->schemaNames();
+ TQString firstTitle;
- for (QStringList::Iterator i(names.begin()); i != names.end(); ++i)
+ for (TQStringList::Iterator i(names.begin()); i != names.end(); ++i)
{
QueryItem qi;
qi.title = oblique()->loadSchema(qi.query, *i);
@@ -256,10 +256,10 @@ void SchemaConfig::reopen()
void SchemaConfig::save()
{
- for (QMap<QString,QueryItem>::Iterator i(mQueries.begin()); i != mQueries.end(); ++i)
+ for (TQMap<TQString,QueryItem>::Iterator i(mQueries.begin()); i != mQueries.end(); ++i)
{
- QString name = i.key();
- name = QFileInfo(name).fileName();
+ TQString name = i.key();
+ name = TQFileInfo(name).fileName();
if (i.data().changed)
{
oblique()->saveSchema(i.data().query, name, i.data().title);
@@ -269,24 +269,24 @@ void SchemaConfig::save()
}
-QString SchemaConfig::nameToFilename(const QString &_name)
+TQString SchemaConfig::nameToFilename(const TQString &_name)
{
- QString name = _name;
- name = name.replace(QRegExp("[^a-zA-Z0-9]"), "_");
+ TQString name = _name;
+ name = name.replace(TQRegExp("[^a-zA-Z0-9]"), "_");
return name;
}
void SchemaConfig::newSchema()
{
bool ok;
- QString str=KInputDialog::getText(
+ TQString str=KInputDialog::getText(
i18n("Name of Schema"),
i18n("Please enter the name of the new schema:"),
"", &ok, this
);
if (!ok) return;
- QString filename = nameToFilename(str);
+ TQString filename = nameToFilename(str);
if (mQueries.contains(nameToFilename(filename))) return;
@@ -303,14 +303,14 @@ void SchemaConfig::newSchema()
void SchemaConfig::copySchema()
{
bool ok;
- QString str=KInputDialog::getText(
+ TQString str=KInputDialog::getText(
i18n("Name of Schema"),
i18n("Please enter the name of the new schema:"),
"", &ok, this
);
if (!ok) return;
- QString filename = nameToFilename(str);
+ TQString filename = nameToFilename(str);
if (mQueries.contains(nameToFilename(filename))) return;
@@ -332,7 +332,7 @@ void SchemaConfig::removeSchema()
selectSchema(mSchemaList->currentText());
}
-void SchemaConfig::selectSchema(const QString &title)
+void SchemaConfig::selectSchema(const TQString &title)
{
mSchemaTree->clear();
mSchemaList->setCurrentText(title);
@@ -354,8 +354,8 @@ void SchemaConfig::editValueRegexp()
unless (mRegexpEditor)
{
mRegexpEditor =
- KParts::ComponentFactory::createInstanceFromQuery<QDialog>(
- "KRegExpEditor/KRegExpEditor", QString::null, this
+ KParts::ComponentFactory::createInstanceFromQuery<TQDialog>(
+ "KRegExpEditor/KRegExpEditor", TQString::null, this
);
}
@@ -367,12 +367,12 @@ void SchemaConfig::editValueRegexp()
);
iface->setRegExp(mValueEdit->text());
- if (mRegexpEditor->exec() == QDialog::Accepted)
+ if (mRegexpEditor->exec() == TQDialog::Accepted)
mValueEdit->setText(iface->regExp());
}
}
-void SchemaConfig::setCurrent(QListViewItem *_item)
+void SchemaConfig::setCurrent(TQListViewItem *_item)
{
if (!_item) return;
QueryGroupItem *item = static_cast<QueryGroupItem*>(_item);
@@ -398,7 +398,7 @@ void SchemaConfig::updateCurrent()
mod->setPropertyName(mPropertyEdit->text());
mod->setPresentation(mPresentationEdit->text());
- mod->setValue(QRegExp(mValueEdit->text()));
+ mod->setValue(TQRegExp(mValueEdit->text()));
mod->setOption(QueryGroup::AutoOpen, mOptionAutoOpen->isChecked());
mod->setOption(QueryGroup::Playable, mOptionPlayable->isChecked());
@@ -406,7 +406,7 @@ void SchemaConfig::updateCurrent()
item->redisplay();
}
-void SchemaConfig::move(QListViewItem *_item, QListViewItem *, QListViewItem *_afterNow)
+void SchemaConfig::move(TQListViewItem *_item, TQListViewItem *, TQListViewItem *_afterNow)
{
setCurrentModified();
QueryGroupItem *item = static_cast<QueryGroupItem*>(_item);
@@ -490,8 +490,8 @@ void SchemaConfig::setCurrentModified()
SchemaConfig::QueryItem *SchemaConfig::currentQuery()
{
- QString title = mSchemaList->currentText();
- for (QMap<QString,QueryItem>::Iterator i(mQueries.begin()); i != mQueries.end(); ++i)
+ TQString title = mSchemaList->currentText();
+ for (TQMap<TQString,QueryItem>::Iterator i(mQueries.begin()); i != mQueries.end(); ++i)
{
if (i.data().title != title) continue;
return &i.data();
@@ -500,37 +500,37 @@ SchemaConfig::QueryItem *SchemaConfig::currentQuery()
}
-SliceConfig::SliceConfig(QWidget *parent, Oblique *oblique)
- : QWidget(parent)
+SliceConfig::SliceConfig(TQWidget *parent, Oblique *oblique)
+ : TQWidget(parent)
{
mOblique = oblique;
- (new QVBoxLayout(this, 11, 7))->setAutoAdd(true);
+ (new TQVBoxLayout(this, 11, 7))->setAutoAdd(true);
{
- QHBox *middle = new QHBox(this);
+ TQHBox *middle = new TQHBox(this);
middle->setSpacing(7);
mSliceList = new KListView(middle);
- QWhatsThis::add(mSliceList, i18n("The list of slices. A Slice is part of the full collection. This allows you to categorize your playlist. You can add an item to the list by right clicking on it and selecting the Slice you want it in."));
+ TQWhatsThis::add(mSliceList, i18n("The list of slices. A Slice is part of the full collection. This allows you to categorize your playlist. You can add an item to the list by right clicking on it and selecting the Slice you want it in."));
mSliceList->addColumn("");
mSliceList->header()->hide();
mSliceList->setSorting(0);
mSliceList->setItemsRenameable(true);
- QVBox *buttons = new QVBox(middle);
+ TQVBox *buttons = new TQVBox(middle);
- mAdd = new QPushButton(BarIconSet("1rightarrow", KIcon::SizeSmall), "",buttons);
+ mAdd = new TQPushButton(BarIconSet("1rightarrow", KIcon::SizeSmall), "",buttons);
mAdd->setFixedWidth(mAdd->height());
- connect(mAdd, SIGNAL(clicked()), SLOT(addSibling()));
- QToolTip::add(mAdd, i18n("Create a new item"));
+ connect(mAdd, TQT_SIGNAL(clicked()), TQT_SLOT(addSibling()));
+ TQToolTip::add(mAdd, i18n("Create a new item"));
- mRemove = new QPushButton(BarIconSet("filenew", KIcon::SizeSmall), "", buttons);
+ mRemove = new TQPushButton(BarIconSet("filenew", KIcon::SizeSmall), "", buttons);
mRemove->setFixedWidth(mRemove->height());
- connect(mRemove, SIGNAL(clicked()), SLOT(removeSelf()));
- QToolTip::add(mRemove, i18n("Remove the selected item"));
+ connect(mRemove, TQT_SIGNAL(clicked()), TQT_SLOT(removeSelf()));
+ TQToolTip::add(mRemove, i18n("Remove the selected item"));
- new QWidget(buttons);
+ new TQWidget(buttons);
}
}
@@ -557,7 +557,7 @@ public:
SliceListItem *SliceConfig::currentItem()
{
- QListViewItem *c = mSliceList->currentItem();
+ TQListViewItem *c = mSliceList->currentItem();
return static_cast<SliceListItem*>(c);
}
@@ -568,9 +568,9 @@ void SliceConfig::reopen()
mRemovedItems.clear();
mAddedItems.clear();
- QPtrList<Slice> slices = oblique()->base()->slices();
+ TQPtrList<Slice> slices = oblique()->base()->slices();
- for (QPtrListIterator<Slice> i(slices); *i; ++i)
+ for (TQPtrListIterator<Slice> i(slices); *i; ++i)
{
Slice *slice = *i;
new SliceListItem(mSliceList, slice);
@@ -580,7 +580,7 @@ void SliceConfig::reopen()
void SliceConfig::save()
{
for (
- QValueList<Slice*>::Iterator i(mRemovedItems.begin());
+ TQValueList<Slice*>::Iterator i(mRemovedItems.begin());
i != mRemovedItems.end();
++i
)
@@ -590,7 +590,7 @@ void SliceConfig::save()
}
for (
- QValueList<SliceListItem*>::Iterator i(mAddedItems.begin());
+ TQValueList<SliceListItem*>::Iterator i(mAddedItems.begin());
i != mAddedItems.end();
++i
)
@@ -598,7 +598,7 @@ void SliceConfig::save()
oblique()->base()->addSlice((*i)->text(0));
}
- for (QListViewItem *i = mSliceList->firstChild(); i; i = i->nextSibling())
+ for (TQListViewItem *i = mSliceList->firstChild(); i; i = i->nextSibling())
{
SliceListItem *si = static_cast<SliceListItem*>(i);
@@ -639,8 +639,8 @@ void SliceConfig::removeSelf()
Configure::Configure(Oblique *oblique)
: CModule(i18n("Oblique"), i18n("Configure Oblique Playlist"), "", oblique)
{
- (new QVBoxLayout(this))->setAutoAdd(true);
- tabs = new QTabWidget(this);
+ (new TQVBoxLayout(this))->setAutoAdd(true);
+ tabs = new TQTabWidget(this);
tabs->addTab(slice = new SliceConfig(tabs, oblique), i18n("Slices"));
tabs->addTab(schema = new SchemaConfig(tabs, oblique), i18n("Schemas"));