Skip to content

Commit

Permalink
Merge pull request #10 from ancorgs/reload_flag
Browse files Browse the repository at this point in the history
Adapt to the API changes in UI::ServiceStatus
  • Loading branch information
ancorgs committed Nov 27, 2015
2 parents 117d169 + c1ea55b commit 24f1658
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
8 changes: 7 additions & 1 deletion package/yast2-dhcp-server.changes
@@ -1,8 +1,14 @@
-------------------------------------------------------------------
Fri Nov 27 09:19:18 UTC 2015 - ancor@suse.com

- Adapted to latest changes in UI::ServiceStatus API (fate#318771)
- 3.1.7

-------------------------------------------------------------------
Thu Nov 26 10:36:14 UTC 2015 - ancor@suse.com

- Several UI improvements and fixes, including the usage of the
new generic widget to handle the service status.
new generic widget to handle the service status (fate#318771).
- 3.1.6

-------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions package/yast2-dhcp-server.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-dhcp-server
Version: 3.1.6
Version: 3.1.7
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -28,11 +28,11 @@ License: GPL-2.0
BuildRequires: perl-Digest-SHA1 perl-X500-DN perl-XML-Writer docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2-perl-bindings yast2-testsuite yast2-dns-server
BuildRequires: yast2-devtools >= 3.1.10
# UI::ServiceStatus
BuildRequires: yast2 >= 3.1.160
BuildRequires: yast2 >= 3.1.161

Requires: perl-gettext yast2-perl-bindings bind-utils perl-X500-DN yast2-ldap perl-Digest-SHA1 perl-Parse-RecDescent
# UI::ServiceStatus
Requires: yast2 >= 3.1.160
Requires: yast2 >= 3.1.161
# DnsServerAPI::IsServiceConfigurableExternally
Requires: yast2-dns-server >= 2.13.16

Expand Down
2 changes: 1 addition & 1 deletion src/include/dhcp-server/dialogs.rb
Expand Up @@ -651,7 +651,7 @@ def ConfigTypeSwitch
# @return [Boolean]
def restart?
# If ServiceStatus is used, DhcpServer must be set to write-only
DhcpServer.GetWriteOnly() && @status_widget && @status_widget.reload?
DhcpServer.GetWriteOnly() && @status_widget && @status_widget.reload_flag?
end
end
end
8 changes: 4 additions & 4 deletions src/include/dhcp-server/widgets.rb
Expand Up @@ -30,7 +30,7 @@ def initialize_dhcp_server_widgets(include_target)

# Init ServiceStatus widget
@service = SystemdService.find(DhcpServer.ServiceName())
@status_widget = ::UI::ServiceStatus.new(@service, reload_label: :restart)
@status_widget = ::UI::ServiceStatus.new(@service, reload_flag_label: :restart)
end

# Function for deleting entry from section
Expand Down Expand Up @@ -858,8 +858,8 @@ def init_service_status(_key)
# Handle function for the ServiceStatus widget
def handle_service_status(_key, event)
event_id = event["ID"]
if @status_widget.handle_input(event_id) == :enabled_changed
DhcpServer.SetModified if @status_widget.enabled? != DhcpServer.GetStartService
if @status_widget.handle_input(event_id) == :enabled_flag
DhcpServer.SetModified
end
nil
end
Expand All @@ -868,7 +868,7 @@ def handle_service_status(_key, event)
# @param [String] id string widget id
# @param [Hash] event map event that caused storing process
def store_service_status(_key, _event)
DhcpServer.SetStartService(@status_widget.enabled?)
DhcpServer.SetStartService(@status_widget.enabled_flag?)
nil
end

Expand Down

0 comments on commit 24f1658

Please sign in to comment.