diff options
Diffstat (limited to 'noatun-plugins/lyrics/lyrics.cpp')
-rw-r--r-- | noatun-plugins/lyrics/lyrics.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/noatun-plugins/lyrics/lyrics.cpp b/noatun-plugins/lyrics/lyrics.cpp index 611db9c..1c7a05b 100644 --- a/noatun-plugins/lyrics/lyrics.cpp +++ b/noatun-plugins/lyrics/lyrics.cpp @@ -5,7 +5,7 @@ #include <khtmlview.h> #include <kstdaction.h> #include <kstatusbar.h> -#include <qregexp.h> +#include <tqregexp.h> #include "lyrics.h" #include <noatun/player.h> #include <kdebug.h> @@ -27,25 +27,25 @@ Lyrics::Lyrics() : KMainWindow(), Plugin(), active(false) { lyrics = this; /* Create default actions */ - (void)KStdAction::close(this, SLOT(close()), actionCollection()); - ( void )KStdAction::goTo( this, SLOT( goTo() ), actionCollection(), "go_web_goTo" ); - //(void)KStdAction::print(this, SLOT(print()), actionCollection()); - //(void)KStdAction::printPreview(this, SLOT(printPreview()), actionCollection()); - //(void)KStdAction::mail(this, SLOT(mail()), actionCollection()); - //(void)KStdAction::find(this, SLOT(find()), actionCollection()); + (void)KStdAction::close(this, TQT_SLOT(close()), actionCollection()); + ( void )KStdAction::goTo( this, TQT_SLOT( goTo() ), actionCollection(), "go_web_goTo" ); + //(void)KStdAction::print(this, TQT_SLOT(print()), actionCollection()); + //(void)KStdAction::printPreview(this, TQT_SLOT(printPreview()), actionCollection()); + //(void)KStdAction::mail(this, TQT_SLOT(mail()), actionCollection()); + //(void)KStdAction::find(this, TQT_SLOT(find()), actionCollection()); follow_act = new KToggleAction(i18n("&Follow Noatun Playlist"), "goto", 0, actionCollection(), "follow"); - KStdAction::redisplay(this, SLOT(viewLyrics()), actionCollection()); + KStdAction::redisplay(this, TQT_SLOT(viewLyrics()), actionCollection()); attach_act = new KToggleAction(i18n("&Link URL to File"), "attach", KShortcut("CTRL+ALT+A"), actionCollection(), "attach_url"); - connect(attach_act, SIGNAL(toggled(bool)), this, SLOT(attach(bool))); - back_act = KStdAction::back(this, SLOT(back()), actionCollection()); + connect(attach_act, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(attach(bool))); + back_act = KStdAction::back(this, TQT_SLOT(back()), actionCollection()); back_act->setEnabled(false); - forward_act = KStdAction::forward(this, SLOT(forward()), actionCollection()); + forward_act = KStdAction::forward(this, TQT_SLOT(forward()), actionCollection()); forward_act->setEnabled(false); - new KWidgetAction( new QLabel(i18n("Search provider:"), this, "kde toolbar widget"), i18n("Search Provider"), 0, 0, 0, actionCollection(), "search_label"); - site_act = new KSelectAction(i18n("&Search Provider"), 0, this, SLOT(viewLyrics()), actionCollection(), "search_provider"); + new KWidgetAction( new TQLabel(i18n("Search provider:"), this, "kde toolbar widget"), i18n("Search Provider"), 0, 0, 0, actionCollection(), "search_label"); + site_act = new KSelectAction(i18n("&Search Provider"), 0, this, TQT_SLOT(viewLyrics()), actionCollection(), "search_provider"); /* Add entry to menu */ - menuID = napp->pluginMenuAdd(i18n("&View Lyrics"), this, SLOT(viewLyrics())); + menuID = napp->pluginMenuAdd(i18n("&View Lyrics"), this, TQT_SLOT(viewLyrics())); /* Create history manager and htmlpart */ history = new HistoryManager(this); @@ -53,11 +53,11 @@ Lyrics::Lyrics() : KMainWindow(), Plugin(), active(false) //htmlpart->view()->setMinimumSize(350, 420); /* Connect signals/slots */ - connect( htmlpart->browserExtension(), SIGNAL(openURLRequestDelayed( const KURL &, const KParts::URLArgs & )), this, SLOT(openURLRequest( const KURL &, const KParts::URLArgs & ))); - connect( htmlpart, SIGNAL(started(KIO::Job *)), this, SLOT(loadingURL(KIO::Job *)) ); - connect( htmlpart, SIGNAL(completed()), this, SLOT(loadedURL()) ); - connect( history, SIGNAL(uiChanged(int, bool)), this, SLOT(changeUI(int, bool)) ); - connect( napp->player(), SIGNAL(newSong()), this, SLOT(newSong()) ); + connect( htmlpart->browserExtension(), TQT_SIGNAL(openURLRequestDelayed( const KURL &, const KParts::URLArgs & )), this, TQT_SLOT(openURLRequest( const KURL &, const KParts::URLArgs & ))); + connect( htmlpart, TQT_SIGNAL(started(KIO::Job *)), this, TQT_SLOT(loadingURL(KIO::Job *)) ); + connect( htmlpart, TQT_SIGNAL(completed()), this, TQT_SLOT(loadedURL()) ); + connect( history, TQT_SIGNAL(uiChanged(int, bool)), this, TQT_SLOT(changeUI(int, bool)) ); + connect( napp->player(), TQT_SIGNAL(newSong()), this, TQT_SLOT(newSong()) ); /* Status bar */ statusBar()->insertItem(i18n("Ready"), 0, 1); @@ -79,14 +79,14 @@ Lyrics::Lyrics() : KMainWindow(), Plugin(), active(false) void Lyrics::goTo() { bool sel = false; - QString url = KLineEditDlg::getText( i18n( "Please enter the URL you want to go to:" ), htmlpart->url().prettyURL(), &sel, this ); + TQString url = KLineEditDlg::getText( i18n( "Please enter the URL you want to go to:" ), htmlpart->url().prettyURL(), &sel, this ); if ( !url.isEmpty() && sel ) go( KURL( url ) ); } -void Lyrics::setProviders( QValueVector<SearchProvider> &sites ) { +void Lyrics::setProviders( TQValueVector<SearchProvider> &sites ) { mSites = sites; - QStringList sitesName; + TQStringList sitesName; for (unsigned int i = 0; i < mSites.size(); ++i) { sitesName += mSites[i].name; } @@ -98,7 +98,7 @@ void Lyrics::attach(bool a) { if ( !napp->player()->current() ) return; if (a) { - KMessageBox::information(this, i18n("Choosing this option, the current URL will be attached to the current file. This way, if you try to view the lyrics of this file later, you won't have to search for it again. This information can be stored between sessions, as long as your playlist stores metadata about the multimedia items (almost all the playlists do). If you want to be able to search for other lyrics for this music, you must select this option again to clear the stored URL."), QString::null, "lyrics::attach_info"); + KMessageBox::information(this, i18n("Choosing this option, the current URL will be attached to the current file. This way, if you try to view the lyrics of this file later, you won't have to search for it again. This information can be stored between sessions, as long as your playlist stores metadata about the multimedia items (almost all the playlists do). If you want to be able to search for other lyrics for this music, you must select this option again to clear the stored URL."), TQString::null, "lyrics::attach_info"); kdDebug(90020) << "Setting URL for (attach)" << napp->player()->current().title() << endl; napp->player()->current().setProperty("Lyrics::URL", htmlpart->url().url()); site_act->setEnabled(false); @@ -181,21 +181,21 @@ void Lyrics::viewLyrics(int index) return; } //X <small>(if the above information is incorrect, the search may not find the correct music. If that's the case, use a tag editor to fix it. Hint: Use the luckytag plugin from the kdeaddons module to try to guess title, author and album from the song filename)</small><br> - QString url, name; + TQString url, name; if (index < 0) index = site_act->currentItem(); if ( index < 0 ) return; url = mSites[index].url; name = mSites[index].name; - QRegExp props_regexp("\\$\\((\\w+)\\)"); + TQRegExp props_regexp("\\$\\((\\w+)\\)"); int pos = props_regexp.search(url); while (pos >= 0) { - QString property = props_regexp.cap(1); + TQString property = props_regexp.cap(1); url.replace(pos, props_regexp.matchedLength(), napp->player()->current().property(property)); pos = props_regexp.search(url); } - QString title(napp->player()->current().property("title")); + TQString title(napp->player()->current().property("title")); setCaption(i18n("Loading Lyrics for %1").arg(title)); // Check if we have a music playing if (napp->player()->current()) { @@ -213,7 +213,7 @@ void Lyrics::viewLyrics(int index) if (napp->player()->current().property("Lyrics::URL").isEmpty()) { /* Use the query one */ _url = url; - _url.setQuery(_url.query().replace(QRegExp("%20"), "+")); + _url.setQuery(_url.query().replace(TQRegExp("%20"), "+")); kdDebug(90020) << "I'm using the query url" << endl; attach_act->setChecked(false); site_act->setEnabled(true); @@ -221,7 +221,7 @@ void Lyrics::viewLyrics(int index) htmlpart->write( i18n( "<hr><p><strong>Searching at %1</strong><br><small>(<a href=\"%3\">%2</a></small>)</p>" ).arg( name ).arg( _url.prettyURL() ).arg( _url.url() ) ); } else { _url = napp->player()->current().property("Lyrics::URL"); - _url.setQuery(_url.query().replace(QRegExp("%20"), "+")); + _url.setQuery(_url.query().replace(TQRegExp("%20"), "+")); kdDebug(90020) << "I'm using the stored url" << endl; attach_act->setChecked(true); site_act->setEnabled(false); @@ -232,7 +232,7 @@ void Lyrics::viewLyrics(int index) htmlpart->end(); go(_url); this->show(); - KMessageBox::information( this, i18n( "In order to find the lyrics for the current song, this plugin uses the properties stored with each song, such as its title, author and album. These properties are usually retrieved by a tag reader, but in some cases they may not be present or be incorrect. In that case, the Lyrics plugin will not be able to find the lyrics until these properties are fixed (you can fix them using the tag editor).\nHint: The lucky tag plugin, present in the kdeaddons module, can try to guess properties such as title and author from the filename of a song. Enabling it may increase the probability of finding lyrics." ), QString::null, "Lyrics::usage_info" ); + KMessageBox::information( this, i18n( "In order to find the lyrics for the current song, this plugin uses the properties stored with each song, such as its title, author and album. These properties are usually retrieved by a tag reader, but in some cases they may not be present or be incorrect. In that case, the Lyrics plugin will not be able to find the lyrics until these properties are fixed (you can fix them using the tag editor).\nHint: The lucky tag plugin, present in the kdeaddons module, can try to guess properties such as title and author from the filename of a song. Enabling it may increase the probability of finding lyrics." ), TQString::null, "Lyrics::usage_info" ); active = true; } } |