Skip to content

Commit

Permalink
Merge pull request #138 from yast/fix/ntp-client-return-value
Browse files Browse the repository at this point in the history
Fix/ntp client return value
  • Loading branch information
imobachgs committed Jul 4, 2019
2 parents b4aa67a + da04df0 commit 38a6a28
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
7 changes: 7 additions & 0 deletions package/yast2-ntp-client.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jul 4 10:29:27 UTC 2019 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Fix 'ntp-client' behaviour when running in firstboot
(bsc#1140199).
- 4.0.18

-------------------------------------------------------------------
Fri Mar 8 14:39:23 UTC 2019 - knut.anderssen@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-ntp-client.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-ntp-client
Version: 4.0.17
Version: 4.0.18
Release: 0
Summary: YaST2 - NTP Client Configuration
License: GPL-2.0+
Expand Down
7 changes: 6 additions & 1 deletion src/clients/ntp-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# $Id$
#
# Main file for ntp-client configuration. Uses all other files.

Yast.import "Stage"

module Yast
class NtpClientClient < Client
def main
Expand Down Expand Up @@ -43,9 +46,11 @@ def main
end

# CommandLine handler for running GUI
# @return [Boolean] true if settings were saved
# @return [Boolean,Symbol] true if settings were saved; :next, :abort or :back
# when running in 'firstboot'
def GuiHandler
ret = NtpClientSequence()
return ret if Yast::Stage.firstboot
return false if ret == :abort || ret == :back || ret.nil?
true
end
Expand Down
23 changes: 17 additions & 6 deletions src/lib/y2ntp_client/dialog/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Yast.import "Label"
Yast.import "NtpClient"
Yast.import "Stage"
Yast.import "Mode"

module Y2NtpClient
module Dialog
Expand Down Expand Up @@ -55,7 +55,8 @@ def run
end

def abort_button
Yast::Label.CancelButton
return Yast::Label.CancelButton unless installation?
nil
end

def hardware_clock_widgets
Expand All @@ -70,13 +71,23 @@ def hardware_clock_widgets
end

def back_button
# no back button
""
return "" unless installation?
nil
end

def next_button
# FIXME: it probably cannot run in initial stage, so not needed
Yast::Stage.initial ? Yast::Label.AcceptButton : Yast::Label.OKButton
return Yast::Label.OKButton unless installation?
nil
end

# Determines whether running in installation mode
#
# We do not use Stage.initial because of firstboot, which which runs in 'installation' mode
# but in 'firstboot' stage.
#
# @return [Boolean] Boolean if running in installation or update mode
def installation?
Yast::Mode.installation || Yast::Mode.update
end
end
end
Expand Down

0 comments on commit 38a6a28

Please sign in to comment.