Summary: | Amarok restarts instead of quitting if Universal Sidebar module is active | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Gunter Ohrner <kdebugs> |
Component: | general | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.4.4 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Gunter Ohrner
2006-12-09 09:26:39 UTC
I can confirm in Amarok 1.4.4, KDE 3.5.5, SUSE Linux 10.1, but ONLY if the Amarok tab IS in the universal sidebar. Yeah but, guys, how sick is that? How could an application restart itself? SVN commit 614830 by aoliveira: Universal Sidebar wouldn't let you quit amarok (it would always restart it). Now, it will only run amarok by explicit user request. BUG: 138574 M +39 -2 universalamarok.cpp M +4 -2 universalamarok.h --- trunk/extragear/multimedia/amarok/src/konquisidebar/universalamarok.cpp #614829:614830 @@ -212,6 +212,7 @@ */ void UniversalAmarok::updateStatus() { + checkForAmarok(); vol_slider->setValue( playerStub->getVolume() ); fileInfo->refresh(); if( fileInfo->lastModified() != fileDT ) @@ -236,7 +237,11 @@ */ void UniversalAmarok::openURLRequest( const KURL &url ) { - if( ! url.isValid() ) return; + if( ! url.isValid() ) return; + if (url.url() == "run:amarok") { + runAmarok(); + return; + } checkForAmarok(); playlistStub->playMedia(url); } @@ -247,10 +252,42 @@ */ void UniversalAmarok::checkForAmarok() { - if(amarokDCOP->isApplicationRegistered("amarok")) return; + if(!amarokDCOP->isApplicationRegistered("amarok")) + noAmarokRunning(); +} + + +void UniversalAmarok::noAmarokRunning() { + QString m_HTMLSource=""; + m_HTMLSource.append( + "<html>" + "<div id='introduction_box' class='box'>" + "<div id='introduction_box-header' class='box-header'>" + "<span id='introduction_box-header-title' class='box-header-title'>" + + i18n( "Amarok is not running!" ) + + "</span>" + "</div>" + "<div id='introduction_box-body' class='box-body'>" + "<p>" + + i18n( "To run Amarok, just click on the link below: " + ) + + "</p>" + "<a href='run:amarok' class='button'>" + i18n( "Run Amarok..." ) + "</a>" + "</div>" + "</div>" + "</html>" + ); + browser->begin(); + browser->write( m_HTMLSource ); + browser->end(); +} + +void UniversalAmarok::runAmarok() { KApplication::kdeinitExecWait("amarok"); } + + void UniversalAmarok::volChanged(int vol) { checkForAmarok(); --- trunk/extragear/multimedia/amarok/src/konquisidebar/universalamarok.h #614829:614830 @@ -22,7 +22,7 @@ #include <khtml_part.h> #include <konqsidebarplugin.h> -#include <dcopclient.h> +#include <dcopclient.h> #include <qslider.h> #include <qvbox.h> #include <khtmlview.h> @@ -79,7 +79,7 @@ AmarokPlayerInterface_stub *playerStub; AmarokPlaylistInterface_stub *playlistStub; AmarokContextBrowserInterface_stub *contextStub; - + public slots: void updateBrowser(const QString&); void updateStatus(); @@ -92,6 +92,8 @@ void volChanged(int vol); void openURLRequest( const KURL & ); void checkForAmarok(); + void noAmarokRunning(); + void runAmarok(); void lyrics() { contextStub->showLyrics(); } void currentTrack() { contextStub->showCurrentTrack(); } void wiki() { contextStub->showWiki(); } |