summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/lyrics/cmodule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'noatun-plugins/lyrics/cmodule.cpp')
-rw-r--r--noatun-plugins/lyrics/cmodule.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/noatun-plugins/lyrics/cmodule.cpp b/noatun-plugins/lyrics/cmodule.cpp
index 2501ebb..efc2d77 100644
--- a/noatun-plugins/lyrics/cmodule.cpp
+++ b/noatun-plugins/lyrics/cmodule.cpp
@@ -1,11 +1,11 @@
#include "cmodule.h"
#include "lyrics.h"
-#include <qlayout.h>
-#include <qstringlist.h>
-#include <qlabel.h>
+#include <tqlayout.h>
+#include <tqstringlist.h>
+#include <tqlabel.h>
#include <kmessagebox.h>
-#include <qvgroupbox.h>
-#include <qgrid.h>
+#include <tqvgroupbox.h>
+#include <tqgrid.h>
#include <klistbox.h>
#include <klineedit.h>
#include <kbuttonbox.h>
@@ -44,47 +44,47 @@ const char *const DEFAULT_QUERY =
"http://everything2.com/index.pl?node=$(author),"
"http://www.letssingit.com/cgi-exe/am.cgi?a=search&p=1&s=$(title)&l=song";
-LyricsCModule::LyricsCModule(QObject *_parent) : CModule(i18n("Lyrics"), i18n("Configure Lyrics Plugin"), "document", _parent) {
+LyricsCModule::LyricsCModule(TQObject *_parent) : CModule(i18n("Lyrics"), i18n("Configure Lyrics Plugin"), "document", _parent) {
/* Thanks to the kde-usability guys for the help designing this dialog!
* help to simon edwards of KGuardGod, for a big help designing it */
- QVBoxLayout *vlayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
- QHBoxLayout *hlayout = new QHBoxLayout(vlayout, KDialog::spacingHint());
+ TQVBoxLayout *vlayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ TQHBoxLayout *hlayout = new TQHBoxLayout(vlayout, KDialog::spacingHint());
vlayout->setStretchFactor( hlayout, 1 );
// Search box
- QVBoxLayout *boxlayout = new QVBoxLayout( hlayout, KDialog::spacingHint() );
- boxlayout->addWidget( new QLabel( i18n("Search providers:" ), this ) );
+ TQVBoxLayout *boxlayout = new TQVBoxLayout( hlayout, KDialog::spacingHint() );
+ boxlayout->addWidget( new TQLabel( i18n("Search providers:" ), this ) );
providersBox = new KListBox( this, "providersBox" );
boxlayout->addWidget(providersBox);
boxButtons = new KButtonBox( this, Vertical );
- boxButtons->addButton( i18n( "New Search Provider" ), this, SLOT( newSearch() ) );
- boxButtons->addButton( i18n( "Delete Search Provider" ), this, SLOT( delSearch() ) );
- boxButtons->addButton( i18n( "Move Up" ), this, SLOT( moveUpSearch() ) );
- boxButtons->addButton( i18n( "Move Down" ), this, SLOT( moveDownSearch() ) );
+ boxButtons->addButton( i18n( "New Search Provider" ), this, TQT_SLOT( newSearch() ) );
+ boxButtons->addButton( i18n( "Delete Search Provider" ), this, TQT_SLOT( delSearch() ) );
+ boxButtons->addButton( i18n( "Move Up" ), this, TQT_SLOT( moveUpSearch() ) );
+ boxButtons->addButton( i18n( "Move Down" ), this, TQT_SLOT( moveDownSearch() ) );
boxButtons->layout();
boxlayout->addWidget( boxButtons );
// Edit box
- QGroupBox *propBox = new QVGroupBox( i18n("Search Provider Properties" ), this );
- QGrid *editGrid = new QGrid(2, propBox );
+ TQGroupBox *propBox = new TQVGroupBox( i18n("Search Provider Properties" ), this );
+ TQGrid *editGrid = new TQGrid(2, propBox );
editGrid->setSpacing( propBox->insideSpacing() );
- new QLabel( i18n( "Name:" ), editGrid );
+ new TQLabel( i18n( "Name:" ), editGrid );
nameEdit = new KLineEdit( editGrid );
- new QLabel( i18n( "Query:" ), editGrid );
+ new TQLabel( i18n( "Query:" ), editGrid );
queryEdit = new KLineEdit( editGrid );
/* ATTENTION to translators:
* The property names can't be translated. This means that $(author) must be kept as $(author), $(title) as $(title), etc, or it won't work.*/
- QLabel *textLabel = new QLabel(i18n("For your query, you can use any property of your multimedia item, just enclosing it with a $(property).\n\nSome common properties used are $(title), $(author) and $(album). For example, to search in Google for the author, title and track, just use:\nhttp://www.google.com/search?q=$(author)+$(title)+$(track)"), propBox, "textLabel");
+ TQLabel *textLabel = new TQLabel(i18n("For your query, you can use any property of your multimedia item, just enclosing it with a $(property).\n\nSome common properties used are $(title), $(author) and $(album). For example, to search in Google for the author, title and track, just use:\nhttp://www.google.com/search?q=$(author)+$(title)+$(track)"), propBox, "textLabel");
textLabel->setAlignment(Qt::WordBreak);
hlayout->addWidget( propBox, 1 );
/* Signal/slots */
nameEdit->setEnabled( false );
queryEdit->setEnabled( false );
- connect( providersBox, SIGNAL( highlighted( QListBoxItem * ) ), this, SLOT( selected( QListBoxItem * ) ) );
- connect( nameEdit, SIGNAL( textChanged( const QString &) ), this, SLOT( nameChanged( const QString & ) ) );
- connect( queryEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( queryChanged( const QString & ) ) );
+ connect( providersBox, TQT_SIGNAL( highlighted( TQListBoxItem * ) ), this, TQT_SLOT( selected( TQListBoxItem * ) ) );
+ connect( nameEdit, TQT_SIGNAL( textChanged( const TQString &) ), this, TQT_SLOT( nameChanged( const TQString & ) ) );
+ connect( queryEdit, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( queryChanged( const TQString & ) ) );
@@ -93,7 +93,7 @@ LyricsCModule::LyricsCModule(QObject *_parent) : CModule(i18n("Lyrics"), i18n("C
save();
}
-void LyricsCModule::newSearch(QString name, QString query) {
+void LyricsCModule::newSearch(TQString name, TQString query) {
kdDebug(90020) << "New search" << endl;
SearchProvider s = { name, query };
mProviders.push_back( s );
@@ -105,7 +105,7 @@ void LyricsCModule::newSearch(QString name, QString query) {
//X providersBox->setCurrentItem( 0 );
}
-void LyricsCModule::selected( QListBoxItem *i ) {
+void LyricsCModule::selected( TQListBoxItem *i ) {
kdDebug(90020) << "selected" << endl;
int index = providersBox->index( i );
if ( index < 0 )
@@ -123,7 +123,7 @@ void LyricsCModule::delSearch() {
return;
}
int index = providersBox->currentItem();
- QValueVector<SearchProvider>::iterator it;
+ TQValueVector<SearchProvider>::iterator it;
for ( it = mProviders.begin(); ( *it ).name != mProviders[ index ].name || ( *it ).url != mProviders[ index ].url; ++it );
mProviders.erase( it );
providersBox->removeItem( index );
@@ -134,8 +134,8 @@ void LyricsCModule::moveUpSearch() {
if ( providersBox->currentItem() <= 0 )
return;
int index = providersBox->currentItem();
- QString name = mProviders[ index ].name;
- QString url = mProviders[ index ].url;
+ TQString name = mProviders[ index ].name;
+ TQString url = mProviders[ index ].url;
mProviders[ index ].name = mProviders[ index-1 ].name;
mProviders[ index ].url = mProviders[ index-1 ].url;
mProviders[ index-1 ].name = name;
@@ -149,8 +149,8 @@ void LyricsCModule::moveDownSearch() {
if ( static_cast<unsigned int>( providersBox->currentItem() ) >= providersBox->count()-1 )
return;
int index = providersBox->currentItem();
- QString name = mProviders[ index ].name;
- QString url = mProviders[ index ].url;
+ TQString name = mProviders[ index ].name;
+ TQString url = mProviders[ index ].url;
mProviders[ index ].name = mProviders[ index+1 ].name;
mProviders[ index ].url = mProviders[ index+1 ].url;
mProviders[ index+1 ].name = name;
@@ -160,7 +160,7 @@ void LyricsCModule::moveDownSearch() {
providersBox->setSelected( index+1, true );
}
-void LyricsCModule::nameChanged( const QString &name ) {
+void LyricsCModule::nameChanged( const TQString &name ) {
kdDebug(90020) << "name changed" << endl;
if ( providersBox->currentItem() < 0 )
return;
@@ -169,7 +169,7 @@ void LyricsCModule::nameChanged( const QString &name ) {
providersBox->changeItem( name, providersBox->currentItem() );
}
-void LyricsCModule::queryChanged( const QString &query ) {
+void LyricsCModule::queryChanged( const TQString &query ) {
kdDebug(90020) << "query changed" << endl;
if ( providersBox->currentItem() < 0 )
return;
@@ -180,8 +180,8 @@ void LyricsCModule::queryChanged( const QString &query ) {
void LyricsCModule::save() {
KConfig *conf = KGlobal::config();
conf->setGroup( "Lyrics" );
- QStringList queryList, nameList;
- QValueVector<SearchProvider>::iterator it;
+ TQStringList queryList, nameList;
+ TQValueVector<SearchProvider>::iterator it;
for ( it = mProviders.begin(); it != mProviders.end(); ++it ) {
kdDebug(90020) << "query:" << ( *it ).url << endl;
queryList += ( *it ).url;
@@ -196,7 +196,7 @@ void LyricsCModule::save() {
}
void LyricsCModule::reopen() {
- QStringList queryList, nameList;
+ TQStringList queryList, nameList;
KConfig *conf = KGlobal::config();
mProviders.clear();
providersBox->clear();
@@ -205,10 +205,10 @@ void LyricsCModule::reopen() {
queryList = conf->readListEntry( "queryList" );
nameList = conf->readListEntry( "nameList" );
if ( queryList.count() == 0 && nameList.count() == 0 ) {
- queryList = QStringList::split( ",", DEFAULT_QUERY );
- nameList = QStringList::split( ",", DEFAULT_NAME );
+ queryList = TQStringList::split( ",", DEFAULT_QUERY );
+ nameList = TQStringList::split( ",", DEFAULT_NAME );
}
- QStringList::Iterator queryIt, nameIt;
+ TQStringList::Iterator queryIt, nameIt;
for ( queryIt = queryList.begin(), nameIt = nameList.begin(); queryIt != queryList.end() && nameIt != nameList.end(); ++queryIt, ++nameIt ) {
kdDebug(90020) << "Read:" << *queryIt << " and " << *nameIt << endl;
newSearch( *nameIt, *queryIt );