ref: refs/heads/dmacvicar_log_viewer commit 2341533f54cd077feeb970c38922794bb533bae6 Author: Josef Reidinger <jreidinger@suse.cz> Date: Mon Aug 24 15:37:09 2009 +0200 change basesystem part to reflect new api --- .../app/controllers/controlpanel_controller.rb | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/webclient/app/controllers/controlpanel_controller.rb b/webclient/app/controllers/controlpanel_controller.rb index e725dd5..879a12f 100644 --- a/webclient/app/controllers/controlpanel_controller.rb +++ b/webclient/app/controllers/controlpanel_controller.rb @@ -36,6 +36,10 @@ 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 +57,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,13 +112,10 @@ 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 + # TODO check if controller from config exists def need_redirect if session[:wizard_current] # session variable is used to find out, if basic system module is needed @@ -124,6 +126,7 @@ class ControlpanelController < ApplicationController else basesystem = load_proxy 'org.opensuse.yast.modules.basesystem' unless basesystem + #FIXME after load_proxy improvement erase_redirect_results #reset all error redirects erase_render_results #erase all error render flash.clear #no error flash from load_proxy @@ -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 "Base system steps loaded: #{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