--- a/src/configwizard.cpp +++ b/src/configwizard.cpp @@ -42,15 +42,21 @@ ******************************************************************************/ ConfigWizard::ConfigWizard( QWidget* parent, Mode mode, QString uid ) : BaseWizard( parent ), +#ifndef LINUX m_mode( mode ), m_bootstrapAllowed( false ), m_didBootstrap( false ), m_bootstrapStatus( -1 ) +#else + m_mode( mode ) +#endif { LOGL(3, "Launching ConfigWizard"); +#ifndef LINUX m_uid = uid; +#endif // Init strings here as they don't get translated if they're global m_introHeader = tr("Last.fm Setup"); @@ -73,6 +79,7 @@ m_loginHeader = tr("Log in"); + #ifndef LINUX m_detectExplainHeader = tr("Music Player Detection"); @@ -93,10 +100,12 @@ m_downloadHeader = tr("Downloading Plugins"); + #endif m_doneHeader = tr("Finally..."); + #ifndef LINUX m_bootstrapHeader = tr("Import your media player listening history"); @@ -113,6 +122,7 @@ m_mediaDeviceQuestion = tr("You've connected your iPod with Last.fm running for the first time. " "Would you like to scrobble the tracks played on your iPod to a profile from now on?"); + #endif #ifdef Q_WS_MAC m_doneInfoFirstRun = @@ -126,6 +136,7 @@ "icon in the system tray."); #endif + #ifndef LINUX m_doneInfoClientBootstrapExtra = tr("\n\nYour imported media player library will show up on your profile page " "within a few minutes."); @@ -135,6 +146,7 @@ m_doneInfoPlugin = tr("The plugin(s) you selected have now been installed."); + #endif #ifdef Q_WS_MAC setTitle(tr("Set up Last.fm")); @@ -155,6 +167,7 @@ #endif break; +#ifndef LINUX case MediaDevice: #ifdef Q_WS_X11 Q_ASSERT( !"MediaDevice mode not available on Linux" ); @@ -182,11 +195,13 @@ setNumPages( 4 ); break; +#endif } BaseWizard::nextButtonClicked(); +#ifndef LINUX if ( mode != MediaDevice ) { connect(&m_infoGetter, SIGNAL(updateInfoDone(bool, QString)), @@ -197,6 +212,9 @@ connect( The::webService(), SIGNAL(handshakeResult( Handshake* )), SLOT(handshakeFinished()) ); } +#else + connect( The::webService(), SIGNAL(handshakeResult( Handshake* )), SLOT(handshakeFinished()) ); +#endif } /****************************************************************************** @@ -224,6 +242,7 @@ } break; + #ifndef LINUX case 2: { m_page3 = new WizardInfoPage( this, m_detectExplainInfo ); @@ -360,6 +379,7 @@ return m_pageTwiddly; } break; + #endif case 10: { @@ -371,6 +391,7 @@ The::settings().setFirstRunDone(); info = m_doneInfoFirstRun; } + #ifndef LINUX else if ( m_mode == Plugin ) { info = m_doneInfoPlugin; @@ -379,6 +400,7 @@ { info = tr( "Last.fm is now ready for iPod scrobbling. Scrobbles should show up on your profile within 20 minutes of syncing your iPod with iTunes." ); } + #endif #ifndef Q_WS_X11 if ( m_didBootstrap ) @@ -446,6 +468,7 @@ { case 0: return m_introHeader; break; case 1: return m_loginHeader; break; +#ifndef LINUX case 2: return m_detectExplainHeader; break; case 3: return m_detectHeader; break; case 4: return m_selectHeader; break; @@ -454,6 +477,7 @@ case 7: return m_mediaDeviceHeader; break; case 8: return m_bootstrapHeader; break; case 9: return tr("Preparing for iPod Scrobbling"); +#endif case 10: return m_doneHeader; break; } @@ -498,6 +522,7 @@ } break; +#ifndef LINUX case 2: { // Leaving detect explain page, download plugin info @@ -614,6 +639,7 @@ // next clicked on Twiddly Bootstrap page } break; +#endif case 10: { @@ -636,6 +662,7 @@ A lot of this is duplicate code from UpdateWizard, should really consolidate this. ******************************************************************************/ +#ifndef LINUX bool ConfigWizard::downloadPlugins() { @@ -698,6 +725,7 @@ return true; } +#endif /****************************************************************************** @@ -708,12 +736,14 @@ bool valid, bool bootstrap) { +#ifndef LINUX m_bootstrapAllowed = bootstrap; qDebug() << "Bootstrap allowed" << m_bootstrapAllowed; #ifdef Q_WS_X11 m_bootstrapAllowed = false; #endif +#endif if ( valid ) { @@ -765,6 +795,7 @@ /****************************************************************************** pluginInfoDone ******************************************************************************/ +#ifndef LINUX void ConfigWizard::pluginInfoDone( bool error, @@ -832,6 +863,7 @@ BaseWizard::nextButtonClicked(); } } +#endif /****************************************************************************** reject @@ -839,13 +871,16 @@ void ConfigWizard::reject() { +#ifndef LINUX m_infoGetter.Cancel(); m_updater.Cancel(); +#endif QDialog::reject(); } +#ifndef LINUX void ConfigWizard::onBootstrapDone( int status ) { @@ -887,13 +922,16 @@ } // !pluginBootstrap #endif } +#endif int ConfigWizard::exec() { +#ifndef LINUX if (m_mode == MediaDevice && !twiddlyBootstrapRequired()) return QDialog::Accepted; +#endif s_wizardRunning = true; activateWindow(); @@ -910,6 +948,7 @@ } +#ifndef LINUX void ConfigWizard::onTwiddlyBootstrapDone() { @@ -937,3 +976,4 @@ return p.exitCode(); } +#endif --- a/src/configwizard.h +++ b/src/configwizard.h @@ -30,6 +30,7 @@ #include "wizardinfopage.h" #include "wizardloginpage.h" +#ifndef LINUX #include "wizardprogresspage.h" #include "wizardselectpluginpage.h" #include "wizardbootstrappage.h" @@ -38,6 +39,7 @@ #include "WizardTwiddlyBootstrapPage.h" #include "updateinfogetter.h" #include "autoupdater.h" +#endif #include @@ -105,61 +107,79 @@ Start downloading plugins. Returns true if plugin downloaded started, false otherwise. **************************************************************************/ +#ifndef LINUX bool downloadPlugins(); bool twiddlyBootstrapRequired(); +#endif WizardInfoPage* m_page1; WizardLoginPage* m_page2; +#ifndef LINUX WizardInfoPage* m_page3; WizardProgressPage* m_page4; WizardSelectPluginPage* m_page5; WizardProgressPage* m_page6; WizardBootstrapSelectorPage* m_page7; WizardBootstrapPage* m_page9; +#endif WizardInfoPage* m_page10; +#ifndef LINUX WizardTwiddlyBootstrapPage* m_pageTwiddly; //I'm abandoning the stupid numbering scheme +#endif Mode m_mode; // Set if the wizard is starting from a later page than 1 int m_pageOffset; +#ifndef LINUX CUpdateInfoGetter m_infoGetter; CAutoUpdater m_updater; class AbstractBootstrapper* m_bootstrapper; QString m_uid; bool m_bootstrapAllowed; bool m_didBootstrap; +#endif static bool s_wizardRunning; +#ifndef LINUX std::vector mAvailPlugins; std::vector mDownloadTasks; +#endif QString m_introHeader; QString m_introInfo; QString m_notAllowedInfo; QString m_loginHeader; +#ifndef LINUX QString m_detectExplainHeader; +#endif QString m_detectExplainInfo; QString m_detectHeader; QString m_detectInfo; QString m_selectHeader; +#ifndef LINUX QString m_downloadHeader; +#endif QString m_doneHeader; +#ifndef LINUX QString m_bootstrapHeader; QString m_bootstrapInfo; QString m_bootstrapQuestion; QString m_mediaDeviceHeader; QString m_mediaDeviceQuestion; +#endif QString m_doneInfoFirstRun; +#ifndef LINUX QString m_doneInfoPlugin; QString m_doneInfoClientBootstrapExtra; QString m_doneInfoPluginBootstrapExtra; int m_bootstrapStatus; +#endif private slots: @@ -178,6 +198,7 @@ void handshakeFinished(); +#ifndef LINUX /*********************************************************************/ /** Called by UpdateInfoGetter when the plugin info has finished downloading. @@ -201,6 +222,7 @@ void onTwiddlyBootstrapDone(); +#endif }; --- a/src/container.cpp +++ b/src/container.cpp @@ -26,7 +26,9 @@ #include "container.h" #include "aboutdialog.h" +#ifndef LINUX #include "autoupdater.h" +#endif #include "configwizard.h" #include "confirmdialog.h" #include "MooseCommon.h" @@ -54,7 +56,9 @@ #include "systray.h" #include "tagdialog.h" #include "SearchWidget.h" +#ifndef LINUX #include "updatewizard.h" +#endif #include "User.h" #include "toolbarvolumeslider.h" #include "WebService.h" @@ -68,6 +72,7 @@ #include #include #include +#include #ifdef LINUX #include @@ -95,7 +100,10 @@ s_instance = this; m_shareDialog = new ShareDialog( this ); m_diagnosticsDialog = new DiagnosticsDialog( this ); +#ifndef LINUX m_updater = new CAutoUpdater( this ); +#endif + #ifdef LINUX QDBusConnection::sessionBus().registerService( "fm.Last.client" ); m_dbusCurrentTrack = new DBusCurrentTrack( qApp ); @@ -423,8 +431,10 @@ { connect( ui.actionDashboard, SIGNAL( triggered() ), SLOT( gotoProfile() ) ); connect( ui.actionSettings, SIGNAL( triggered() ), SLOT( showSettingsDialog() ) ); +#ifndef LINUX connect( ui.actionGetPlugin, SIGNAL( triggered() ), SLOT( getPlugin() ) ); connect( ui.actionCheckForUpdates, SIGNAL( triggered() ), SLOT( checkForUpdates() ) ); +#endif connect( ui.actionAddUser, SIGNAL( triggered() ), SLOT( addUser() ) ); connect( ui.actionDeleteUser, SIGNAL( triggered() ), SLOT( deleteUser() ) ); connect( ui.actionToggleScrobbling, SIGNAL( triggered() ), SLOT( toggleScrobbling() ) ); @@ -450,7 +460,9 @@ connect( The::webService(), SIGNAL( failure( Request* ) ), SLOT( webServiceFailure( Request* ) ), Qt::QueuedConnection ); connect( &The::settings(), SIGNAL( userSettingsChanged( LastFmUserSettings& ) ), SLOT( updateUserStuff( LastFmUserSettings& ) ) ); connect( &The::settings(), SIGNAL( appearanceSettingsChanged() ), SLOT( updateAppearance() ) ); +#ifndef LINUX connect( m_updater, SIGNAL( updateCheckDone( bool, bool, QString ) ), SLOT( updateCheckDone( bool, bool, QString ) ) ); +#endif connect( ui.stack, SIGNAL( currentChanged( int ) ), SIGNAL( stackIndexChanged( int ) ) ); connect( ui.actionMyProfile, SIGNAL( triggered() ), SLOT( toggleSidebar() ) ); connect( ui.actionPlaylist, SIGNAL( triggered() ), SLOT( addToMyPlaylist() ) ); @@ -907,6 +919,7 @@ } +#ifndef LINUX void Container::getPlugin() { @@ -976,6 +989,7 @@ ConfigWizard( NULL, ConfigWizard::MediaDevice ).exec(); #endif } +#endif void @@ -2063,11 +2077,13 @@ } +#ifndef LINUX std::vector& Container::getPluginList() { return m_updater->getPluginList(); } +#endif void --- a/src/main.cpp +++ b/src/main.cpp @@ -20,7 +20,6 @@ ***************************************************************************/ #include "lastfmapplication.h" -#include "breakpad/BreakPad.h" #include "MooseCommon.h" #include "logger.h" #include "version.h" --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -219,7 +219,9 @@ connect( ui_radio.automaticBufferCheck, SIGNAL( toggled( bool ) ), this, SLOT( configChanged() ) ); connect( ui_radio.bufferEdit, SIGNAL( textChanged( QString ) ), this, SLOT( configChanged() ) ); connect( ui_radio.musicProxyPort, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); +#ifndef LINUX connect( ui_scrobbling.dirTree, SIGNAL( dataChanged() ), this, SLOT( configChanged() ) ); +#endif connect( ui_scrobbling.scrobblePointSlider, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); connect( ui_scrobbling.launchWithMediaPlayerCheck, SIGNAL( toggled( bool ) ), this, SLOT( configChanged() ) ); #ifndef LINUX @@ -421,8 +423,8 @@ ui_scrobbling.launchWithMediaPlayerCheck->setChecked( The::settings().launchWithMediaPlayer() ); #ifndef LINUX ui_scrobbling.fingerprintCheckBox->setChecked( user.fingerprintingEnabled() ); -#endif ui_scrobbling.dirTree->setExclusions( user.excludedDirs() ); +#endif } @@ -445,6 +447,7 @@ } +#ifndef LINUX void SettingsDialog::populateMediaDevices() { @@ -467,6 +470,7 @@ // is irrelevent on Linux since manual is the only supported option ui_mediadevices.deviceWidget->hideColumn( 2 ); } +#endif void @@ -484,7 +488,9 @@ if ( m_pagesToSave.contains( 1 ) ) saveRadio(); if ( m_pagesToSave.contains( 2 ) ) saveScrobbling(); if ( m_pagesToSave.contains( 3 ) ) saveConnection(); +#ifndef LINUX if ( m_pagesToSave.contains( 4 ) ) saveMediaDevices(); +#endif // Do extensions foreach ( int page, m_pagesToSave ) @@ -612,7 +618,9 @@ { LastFmUserSettings& user = The::settings().currentUser(); user.setScrobblePoint( ui_scrobbling.scrobblePointSlider->value() ); +#ifndef LINUX user.setExcludedDirs( ui_scrobbling.dirTree->getExclusions() ); +#endif The::settings().setLaunchWithMediaPlayer( ui_scrobbling.launchWithMediaPlayerCheck->isChecked() ); #ifndef LINUX user.setFingerprintingEnabled( ui_scrobbling.fingerprintCheckBox->checkState() == Qt::Checked ? true : false ); @@ -656,6 +664,7 @@ // EJ: Umm, surely this ought to be taken care of by the plugin itself, // and not coded straight into the Container? Like how the Skype // plugin does it. +#ifndef LINUX void SettingsDialog::saveMediaDevices() { @@ -690,6 +699,7 @@ pageSaved( 4 ); } +#endif void @@ -846,8 +856,10 @@ #define LOG_IF_FAIL( b, x ) bool b = x; if (!b) LOGL( 3, "Failed" #x ) MediaDeviceSettings().remove( "" ); +#ifndef LINUX ui_mediadevices.deviceWidget->clear(); ui_mediadevices.clearUserAssociations->setEnabled( false ); +#endif // On Windows QFile::remove() may always fail due to file locking. // XP users can uninstall to delete the cache, but Vista users are screwed. --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -30,7 +30,9 @@ #include "ui_settingsdialog_radio.h" #include "ui_settingsdialog_scrobbling.h" #include "ui_settingsdialog_connection.h" +#ifndef LINUX #include "ui_settingsdialog_mediadevices.h" +#endif class LoginWidget; @@ -69,20 +71,26 @@ void populateRadio(); void populateScrobbling(); void populateConnection(); +#ifndef LINUX void populateMediaDevices(); +#endif void saveAccount(); void saveRadio(); void saveScrobbling(); void saveConnection(); +#ifndef LINUX void saveMediaDevices(); +#endif Ui::SettingsDialog ui; Ui::SettingsDialogAccount ui_account; Ui::SettingsDialogRadio ui_radio; Ui::SettingsDialogScrobbling ui_scrobbling; Ui::SettingsDialogConnection ui_connection; +#ifndef LINUX Ui::SettingsDialogMediaDevices ui_mediadevices; +#endif LoginWidget* m_loginWidget; --- a/src/container.h +++ b/src/container.h @@ -57,7 +57,9 @@ std::vector& getPluginList(); public slots: + #ifndef LINUX void checkForUpdates( bool invokedByUser = true ); + #endif void showSettingsDialog( int startPage = 0 ); void showDiagnosticsDialog(); void showShareDialog(); @@ -106,7 +108,9 @@ void removeDMCAWarnings(); class TrayIcon* m_trayIcon; + #ifndef LINUX class CAutoUpdater *m_updater; + #endif #ifdef LINUX class DBusCurrentTrack* m_dbusCurrentTrack; class DBusCurrentUser* m_dbusCurrentUser; @@ -135,7 +139,9 @@ void about(); void addUser(); void deleteUser(); + #ifndef LINUX void getPlugin(); + #endif void onAboutToShowUserMenu(); void onTrayIconActivated( QSystemTrayIcon::ActivationReason ); void splitterMoved( int pos ) { m_sidebarWidth = pos; } @@ -175,7 +181,9 @@ void inviteAFriend(); void onUserSelected( QAction* action ); + #ifndef LINUX void updateCheckDone( bool updatesAvailable, bool error, QString errorMsg ); + #endif void updateWindowTitle( const MetaData& ); void updateUserStuff( LastFmUserSettings& user ); void updateAppearance(); --- a/src/lastfmapplication.cpp +++ b/src/lastfmapplication.cpp @@ -50,9 +50,13 @@ #include "MooseCommon.h" #include "UnicornCommon.h" +#if 0 #include "WebService/FrikkinNormanRequest.h" +#endif #include "mbid_mp3.h" +#include +#include #include #include #include @@ -75,7 +79,9 @@ m_endSessionEmitted( false ), m_handshaked( false ), m_user( 0 ), +#if 0 m_activeNorman( 0 ), +#endif m_state( State::Stopped ), m_proxyTestDone( false ), m_extensionsLoaded( false ) @@ -159,8 +165,10 @@ this, SLOT( onScrobblePointReached( TrackInfo ) ), Qt::QueuedConnection ); connect( m_listener, SIGNAL( exceptionThrown( QString ) ), this, SLOT( onListenerException( QString ) ) ); + #ifndef LINUX connect( m_listener, SIGNAL( bootStrapping( QString, QString ) ), this, SLOT( onBootstrapReady( QString, QString ) ) ); + #endif // Start listener worker thread m_listener->start(); @@ -237,8 +245,10 @@ proxyOffTest->start(); } + #ifndef LINUX LOGL( 3, "First run, launching config wizard" ); QFile( MooseUtils::savePath( "mediadevice.db" ) ).remove(); + #endif ConfigWizard wiz( NULL, ConfigWizard::Login ); @@ -1120,6 +1130,7 @@ } +#ifndef LINUX void LastFmApplication::onBootstrapReady( QString userName, QString pluginId ) { @@ -1140,6 +1151,7 @@ bootstrapper->submitBootstrap(); #endif } +#endif #ifndef LINUX @@ -1178,6 +1190,7 @@ #endif +#if 0 void LastFmApplication::onNormanRequestDone( Request* r ) { @@ -1187,6 +1200,7 @@ //m_container->statusBar()->showMessage( req->metadata() ); m_activeNorman = 0; } +#endif namespace The --- a/src/lastfmapplication.h +++ b/src/lastfmapplication.h @@ -154,7 +154,9 @@ public slots: // Switch the app to a different language void setLanguage( QString langCode ); +#ifndef LINUX void onBootstrapReady( QString userName, QString pluginId ); +#endif signals: void endSession(); // emitted when Windows shuts the app down @@ -184,7 +186,9 @@ #ifndef LINUX void onFingerprintQueryDone( TrackInfo, bool fullFpRequested ); #endif +#if 0 void onNormanRequestDone( Request* r ); +#endif void onPlaybackEndedTimerTimeout(); void onProxyTestComplete( bool proxySet, WebRequestResultCode, bool authProxyTimerComplete = false ); @@ -213,7 +217,9 @@ class FingerprintCollector* m_fpCollector; class FingerprintQueryer* m_fpQueryer; #endif +#if 0 class FrikkinNormanRequest* m_activeNorman; +#endif QPointer m_activeArtistReq; QPointer m_activeTrackReq; --- a/src/src.pro +++ b/src/src.pro @@ -216,11 +216,59 @@ LIBS += -lX11 -lz + FORMS -= BootstrapSelectorWidget.ui \ + addplayerdialog.ui \ + confirmwidget.ui \ + mediaDeviceConfirmWidget.ui \ + progresswidget.ui \ + selectpluginwidget.ui \ + selectupdateswidget.ui \ + settingsdialog_mediadevices.ui + HEADERS -= Bootstrapper/iTunesBootstrapper.h \ - Bootstrapper/PluginBootstrapper.h + Bootstrapper/PluginBootstrapper.h \ + addplayerdialog.h \ + appinfo.h \ + autoupdater.h \ + Bootstrapper/AbstractBootstrapper.h \ + Bootstrapper/AbstractFileBootstrapper.h \ + Bootstrapper/ITunesDevice/ITunesDevice.h \ + componentinfo.h \ + lib/FileVersionInfo/FileVersionInfo.h \ + lib/KillProcess/KillProcess.h \ + plugininfo.h \ + updateinfogetter.h \ + updatewizard.h \ + versionnumber.h \ + wizardbootstrappage.h \ + WizardBootstrapSelectorPage.h \ + wizardmediadeviceconfirmpage.h \ + wizardprogresspage.h \ + wizardselectpluginpage.h \ + wizardselectupdatespage.h \ + WizardTwiddlyBootstrapPage.h + SOURCES -= Bootstrapper/iTunesBootstrapper.cpp \ - Bootstrapper/PluginBootstrapper.cpp + Bootstrapper/PluginBootstrapper.cpp \ + addplayerdialog.cpp \ + appinfo.cpp \ + autoupdater.cpp \ + Bootstrapper/AbstractBootstrapper.cpp \ + Bootstrapper/AbstractFileBootstrapper.cpp \ + componentinfo.cpp \ + lib/FileVersionInfo/FileVersionInfo.cpp \ + plugininfo.cpp \ + updateinfogetter.cpp \ + updatewizard.cpp \ + versionnumber.cpp \ + wizardbootstrappage.cpp \ + WizardBootstrapSelectorPage.cpp \ + wizardmediadeviceconfirmpage.cpp \ + wizardprogresspage.cpp \ + wizardselectpluginpage.cpp \ + wizardselectupdatespage.cpp \ + WizardTwiddlyBootstrapPage.cpp LIBS -= -lLastFmFingerprint$$EXT } --- a/src/RestStateWidget.cpp +++ b/src/RestStateWidget.cpp @@ -125,7 +125,9 @@ connect( ui.label2, SIGNAL(linkActivated( QString )), SLOT(openProfile()) ); connect( &The::settings(), SIGNAL( userSwitched( LastFmUserSettings& ) ), SLOT( onUserChanged( LastFmUserSettings& ) ) ); +#ifndef LINUX connect( The::webService(), SIGNAL( handshakeResult( Handshake* ) ), SLOT( onHandshaken( Handshake* ) ) ); +#endif setFocusProxy( ui.edit ); setWatermark( MooseUtils::dataPath("watermark.png") ); @@ -189,6 +191,7 @@ } +#ifndef LINUX void RestStateWidget::onHandshaken( Handshake* handshake ) { @@ -229,6 +232,7 @@ connect( msg, SIGNAL( accepted() ), SLOT( showBootstrapWizard()) ); connect( msg, SIGNAL( moreHelpClicked() ), SLOT( openBootstrapFaq()) ); } +#endif void --- a/src/RestStateWidget.h +++ b/src/RestStateWidget.h @@ -53,7 +53,9 @@ void onEditTextChanged( const QString& ); void showBootstrapWizard(); void openBootstrapFaq(); +#ifndef LINUX void onHandshaken( class Handshake* handshake ); +#endif private: virtual bool eventFilter( QObject*, QEvent* ); --- a/src/libUnicorn/libUnicorn.pro +++ b/src/libUnicorn/libUnicorn.pro @@ -51,7 +51,6 @@ WebService/TrackUploadRequest.h \ WebService/UserLabelsRequest.h \ WebService/XmlRpc.h \ - WebService/FrikkinNormanRequest.h \ LastMessageBox.h \ CustomOpen.h \ StationUrl.h \ @@ -111,7 +110,6 @@ WebService/VerifyUserRequest.cpp \ WebService/GetXspfPlaylistRequest.cpp \ WebService/ProxyTestRequest.cpp \ - WebService/FrikkinNormanRequest.cpp \ LastMessageBox.cpp \ StationUrl.cpp \ StopWatch.cpp \