ref: refs/heads/use-activeresource commit 7461a04a7d6fdb4b847fcd7cd5032e4edd7d09f8 Author: Josef Reidinger <jreidinger@suse.cz> Date: Mon Aug 24 15:46:11 2009 +0200 adapt to new basesystem interface --- .../app/controllers/controlpanel_controller.rb | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/webclient/app/controllers/controlpanel_controller.rb b/webclient/app/controllers/controlpanel_controller.rb index e725dd5..650cd0b 100644 --- a/webclient/app/controllers/controlpanel_controller.rb +++ b/webclient/app/controllers/controlpanel_controller.rb @@ -36,6 +36,11 @@ class ControlpanelController < ApplicationController end end + + # Constant that signalizes, that all steps from base system setup are done + # This constant and constant in rest-service -> basesystem.rb are not connected + # and do not have to be the same value + FINAL_STEP = "FINISH" # nextstep and backstep expect, that wizard session variables are set def ensure_wizard if session[:wizard_steps].nil? or session[:wizard_current].nil? or session[:wizard_current] == FINAL_STEP @@ -53,6 +58,7 @@ class ControlpanelController < ApplicationController basesystem = proxy.find # this is just for saving network bandwidth, the steps list will not be saved basesystem.steps = [] + basesystem.finish = true # basesystem.save will set always current to FINAL_STEP basesystem.save session[:wizard_current] = FINAL_STEP @@ -107,10 +113,7 @@ class ControlpanelController < ApplicationController shortcuts end - # Constant that signalizes, that all steps from base system setup are done - # This constant and constant in rest-service -> basesystem.rb are not connected - # and do not have to be the same value - FINAL_STEP = "FINISH" + # Checks if basic system module should be shown instead of control panel # and if it should, then also redirects to that module. # TODO check if wizard from config exists @@ -131,13 +134,13 @@ class ControlpanelController < ApplicationController return false end - if basesystem.steps.empty? or basesystem.current == basesystem.final_step + if basesystem.steps.empty? or basesystem.finish session[:wizard_current] = FINAL_STEP return false end # we got some steps from backend, base system setup is not over and # no sign of progress in session variables => restart base system setup - logger.debug basesystem.steps.inspect + logger.debug "Basesystem steps: #{basesystem.steps.inspect}" session[:wizard_steps] = basesystem.steps.join(",") session[:wizard_current] = basesystem.steps.first redirect_to :controller => basesystem.steps.first -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org