Class: DInstaller::DBus::Software::Manager

Inherits:
BaseObject
  • Object
show all
Includes:
Interfaces::Progress, Interfaces::ServiceStatus, WithServiceStatus
Defined in:
lib/dinstaller/dbus/software/manager.rb

Overview

D-Bus object to manage software installation

Constant Summary

Constants included from Interfaces::ServiceStatus

Interfaces::ServiceStatus::SERVICE_STATUS_BUSY, Interfaces::ServiceStatus::SERVICE_STATUS_IDLE, Interfaces::ServiceStatus::SERVICE_STATUS_INTERFACE

Constants included from Interfaces::Progress

Interfaces::Progress::PROGRESS_INTERFACE

Instance Method Summary collapse

Methods included from Interfaces::ServiceStatus

included, #register_service_status_callbacks, #service_status_all, #service_status_current

Methods included from Interfaces::Progress

included, #progress_current_step, #progress_finished, #progress_properties, #progress_total_steps, #register_progress_callbacks

Methods included from WithServiceStatus

#busy_while, #service_status

Methods inherited from BaseObject

#interfaces_and_properties

Constructor Details

#initialize(backend, logger) ⇒ Manager

Constructor

Parameters:



45
46
47
48
49
50
51
# File 'lib/dinstaller/dbus/software/manager.rb', line 45

def initialize(backend, logger)
  super(PATH, logger: logger)
  @backend = backend
  register_callbacks
  register_progress_callbacks
  register_service_status_callbacks
end

Instance Method Details

#available_base_productsObject



83
84
85
86
87
# File 'lib/dinstaller/dbus/software/manager.rb', line 83

def available_base_products
  backend.products.map do |id, data|
    [id, data["name"], { "description" => data["description"] }].freeze
  end
end

#finishObject



112
113
114
# File 'lib/dinstaller/dbus/software/manager.rb', line 112

def finish
  busy_while { backend.finish }
end

#installObject



108
109
110
# File 'lib/dinstaller/dbus/software/manager.rb', line 108

def install
  busy_while { backend.install }
end

#probeObject



100
101
102
# File 'lib/dinstaller/dbus/software/manager.rb', line 100

def probe
  busy_while { backend.probe }
end

#proposeObject



104
105
106
# File 'lib/dinstaller/dbus/software/manager.rb', line 104

def propose
  busy_while { backend.propose }
end

#select_product(product_id) ⇒ Object



96
97
98
# File 'lib/dinstaller/dbus/software/manager.rb', line 96

def select_product(product_id)
  backend.select_product(product_id)
end

#selected_base_productString

Returns the selected base product

Returns:

  • (String)

    Product ID or an empty string if no product is selected



92
93
94
# File 'lib/dinstaller/dbus/software/manager.rb', line 92

def selected_base_product
  backend.product || ""
end