$OpenBSD: patch-src_container_cpp,v 1.2 2011/03/30 14:00:48 dcoppa Exp $
--- src/container.cpp.orig	Wed Mar 30 13:26:00 2011
+++ src/container.cpp	Wed Mar 30 13:28:01 2011
@@ -79,6 +79,7 @@ Container* Container::s_instance = 0;
 Container::Container()
         : QMainWindow(),
           m_userCheck( false ),
+          m_soundcardError( false ),
           m_sidebarEnabled( false ),
           m_sidebarWidth( 190 )
 #ifndef Q_WS_MAC
@@ -106,7 +107,6 @@ Container::setupUi()
 {
     ui.setupUi( this );
 
-    ui.actionCheckForUpdates->setMenuRole( QAction::ApplicationSpecificRole );
     ui.actionAboutLastfm->setMenuRole( QAction::AboutRole );
     ui.actionSettings->setMenuRole( QAction::PreferencesRole );
     ui.actionStop->setVisible( false );
@@ -318,7 +318,6 @@ void
 Container::applyPlatformSpecificTweaks()
 {
 #ifdef Q_WS_X11
-    ui.actionCheckForUpdates->setVisible( false );
     ui.actionQuit->setShortcut( tr( "CTRL+Q" ) );
     ui.actionQuit->setText( tr( "&Quit" ) );
 
@@ -411,7 +410,6 @@ Container::setupConnections()
     connect( ui.actionDashboard, SIGNAL( triggered() ), SLOT( gotoProfile() ) );
     connect( ui.actionSettings, SIGNAL( triggered() ), SLOT( showSettingsDialog() ) );
     connect( ui.actionGetPlugin, SIGNAL( triggered() ), SLOT( getPlugin() ) );
-    connect( ui.actionCheckForUpdates, SIGNAL( triggered() ), SLOT( checkForUpdates() ) );
     connect( ui.actionAddUser, SIGNAL( triggered() ), SLOT( addUser() ) );
     connect( ui.actionDeleteUser, SIGNAL( triggered() ), SLOT( deleteUser() ) );
     connect( ui.actionToggleScrobbling, SIGNAL( triggered() ), SLOT( toggleScrobbling() ) );
@@ -437,7 +435,6 @@ Container::setupConnections()
     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() ) );
-    connect( m_updater, SIGNAL( updateCheckDone( bool, bool, QString ) ), SLOT( updateCheckDone( bool, bool, QString ) ) );
     connect( ui.stack, SIGNAL( currentChanged( int ) ), SIGNAL( stackIndexChanged( int ) ) );
     connect( ui.actionMyProfile, SIGNAL( triggered() ), SLOT( toggleSidebar() ) );
     connect( ui.actionPlaylist, SIGNAL( triggered() ), SLOT( addToMyPlaylist() ) );
@@ -798,6 +795,7 @@ Container::onRadioError( RadioError error, const QStri
         case Handshake_SessionFailed:
         case Radio_PluginLoadFailed:
         case Radio_NoSoundcard:
+            m_soundcardError = true;
         case Radio_PlaybackError:
         case Radio_UnknownError:
         {
@@ -902,70 +900,6 @@ Container::getPlugin()
 
 
 void
-Container::checkForUpdates( bool invokedByUser )
-{
-    m_userCheck = invokedByUser;
-    if ( m_userCheck )
-    {
-        QApplication::setOverrideCursor( QCursor( Qt::WaitCursor ) );
-    }
-
-    m_updater->checkForUpdates();
-}
-
-
-void
-Container::updateCheckDone( bool updatesAvailable, bool error, QString errorMsg )
-{
-    QApplication::restoreOverrideCursor();
-
-    if ( error )
-    {
-        // Can't connect to the internet
-        LOG( 2, "Update check failed. Error: " << errorMsg << "\n" );
-        if ( m_userCheck )
-        {
-            LastMessageBox::critical( tr( "Connection Problem" ),
-                tr( "Last.fm couldn't connect to the Internet to check "
-                    "for updates.\n\nError: %1" ).arg( errorMsg ) );
-        }
-        return;
-    }
-
-    // No connection error, let's see if we have updates
-    if ( !updatesAvailable )
-    {
-        LOG( 3, "Update check said no updates available.\n" );
-        if ( m_userCheck )
-        {
-            LastMessageBox::information( tr( "Up To Date" ),
-                tr( "No updates available. All your software is up to date!\n" ) );
-        }
-        return;
-    }
-
-    // Go ahead and launch update wizard
-    LOG( 3, "New updates available. Launching update wizard.\n" );
-
-    UpdateWizard* wizard = new UpdateWizard( *m_updater, this );
-    if( wizard->shouldShow()) {
-        wizard->exec();
-        wizard->deleteLater();
-    }
-
-#ifdef WIN32
-    // this is really only for beta testers,
-    // ie. User installs 1.5 via installer, not upgrade path, but they had the
-    // itunes plugin version 2 installed already, so upgrade wizard wasn't run
-    // in previous instantiation. So we run configwizard to bootstrap twiddly
-    //NOTE some of this code is duplicated in LastFmApplication::init()
-    if (The::settings().weWereJustUpgraded())
-        ConfigWizard( NULL, ConfigWizard::MediaDevice ).exec();
-#endif
-}
-
-
-void
 Container::showFAQ()
 {
     QDesktopServices::openUrl( "http://" + UnicornUtils::localizedHostName( The::settings().appLanguage() ) + "/help/faq/" );
@@ -1987,8 +1921,11 @@ Container::onRadioStateChanged( RadioState newState )
 
         default:
         {
-            ui.actionPlay->setEnabled( true );
-            ui.actionStop->setEnabled( true );
+            if ( !m_soundcardError )
+            {
+                ui.actionPlay->setEnabled( true );
+                ui.actionStop->setEnabled( true );
+            }
         }
         break;
     }
