- display 'insert media' prompt only for WRONG media error for now
authorJan Kupec <jkupec@suse.cz>
Thu, 30 Aug 2007 11:26:15 +0000 (11:26 +0000)
committerJan Kupec <jkupec@suse.cz>
Thu, 30 Aug 2007 11:26:15 +0000 (11:26 +0000)
src/zypper-media-callbacks.h

index 0f8108b..fab86a7 100644 (file)
@@ -41,19 +41,28 @@ namespace ZmartRecipients
                                                     MediaChangeReport::Error error,
                                                     const std::string & description )
     {
-      cerr << description << endl; 
-      // TranslatorExplanation translate letters 'y' and 'n' the same as you translated the [y/n] prompt. 
-      std::string request = boost::str(boost::format(
-          _("Please insert media [%s] # %d and type 'y' to continue or 'n' to cancel the operation."))
-          % repo.info().name() % mediumNr);
-      if (read_bool_answer(request, false))
-        return MediaChangeReport::RETRY; 
+      if (error == MediaChangeReport::WRONG)
+      {
+        // TranslatorExplanation translate letters 'y' and 'n' to whathever is appropriate for your language.
+        // Try to check what answers does zypper accept (it always accepts y/n at least)
+        // You can also have a look at the regular expressions used to check the answer here:
+        // /usr/lib/locale/<your_locale>/LC_MESSAGES/SYS_LC_MESSAGES
+        std::string request = boost::str(boost::format(
+            _("Please insert media [%s] # %d and type 'y' to continue or 'n' to cancel the operation."))
+            % repo.info().name() % mediumNr);
+        if (read_bool_answer(request, false))
+          return MediaChangeReport::RETRY; 
+        else
+          return MediaChangeReport::ABORT;
+      }
       else
-        return MediaChangeReport::ABORT; 
+      {
+        cerr << description << endl;
+      }
     }
   };
 
-    // progress for downloading a file
+  // progress for downloading a file
   struct DownloadProgressReportReceiver : public zypp::callback::ReceiveReport<zypp::media::DownloadProgressReport>
   {
     virtual void start( const zypp::Url & file, zypp::Pathname localfile )