From 267b77d1666e24b41d0f84542f5aded4021dad9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz?= Date: Wed, 8 Aug 2018 12:07:18 +0100 Subject: [PATCH] Rewrite a little HttpServer#Write method Basically to update the message displayed when the service is being save, because it also could be (re)started/stopped/reloaded not only enabled or disabled. --- src/modules/HttpServer.rb | 65 ++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/src/modules/HttpServer.rb b/src/modules/HttpServer.rb index e095a8b..cec3358 100644 --- a/src/modules/HttpServer.rb +++ b/src/modules/HttpServer.rb @@ -411,65 +411,52 @@ def Read end # Write all http-server settings + # # @return true on success def Write - # HttpServer read dialog caption + # HttpServer write dialog caption caption = _("Saving HTTP Server Configuration") - steps = 3 - - # We do not set help text here, because it was set outside - Progress.New( - caption, - " ", - steps, - [ - # translators: progress stage 1/3 - _("Write the Apache2 settings"), - YaST::HTTPDData.GetService ? - # translators: progress stage 2/3 - _("Enable Apache2 service") : - # translators: progress stage 3/3 - _("Disable Apache2 service") - ], - [ - # translators: progress step 1/3 - _("Writing the settings..."), - YaST::HTTPDData.GetService ? - # translators: progress step 2/3 - _("Enabling Apache2 service...") : - # translators: progress step 3/3 - _("Disabling Apache2 service..."), - # translators: progress finished - _("Finished") - ], - "" - ) + stages = [ + # translators: progress stage 1/2 + _("Write the Apache2 settings"), + # translators: progress stage 2/2 + _("Save the Apache2 service status") + ] + steps = [ + # translators: progress step 1/3 + _("Writing the settings..."), + # translators: progress step 2/3 + _("Saving the Apache2 service status..."), + # translators: progress step 3/3, finished + _("Finished") + ] - # write Apache2 settings + Progress.New(caption, " ", steps.count, stages, steps, "") + # Write Apache2 settings rpms = YaPI::HTTPD.GetModulePackages - # install required RPMs for modules + # Install required RPMs for modules Package.InstallAllMsg( rpms, _( "The enabled modules require\n" + - "installation of some of these additional packages:\n" + - "%1\n" + - "Install them now?\n" + "installation of some of these additional packages:\n" + + "%1\n" + + "Install them now?\n" ) ) - # write httpd.conf - - # write hosts + # Write httpd.conf + # Write hosts backup_vhost_config + YaST::HTTPDData.WriteHosts Progress.NextStage old_progress = Progress.set(false) # off(); - # always adapt firewall + # Always adapt firewall if YaST::HTTPDData.WriteListen(false) == nil # FIXME: show popup