[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    [amarok] src/services/amazon: Allow selecting no country in the
From:       Sven Krohlas <sven () asbest-online ! de>
Date:       2011-11-25 23:30:28
Message-ID: 20111125233028.5C261A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit 068de578ac26f15a783b60d28a010ca7bd43f74a by Sven Krohlas.
Committed on 26/11/2011 at 00:25.
Pushed by krohlas into branch 'master'.

Allow selecting no country in the Amazon store

This makes the service stop popping up on startup, asking for the
users location. That issue has been reported several times since
our beta release, so adding two more strings late is hopefully
justified.

CCMAIL:kde-i18n-doc@kde.org

M  +6    -1    src/services/amazon/AmazonConfigWidget.ui
M  +5    -0    src/services/amazon/AmazonSettingsModule.cpp
M  +6    -0    src/services/amazon/AmazonStore.cpp

http://commits.kde.org/amarok/068de578ac26f15a783b60d28a010ca7bd43f74a

diff --git a/src/services/amazon/AmazonConfigWidget.ui \
b/src/services/amazon/AmazonConfigWidget.ui index 0f39727..ac2f10b 100644
--- a/src/services/amazon/AmazonConfigWidget.ui
+++ b/src/services/amazon/AmazonConfigWidget.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>402</width>
-    <height>118</height>
+    <height>120</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -102,6 +102,11 @@
             <string>United States</string>
            </property>
           </item>
+          <item>
+           <property name="text">
+            <string>none of the above (store won't work)</string>
+           </property>
+          </item>
          </widget>
         </item>
         <item>
diff --git a/src/services/amazon/AmazonSettingsModule.cpp \
b/src/services/amazon/AmazonSettingsModule.cpp index 537c582..61c88e8 100644
--- a/src/services/amazon/AmazonSettingsModule.cpp
+++ b/src/services/amazon/AmazonSettingsModule.cpp
@@ -75,6 +75,9 @@ AmazonSettingsModule::save()
     case 4:
         AmazonConfig::instance()->setCountry( QString ( "com" ) );
         break;
+    case 5:
+        AmazonConfig::instance()->setCountry( QString ( "none" ) );
+        break;
 
     default:
         AmazonConfig::instance()->setCountry( QString ( "" ) );
@@ -100,6 +103,8 @@ AmazonSettingsModule::load()
         index = 3;
     else if ( text == QString( "com" ) )
         index = 4;
+    else if ( text == QString( "none" ) )
+        index = 5;
     // no match -> index is still -1
 
     m_configDialog->countrySelectionComboBox->setCurrentIndex( index );
diff --git a/src/services/amazon/AmazonStore.cpp \
b/src/services/amazon/AmazonStore.cpp index b4f7d33..fec0ab2 100644
--- a/src/services/amazon/AmazonStore.cpp
+++ b/src/services/amazon/AmazonStore.cpp
@@ -281,6 +281,12 @@ AmazonStore::newSearchRequest( const QString request )
         if( !(KCM.exec() == QDialog::Accepted) )
             return;
     }
+    else if( AmazonConfig::instance()->country() == QString( "none" ) )
+    {
+        // user explicitly said we are in a not supported country
+        Amarok::Components::logger()->longMessage( i18n( "<b>MP3 Music \
Store</b><br/><br/>Please select a valid country in the settings to make the store \
work." ) ); +        return;
+    }
 
     if( m_lastSearch != request )
     {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic