Mailinglist Archive: yast-commit (759 mails)
| < Previous | Next > |
[yast-commit] r45678 - in /trunk/pkg-bindings: VERSION package/yast2-pkg-bindings.changes src/Callbacks.cc src/Callbacks_Register.cc
- From: lslezak@xxxxxxxxxxxxxxxx
- Date: Fri, 21 Mar 2008 16:51:43 -0000
- Message-id: <20080321165143.E02C224788@xxxxxxxxxxxxxxxx>
Author: lslezak
Date: Fri Mar 21 17:51:43 2008
New Revision: 45678
URL: http://svn.opensuse.org/viewcvs/yast?rev=45678&view=rev
Log:
- media change callback - added error code parameter (bnc#328822)
- 2.16.20
Modified:
trunk/pkg-bindings/VERSION
trunk/pkg-bindings/package/yast2-pkg-bindings.changes
trunk/pkg-bindings/src/Callbacks.cc
trunk/pkg-bindings/src/Callbacks_Register.cc
Modified: trunk/pkg-bindings/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/VERSION?rev=45678&r1=45677&r2=45678&view=diff
==============================================================================
--- trunk/pkg-bindings/VERSION (original)
+++ trunk/pkg-bindings/VERSION Fri Mar 21 17:51:43 2008
@@ -1 +1 @@
-2.16.19
+2.16.20
Modified: trunk/pkg-bindings/package/yast2-pkg-bindings.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/package/yast2-pkg-bindings.changes?rev=45678&r1=45677&r2=45678&view=diff
==============================================================================
--- trunk/pkg-bindings/package/yast2-pkg-bindings.changes (original)
+++ trunk/pkg-bindings/package/yast2-pkg-bindings.changes Fri Mar 21 17:51:43
2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Mar 21 17:50:16 CET 2008 - lslezak@xxxxxxx
+
+- media change callback - added error code parameter (bnc#328822)
+- 2.16.20
+
+-------------------------------------------------------------------
Mon Mar 17 16:15:18 CET 2008 - ma@xxxxxxx
- Remove outdated/obsolete references to zypp
Modified: trunk/pkg-bindings/src/Callbacks.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Callbacks.cc?rev=45678&r1=45677&r2=45678&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Callbacks.cc (original)
+++ trunk/pkg-bindings/src/Callbacks.cc Fri Mar 21 17:51:43 2008
@@ -1001,6 +1001,25 @@
{
MediaChangeReceive( RecipientCtl & construct_r ) : Recipient(
construct_r ) {}
+ std::string
MediaChangeErrorAsString(zypp::media::MediaChangeReport::Error error)
+ {
+ // convert enum to a string
+ std::string error_str;
+
+ switch(error)
+ {
+ // no error
+ case zypp::media::MediaChangeReport::NO_ERROR : error_str =
"NO_ERROR"; break;
+ case zypp::media::MediaChangeReport::NOT_FOUND : error_str =
"NOT_FOUND"; break;
+ case zypp::media::MediaChangeReport::IO : error_str =
"IO"; break;
+ case zypp::media::MediaChangeReport::INVALID : error_str =
"INVALID"; break;
+ case zypp::media::MediaChangeReport::WRONG : error_str =
"WRONG"; break;
+ case zypp::media::MediaChangeReport::IO_SOFT : error_str =
"IO_SOFT"; break;
+ }
+
+ return error_str;
+ }
+
virtual Action requestMedia(zypp::Url &url,
unsigned int mediumNr,
const std::string & label,
@@ -1019,6 +1038,9 @@
CB callback( ycpcb( YCPCallbacks::CB_MediaChange ) );
if ( callback._set )
{
+ // error code
+ callback.addStr( MediaChangeErrorAsString(error) );
+
// error message
callback.addStr( description );
Modified: trunk/pkg-bindings/src/Callbacks_Register.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Callbacks_Register.cc?rev=45678&r1=45677&r2=45678&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Callbacks_Register.cc (original)
+++ trunk/pkg-bindings/src/Callbacks_Register.cc Fri Mar 21 17:51:43 2008
@@ -170,7 +170,7 @@
/**
* @builtin CallbackMediaChange
* @short Register callback function
- * @param string args Name of the callback handler function. Required callback
prototype is <code>string( string error, string url, string product, integer
current, string current_label, integer wanted, string wanted_label, boolean
double_sided, list<string> devices, integer current_device )</code>. The
callback function should ask user to change the medium or to change the URL of
the repository. Result of the callback must be "" (retry), "I" (ignore), "C"
(cancel), "S" (skip), "E" (eject), "E+number" (eject device at number) or a new
URL of the repository.
+ * @param string args Name of the callback handler function. Required callback
prototype is <code>string( string error_code, string error, string url, string
product, integer current, string current_label, integer wanted, string
wanted_label, boolean double_sided, list<string> devices, integer
current_device )</code>. The callback function should ask user to change the
medium or to change the URL of the repository. Error code can be "NO_ERROR" (no
error occured), "NOT_FOUND" (the file was not found), "IO" (I/O error),
"IO_SOFT" (timeout when acceessing the network), "INVALID" (broken medium),
"WRONG" (unexpected medium, wrong ID). Result of the callback must be ""
(retry), "I" (ignore), "C" (cancel), "S" (skip), "E" (eject), "E+number" (eject
device at number) or a new URL of the repository.
* @return void
*/
YCPValue PkgFunctions::CallbackMediaChange( const YCPString& args ) {
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Fri Mar 21 17:51:43 2008
New Revision: 45678
URL: http://svn.opensuse.org/viewcvs/yast?rev=45678&view=rev
Log:
- media change callback - added error code parameter (bnc#328822)
- 2.16.20
Modified:
trunk/pkg-bindings/VERSION
trunk/pkg-bindings/package/yast2-pkg-bindings.changes
trunk/pkg-bindings/src/Callbacks.cc
trunk/pkg-bindings/src/Callbacks_Register.cc
Modified: trunk/pkg-bindings/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/VERSION?rev=45678&r1=45677&r2=45678&view=diff
==============================================================================
--- trunk/pkg-bindings/VERSION (original)
+++ trunk/pkg-bindings/VERSION Fri Mar 21 17:51:43 2008
@@ -1 +1 @@
-2.16.19
+2.16.20
Modified: trunk/pkg-bindings/package/yast2-pkg-bindings.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/package/yast2-pkg-bindings.changes?rev=45678&r1=45677&r2=45678&view=diff
==============================================================================
--- trunk/pkg-bindings/package/yast2-pkg-bindings.changes (original)
+++ trunk/pkg-bindings/package/yast2-pkg-bindings.changes Fri Mar 21 17:51:43
2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Mar 21 17:50:16 CET 2008 - lslezak@xxxxxxx
+
+- media change callback - added error code parameter (bnc#328822)
+- 2.16.20
+
+-------------------------------------------------------------------
Mon Mar 17 16:15:18 CET 2008 - ma@xxxxxxx
- Remove outdated/obsolete references to zypp
Modified: trunk/pkg-bindings/src/Callbacks.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Callbacks.cc?rev=45678&r1=45677&r2=45678&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Callbacks.cc (original)
+++ trunk/pkg-bindings/src/Callbacks.cc Fri Mar 21 17:51:43 2008
@@ -1001,6 +1001,25 @@
{
MediaChangeReceive( RecipientCtl & construct_r ) : Recipient(
construct_r ) {}
+ std::string
MediaChangeErrorAsString(zypp::media::MediaChangeReport::Error error)
+ {
+ // convert enum to a string
+ std::string error_str;
+
+ switch(error)
+ {
+ // no error
+ case zypp::media::MediaChangeReport::NO_ERROR : error_str =
"NO_ERROR"; break;
+ case zypp::media::MediaChangeReport::NOT_FOUND : error_str =
"NOT_FOUND"; break;
+ case zypp::media::MediaChangeReport::IO : error_str =
"IO"; break;
+ case zypp::media::MediaChangeReport::INVALID : error_str =
"INVALID"; break;
+ case zypp::media::MediaChangeReport::WRONG : error_str =
"WRONG"; break;
+ case zypp::media::MediaChangeReport::IO_SOFT : error_str =
"IO_SOFT"; break;
+ }
+
+ return error_str;
+ }
+
virtual Action requestMedia(zypp::Url &url,
unsigned int mediumNr,
const std::string & label,
@@ -1019,6 +1038,9 @@
CB callback( ycpcb( YCPCallbacks::CB_MediaChange ) );
if ( callback._set )
{
+ // error code
+ callback.addStr( MediaChangeErrorAsString(error) );
+
// error message
callback.addStr( description );
Modified: trunk/pkg-bindings/src/Callbacks_Register.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Callbacks_Register.cc?rev=45678&r1=45677&r2=45678&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Callbacks_Register.cc (original)
+++ trunk/pkg-bindings/src/Callbacks_Register.cc Fri Mar 21 17:51:43 2008
@@ -170,7 +170,7 @@
/**
* @builtin CallbackMediaChange
* @short Register callback function
- * @param string args Name of the callback handler function. Required callback
prototype is <code>string( string error, string url, string product, integer
current, string current_label, integer wanted, string wanted_label, boolean
double_sided, list<string> devices, integer current_device )</code>. The
callback function should ask user to change the medium or to change the URL of
the repository. Result of the callback must be "" (retry), "I" (ignore), "C"
(cancel), "S" (skip), "E" (eject), "E+number" (eject device at number) or a new
URL of the repository.
+ * @param string args Name of the callback handler function. Required callback
prototype is <code>string( string error_code, string error, string url, string
product, integer current, string current_label, integer wanted, string
wanted_label, boolean double_sided, list<string> devices, integer
current_device )</code>. The callback function should ask user to change the
medium or to change the URL of the repository. Error code can be "NO_ERROR" (no
error occured), "NOT_FOUND" (the file was not found), "IO" (I/O error),
"IO_SOFT" (timeout when acceessing the network), "INVALID" (broken medium),
"WRONG" (unexpected medium, wrong ID). Result of the callback must be ""
(retry), "I" (ignore), "C" (cancel), "S" (skip), "E" (eject), "E+number" (eject
device at number) or a new URL of the repository.
* @return void
*/
YCPValue PkgFunctions::CallbackMediaChange( const YCPString& args ) {
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |