-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c48651
commit d03c2f6
Showing
102 changed files
with
407 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
|
||
require "yast/suse_connect" | ||
|
||
require "registration/helpers" | ||
require "registration/url_helpers" | ||
require "registration/ui/regservice_selection_dialog" | ||
|
||
module Yast | ||
class DiscoverRegistrationServicesClient < Client | ||
include Yast::Logger | ||
|
||
# @return [Array<SlpServiceClass::Service>] list of candidate services | ||
attr_reader :services | ||
unless defined?(DiscoverRegistrationServicesClient) | ||
class DiscoverRegistrationServicesClient < Client | ||
include Yast::Logger | ||
|
||
def initialize | ||
@services = [] | ||
end | ||
# @return [Array<SlpServiceClass::Service>] list of candidate services | ||
attr_reader :services | ||
|
||
def main | ||
textdomain "registration" | ||
@services = ::Registration::UrlHelpers.slp_discovery_feedback | ||
services.empty? ? nil : select_registration_service | ||
end | ||
def initialize | ||
@services = [] | ||
end | ||
|
||
private | ||
def main | ||
textdomain "registration" | ||
@services = ::Registration::UrlHelpers.slp_discovery_feedback | ||
services.empty? ? nil : select_registration_service | ||
end | ||
|
||
def select_registration_service | ||
service = ::Registration::UI::RegserviceSelectionDialog.run(services: services) | ||
case service | ||
when :scc | ||
nil | ||
when :cancel | ||
:cancel | ||
else | ||
url = ::Registration::UrlHelpers.service_url(service.slp_url) | ||
log.info "Selected service URL: #{url}" | ||
url | ||
private | ||
|
||
def select_registration_service | ||
service = ::Registration::UI::RegserviceSelectionDialog.run(services: services) | ||
case service | ||
when :scc | ||
nil | ||
when :cancel | ||
:cancel | ||
else | ||
url = ::Registration::UrlHelpers.service_url(service.slp_url) | ||
log.info "Selected service URL: #{url}" | ||
url | ||
end | ||
end | ||
end | ||
end unless defined?(DiscoverRegistrationServicesClient) | ||
end | ||
DiscoverRegistrationServicesClient.new.main | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.