Author: gs
Date: Thu May 19 14:04:01 2011
New Revision: 64066
URL: http://svn.opensuse.org/viewcvs/yast?rev=64066&view=rev
Log:
call SetModified(), restart fcoe only if modified
Modified:
trunk/fcoe-client/src/FcoeClient.ycp
trunk/fcoe-client/src/complex.ycp
Modified: trunk/fcoe-client/src/FcoeClient.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/FcoeClient.ycp?rev=64066&r1=64065&r2=64066&view=diff
==============================================================================
--- trunk/fcoe-client/src/FcoeClient.ycp (original)
+++ trunk/fcoe-client/src/FcoeClient.ycp Thu May 19 14:04:01 2011
@@ -331,7 +331,7 @@
}
list <string> lines = splitstring( content, "\n" );
- // TODO: better/more elegant way of reading values (use SysConfig agent?)
+
foreach( string line, (list<string>)lines, {
if ( regexpmatch( line, "^FCOE_ENABLE" ) )
{
@@ -427,13 +427,12 @@
boolean status = false;
status = Service::Enabled( "fcoe" );
- y2milestone( "Status of fcoe: %1", status );
+ y2milestone( "Start status of fcoe: %1", status );
service_start = add( service_start, "fcoe", status );
status = Service::Enabled( "lldpad" );
- y2milestone( "Status of lldpad: %1", status );
+ y2milestone( "Start status of lldpad: %1", status );
service_start = add( service_start, "lldpad", status );
-
}
global map GetStartStatus()
@@ -691,8 +690,13 @@
boolean RestartServiceFcoe()
{
- y2milestone( "Restarting fcoe");
- return Service::Restart("fcoe");
+ boolean ret = true;
+ if ( FcoeClient::Modified() )
+ {
+ y2milestone( "Restarting fcoe");
+ ret = Service::Restart("fcoe");
+ }
+ return ret;
}
/**
@@ -859,9 +863,6 @@
// adjust start status of services lldpad and fcoe
AdjustStartStatus();
- /* Error message */
- /* TODO - SuSEConfig required ???? */
- if(false) Report::Error (Message::SuSEConfigFailed());
sleep(sl);
if(PollAbort()) return false;
Modified: trunk/fcoe-client/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/complex.ycp?rev=64066&r1=64065&r2=64066&view=diff
==============================================================================
--- trunk/fcoe-client/src/complex.ycp (original)
+++ trunk/fcoe-client/src/complex.ycp Thu May 19 14:04:01 2011
@@ -43,13 +43,10 @@
include "fcoe-client/dialogs.ycp";
/**
- * Return a modification status
- * @return true if data was modified
+ * Show a popup on abort if data are modified and
+ * check redo list/execute redo commands.
+ * @return true if users aborts installation
*/
-boolean Modified() {
- return FcoeClient::Modified();
-}
-
boolean ReallyAbort() {
if ( !FcoeClient::Modified() )
return true;
@@ -77,18 +74,13 @@
return abort;
}
-boolean PollAbort() {
- return UI::PollInput() == `abort;
-}
-
/**
* Read settings dialog
* @return `abort if aborted and `next otherwise
*/
symbol ReadDialog() {
Wizard::RestoreHelp(HELPS["read"]:"");
- // TODO - check this - doesn't help to set it here but call PollAbort in FcoeClient directly ???
- //FcoeClient::SetAbortFunction(PollAbort);
+
if (!Confirm::MustBeRoot()) return `abort;
boolean ret = FcoeClient::Read();
return ret ? `next : `abort;
@@ -101,7 +93,7 @@
symbol WriteDialog() {
Wizard::RestoreHelp(HELPS["write"]:"");
y2milestone( "Writing configuration" );
- // FcoeClient::SetAbortFunction(PollAbort);
+
boolean ret = FcoeClient::Write();
return ret ? `next : `abort;
}
@@ -373,12 +365,22 @@
void StoreConfigurationDialog (string id, map event)
{
y2milestone( "Store configuration dialog" );
+
+ map config = FcoeClient::GetFcoeConfig();
+
string debug_val = (string)UI::QueryWidget( `id("debug"), `Value );
+ if ( config["DEBUG"]:"" != debug_val)
+ {
+ FcoeClient::SetFcoeConfigValue( "DEBUG", debug_val );
+ FcoeClient::SetModified( true );
+ }
string syslog_val = (string)UI::QueryWidget( `id("syslog"), `Value );
- FcoeClient::SetFcoeConfigValue( "DEBUG", debug_val );
- FcoeClient::SetFcoeConfigValue( "USE_SYSLOG", syslog_val );
- FcoeClient::SetModified( true );
+ if ( config["USE_SYSLOG"]:"" != syslog_val )
+ {
+ FcoeClient::SetFcoeConfigValue( "USE_SYSLOG", syslog_val );
+ FcoeClient::SetModified( true );
+ }
}
void StoreEditDialog (string id, map event)
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org