Skip to content

Commit

Permalink
make storage more generic
Browse files Browse the repository at this point in the history
use Left() instead of :hstretch
  • Loading branch information
lslezak committed Mar 14, 2014
1 parent 12588fd commit 50ad9a5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Makefile.am
Expand Up @@ -14,7 +14,7 @@ ylib_DATA = \
lib/registration/addon.rb \
lib/registration/exceptions.rb \
lib/registration/sw_mgmt.rb \
lib/registration/reg_key_storage.rb \
lib/registration/storage.rb \
lib/registration/repo_state.rb \
lib/registration/helpers.rb

Expand Down
19 changes: 12 additions & 7 deletions src/clients/inst_scc.rb
Expand Up @@ -32,7 +32,7 @@
require "registration/helpers"
require "registration/sw_mgmt"
require "registration/repo_state"
require "registration/reg_key_storage"
require "registration/storage"

module Yast
class InstSccClient < Client
Expand Down Expand Up @@ -70,7 +70,7 @@ def main

# initialize known reg. keys
def initialize_regkeys
@known_reg_keys = ::Registration::RegKeyStorage.instance.reg_keys
@known_reg_keys = ::Registration::Storage::RegKeys.instance.reg_keys
if @known_reg_keys
log.info "Known reg keys: #{@known_reg_keys.size}"
return
Expand All @@ -89,7 +89,7 @@ def initialize_regkeys
end

# cache the values
::Registration::RegKeyStorage.instance.reg_keys = @known_reg_keys
::Registration::Storage::RegKeys.instance.reg_keys = @known_reg_keys
end

def register_base_system
Expand Down Expand Up @@ -178,7 +178,12 @@ def register(email, reg_code)
# then register the product(s)
product_services = run_with_feedback(_("Registering the Product..."), _("Contacting the SUSE Customer Center server")) do
# there will be just one base product, but theoretically there can be more...
::Registration::SwMgmt.products_to_register.map do |base_product|
products = ::Registration::SwMgmt.products_to_register

# remember the base products for later (to get the respective addons)
::Registration::Storage::BaseProducts.instance.products = products

products.map do |base_product|
log.info("Registering base product: #{base_product.inspect}")
scc.register(base_product)
end
Expand Down Expand Up @@ -325,13 +330,13 @@ def addon_selection_dialog_content(addons)

# the media check box is displayed only at installation
# to modify the installation workflow (display extra add-on dialog)
if Mode.installation
if Mode.installation || true
media_checkbox = VBox(
VSpacing(0.4),
HBox(
HSpacing(1),
CheckBox(Id(:media), Opt(:hstretch), _("In&clude Add-on Products from Separate Media"),
Installation.add_on_selected),
Left(CheckBox(Id(:media), _("In&clude Add-on Products from Separate Media"),
Installation.add_on_selected)),
)
)
end
Expand Down
Expand Up @@ -25,16 +25,24 @@
require "singleton"

module Registration
module Storage

# storage for changed repositories
class RegKeyStorage
include Singleton
# storage for changed repositories
class RegKeys
include Singleton

attr_accessor :reg_keys
attr_accessor :reg_keys

def initialize
@reg_keys = nil
def initialize
@reg_keys = nil
end
end
end

# remember the registered base product
class BaseProducts
include Singleton

attr_accessor :products
end
end
end

0 comments on commit 50ad9a5

Please sign in to comment.