summaryrefslogtreecommitdiffstats
path: root/noatun/library/pluginmodule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'noatun/library/pluginmodule.cpp')
-rw-r--r--noatun/library/pluginmodule.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/noatun/library/pluginmodule.cpp b/noatun/library/pluginmodule.cpp
index aec76e44..77047471 100644
--- a/noatun/library/pluginmodule.cpp
+++ b/noatun/library/pluginmodule.cpp
@@ -25,20 +25,20 @@
#include <kiconloader.h>
#include <klocale.h>
#include <kmessagebox.h>
-#include <qtabwidget.h>
-#include <qheader.h>
-#include <qlabel.h>
-#include <qlayout.h>
+#include <tqtabwidget.h>
+#include <tqheader.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
#include "noatunlistview.h"
#include "pluginmodule.h"
-#include <qwhatsthis.h>
+#include <tqwhatsthis.h>
#include "common.h"
-PluginListItem::PluginListItem(const bool _exclusive, bool _checked, const NoatunLibraryInfo &_info, QListView *_parent)
- : QCheckListItem(_parent, _info.name, CheckBox)
+PluginListItem::PluginListItem(const bool _exclusive, bool _checked, const NoatunLibraryInfo &_info, TQListView *_parent)
+ : TQCheckListItem(_parent, _info.name, CheckBox)
, mInfo(_info)
, silentStateChange(false)
, exclusive(_exclusive)
@@ -61,14 +61,14 @@ void PluginListItem::stateChange(bool b)
static_cast<PluginListView *>(listView())->stateChanged(this, b);
}
-void PluginListItem::paintCell(QPainter *p, const QColorGroup &cg, int a, int b, int c)
+void PluginListItem::paintCell(TQPainter *p, const TQColorGroup &cg, int a, int b, int c)
{
if(exclusive) myType = RadioButton;
- QCheckListItem::paintCell(p, cg, a, b, c);
+ TQCheckListItem::paintCell(p, cg, a, b, c);
if(exclusive) myType = CheckBox;
}
-PluginListView::PluginListView(unsigned _min, unsigned _max, QWidget *_parent, const char *_name)
+PluginListView::PluginListView(unsigned _min, unsigned _max, TQWidget *_parent, const char *_name)
: KListView(_parent, _name)
, hasMaximum(true)
, max(_max)
@@ -77,7 +77,7 @@ PluginListView::PluginListView(unsigned _min, unsigned _max, QWidget *_parent, c
{
}
-PluginListView::PluginListView(unsigned _min, QWidget *_parent, const char *_name)
+PluginListView::PluginListView(unsigned _min, TQWidget *_parent, const char *_name)
: KListView(_parent, _name)
, hasMaximum(false)
, min(_min)
@@ -85,7 +85,7 @@ PluginListView::PluginListView(unsigned _min, QWidget *_parent, const char *_nam
{
}
-PluginListView::PluginListView(QWidget *_parent, const char *_name)
+PluginListView::PluginListView(TQWidget *_parent, const char *_name)
: KListView(_parent, _name)
, hasMaximum(false)
, min(0)
@@ -110,7 +110,7 @@ void PluginListView::stateChanged(PluginListItem *item, bool b)
{
// Find a different one and turn it off
- QListViewItem *cur = firstChild();
+ TQListViewItem *cur = firstChild();
PluginListItem *curItem = dynamic_cast<PluginListItem *>(cur);
while(cur == item || !curItem || !curItem->isOn())
@@ -136,58 +136,58 @@ void PluginListView::stateChanged(PluginListItem *item, bool b)
}
}
-Plugins::Plugins(QObject *_parent)
+Plugins::Plugins(TQObject *_parent)
: CModule(i18n("Plugins"), i18n("Select Your Plugins"), "gear", _parent)
, shown(false)
{
- (new QVBoxLayout(this))->setAutoAdd(true);
- QTabWidget *tabControl = new QTabWidget(this,"tabControl");
+ (new TQVBoxLayout(this))->setAutoAdd(true);
+ TQTabWidget *tabControl = new TQTabWidget(this,"tabControl");
- QFrame *interfaceTab = new QFrame(tabControl);
- (new QVBoxLayout(interfaceTab, KDialog::marginHint(), KDialog::spacingHint()))->setAutoAdd(true);
- (void)new QLabel(i18n("<b>Select one or more interfaces to use:</b>"), interfaceTab);
+ TQFrame *interfaceTab = new TQFrame(tabControl);
+ (new TQVBoxLayout(interfaceTab, KDialog::marginHint(), KDialog::spacingHint()))->setAutoAdd(true);
+ (void)new TQLabel(i18n("<b>Select one or more interfaces to use:</b>"), interfaceTab);
// At least one interface is required
interfaceList = new PluginListView(1, interfaceTab);
interfaceList->addColumn(i18n("Name"));
interfaceList->addColumn(i18n("Description"));
interfaceList->addColumn(i18n("Author"));
interfaceList->addColumn(i18n("License"));
- connect(interfaceList, SIGNAL(stateChange(PluginListItem *, bool)), this, SLOT(stateChange(PluginListItem *, bool)));
+ connect(interfaceList, TQT_SIGNAL(stateChange(PluginListItem *, bool)), this, TQT_SLOT(stateChange(PluginListItem *, bool)));
tabControl->addTab(interfaceTab, i18n("&Interfaces"));
- QFrame *playlistTab = new QFrame(tabControl);
- (new QVBoxLayout(playlistTab, KDialog::marginHint(), KDialog::spacingHint()))->setAutoAdd(true);
- (void)new QLabel(i18n("<b>Select one playlist to use:</b>"), playlistTab);
+ TQFrame *playlistTab = new TQFrame(tabControl);
+ (new TQVBoxLayout(playlistTab, KDialog::marginHint(), KDialog::spacingHint()))->setAutoAdd(true);
+ (void)new TQLabel(i18n("<b>Select one playlist to use:</b>"), playlistTab);
// Exactly one playlist is required
playlistList = new PluginListView(1, 1, playlistTab);
playlistList->addColumn(i18n("Name"));
playlistList->addColumn(i18n("Description"));
playlistList->addColumn(i18n("Author"));
playlistList->addColumn(i18n("License"));
- connect(playlistList, SIGNAL(stateChange(PluginListItem *, bool)), this, SLOT(stateChange(PluginListItem *, bool)));
+ connect(playlistList, TQT_SIGNAL(stateChange(PluginListItem *, bool)), this, TQT_SLOT(stateChange(PluginListItem *, bool)));
tabControl->addTab(playlistTab, i18n("&Playlist"));
- QFrame *visTab = new QFrame(tabControl);
- (new QVBoxLayout(visTab, KDialog::marginHint(), KDialog::spacingHint()))->setAutoAdd(true);
- (void)new QLabel(i18n("<b>Select any visualizations to use:</b>"), visTab);
+ TQFrame *visTab = new TQFrame(tabControl);
+ (new TQVBoxLayout(visTab, KDialog::marginHint(), KDialog::spacingHint()))->setAutoAdd(true);
+ (void)new TQLabel(i18n("<b>Select any visualizations to use:</b>"), visTab);
visList = new PluginListView(0, visTab);
visList->addColumn(i18n("Name"));
visList->addColumn(i18n("Description"));
visList->addColumn(i18n("Author"));
visList->addColumn(i18n("License"));
- connect(visList, SIGNAL(stateChange(PluginListItem *, bool)), this, SLOT(stateChange(PluginListItem *, bool)));
+ connect(visList, TQT_SIGNAL(stateChange(PluginListItem *, bool)), this, TQT_SLOT(stateChange(PluginListItem *, bool)));
tabControl->addTab(visTab, i18n("&Visualizations"));
// Other plugins are not restricted
- QFrame *otherTab = new QFrame(tabControl);
- (new QVBoxLayout(otherTab, KDialog::marginHint(), KDialog::spacingHint()))->setAutoAdd(true);
- (void)new QLabel(i18n("<b>Select any other plugins to use:</b>"), otherTab);
+ TQFrame *otherTab = new TQFrame(tabControl);
+ (new TQVBoxLayout(otherTab, KDialog::marginHint(), KDialog::spacingHint()))->setAutoAdd(true);
+ (void)new TQLabel(i18n("<b>Select any other plugins to use:</b>"), otherTab);
otherList = new PluginListView(0, otherTab);
otherList->addColumn(i18n("Name"));
otherList->addColumn(i18n("Description"));
otherList->addColumn(i18n("Author"));
otherList->addColumn(i18n("License"));
- connect(otherList, SIGNAL(stateChange(PluginListItem *, bool)), this, SLOT(stateChange(PluginListItem *, bool)));
+ connect(otherList, TQT_SIGNAL(stateChange(PluginListItem *, bool)), this, TQT_SLOT(stateChange(PluginListItem *, bool)));
tabControl->addTab(otherTab, i18n("O&ther Plugins"));
}
@@ -198,10 +198,10 @@ void Plugins::reopen()
otherList->clear();
visList->clear();
- QValueList<NoatunLibraryInfo> available = napp->libraryLoader()->available();
- QValueList<NoatunLibraryInfo> loaded = napp->libraryLoader()->loaded();
+ TQValueList<NoatunLibraryInfo> available = napp->libraryLoader()->available();
+ TQValueList<NoatunLibraryInfo> loaded = napp->libraryLoader()->loaded();
- for(QValueList<NoatunLibraryInfo>::Iterator i = available.begin(); i != available.end(); ++i)
+ for(TQValueList<NoatunLibraryInfo>::Iterator i = available.begin(); i != available.end(); ++i)
{
PluginListView *parent;
bool exclusive = false;
@@ -250,7 +250,7 @@ void Plugins::stateChange(PluginListItem *item, bool b)
void Plugins::addPlugin(const NoatunLibraryInfo &info)
{
// Load any that this one depends upon
- for(QStringList::ConstIterator i = info.require.begin(); i != info.require.end(); ++i)
+ for(TQStringList::ConstIterator i = info.require.begin(); i != info.require.end(); ++i)
{
NoatunLibraryInfo requiredInfo = napp->libraryLoader()->getInfo(*i);
PluginListItem *item = findItem(requiredInfo);
@@ -268,20 +268,20 @@ void Plugins::removePlugin(const NoatunLibraryInfo &info)
LibraryLoader &loader = *(napp->libraryLoader());
// Here are the ones loaded
- QValueList<NoatunLibraryInfo> loaded = napp->libraryLoader()->loaded();
+ TQValueList<NoatunLibraryInfo> loaded = napp->libraryLoader()->loaded();
// Add the ones marked for loading
- for(QStringList::ConstIterator i = mAdded.begin(); i != mAdded.end(); ++i)
+ for(TQStringList::ConstIterator i = mAdded.begin(); i != mAdded.end(); ++i)
loaded.append(loader.getInfo(*i));
// Subtract the ones marked for removal
- for(QStringList::ConstIterator i = mDeleted.begin(); i != mDeleted.end(); ++i)
+ for(TQStringList::ConstIterator i = mDeleted.begin(); i != mDeleted.end(); ++i)
loaded.remove(loader.getInfo(*i));
// If any depend on this plugin, mark them for removal (or remove them from mAdded)
- for(QValueList<NoatunLibraryInfo>::Iterator i = loaded.begin(); i != loaded.end(); ++i)
+ for(TQValueList<NoatunLibraryInfo>::Iterator i = loaded.begin(); i != loaded.end(); ++i)
{
- for(QStringList::ConstIterator j = (*i).require.begin(); j != (*i).require.end(); ++j)
+ for(TQStringList::ConstIterator j = (*i).require.begin(); j != (*i).require.end(); ++j)
{
if(*j == info.specfile)
{
@@ -299,7 +299,7 @@ void Plugins::removePlugin(const NoatunLibraryInfo &info)
PluginListItem *Plugins::findItem(const NoatunLibraryInfo &info) const
{
- for(QListViewItem *cur = otherList->firstChild(); cur != 0; cur = cur->itemBelow())
+ for(TQListViewItem *cur = otherList->firstChild(); cur != 0; cur = cur->itemBelow())
{
PluginListItem *item = dynamic_cast<PluginListItem *>(cur);
if(item && item->info() == info)
@@ -307,7 +307,7 @@ PluginListItem *Plugins::findItem(const NoatunLibraryInfo &info) const
}
// visualizations
- for(QListViewItem *cur = visList->firstChild(); cur != 0; cur = cur->itemBelow())
+ for(TQListViewItem *cur = visList->firstChild(); cur != 0; cur = cur->itemBelow())
{
PluginListItem *item = dynamic_cast<PluginListItem *>(cur);
if(item && item->info() == info)
@@ -316,7 +316,7 @@ PluginListItem *Plugins::findItem(const NoatunLibraryInfo &info) const
// If our only interface has a dependency removed, that's a double dose of trouble
// We may as well have this here for completeness, though
- for(QListViewItem *cur = interfaceList->firstChild(); cur != 0; cur = cur->itemBelow())
+ for(TQListViewItem *cur = interfaceList->firstChild(); cur != 0; cur = cur->itemBelow())
{
PluginListItem *item = dynamic_cast<PluginListItem *>(cur);
if(item && item->info() == info)
@@ -325,7 +325,7 @@ PluginListItem *Plugins::findItem(const NoatunLibraryInfo &info) const
// If a playlist is added or removed due to a dependency, we're doom-diddly-oomed
// We may as well have this here for completeness, though
- for(QListViewItem *cur = playlistList->firstChild(); cur != 0; cur = cur->itemBelow())
+ for(TQListViewItem *cur = playlistList->firstChild(); cur != 0; cur = cur->itemBelow())
{
PluginListItem *item = dynamic_cast<PluginListItem *>(cur);
if(item && item->info() == info)
@@ -342,20 +342,20 @@ void Plugins::save()
// Load the plugins the user added
//loader.loadAll(mAdded);
- QString oldPlaylist, newPlaylist;
+ TQString oldPlaylist, newPlaylist;
// first load all non playlist things
- for (QStringList::Iterator i = mAdded.begin(); i != mAdded.end(); ++i)
+ for (TQStringList::Iterator i = mAdded.begin(); i != mAdded.end(); ++i)
{
NoatunLibraryInfo info = loader.getInfo(*i);
if(info.type != "playlist")
- loader.loadAll(QStringList(*i));
+ loader.loadAll(TQStringList(*i));
else
newPlaylist = (*i);
}
// Remove the plugins the user removed
- for (QStringList::Iterator i = mDeleted.begin(); i != mDeleted.end(); ++i)
+ for (TQStringList::Iterator i = mDeleted.begin(); i != mDeleted.end(); ++i)
{
NoatunLibraryInfo info = loader.getInfo(*i);
if(info.type != "playlist")
@@ -372,15 +372,15 @@ void Plugins::save()
kdDebug(66666) << k_funcinfo << "Unloading " << oldPlaylist << endl;
loader.remove(oldPlaylist);
kdDebug(66666) << k_funcinfo << "Loading " << oldPlaylist << endl;
- loader.loadAll(QStringList(newPlaylist));
+ loader.loadAll(TQStringList(newPlaylist));
}
// Round up the ones that weren't loaded right now, for saving in the configuration
- QStringList specList(mAdded);
+ TQStringList specList(mAdded);
- QValueList<NoatunLibraryInfo> loaded = loader.loaded();
- for(QValueList<NoatunLibraryInfo>::Iterator i = loaded.begin(); i != loaded.end(); ++i)
+ TQValueList<NoatunLibraryInfo> loaded = loader.loaded();
+ for(TQValueList<NoatunLibraryInfo>::Iterator i = loaded.begin(); i != loaded.end(); ++i)
{
if(!specList.contains((*i).specfile) && loader.isLoaded((*i).specfile))
specList += (*i).specfile;
@@ -393,12 +393,12 @@ void Plugins::save()
mAdded.clear();
}
-void Plugins::showEvent(QShowEvent *e)
+void Plugins::showEvent(TQShowEvent *e)
{
if(!shown)
{
shown = true;
- KMessageBox::information(this, i18n("<qt>Changing your playlist plugin will stop playback. Different playlists may use different methods of storing information, so after changing playlists you may have to recreate your playlist.</qt>"), QString::null, "Plugin warning");
+ KMessageBox::information(this, i18n("<qt>Changing your playlist plugin will stop playback. Different playlists may use different methods of storing information, so after changing playlists you may have to recreate your playlist.</qt>"), TQString::null, "Plugin warning");
}
CModule::showEvent(e);
}