Class: Installation::Dialogs::Security
- Inherits:
-
CWM::Dialog
- Object
- CWM::Dialog
- Installation::Dialogs::Security
- Defined in:
- src/lib/installation/dialogs/security.rb
Overview
Dialog for security proposal configuration
Instance Method Summary collapse
- #abort_button ⇒ Object
- #back_button ⇒ Object
- #contents ⇒ Object
- #cpu_frame ⇒ Object protected
- #disable_buttons ⇒ Object
- #firewall_frame ⇒ Object protected
- #frame(label, widget) ⇒ Object protected
-
#hostname ⇒ String
protected
Hostname of the current system.
-
#initialize(settings) ⇒ Security
constructor
A new instance of Security.
- #lsm_configurable? ⇒ Boolean protected
- #lsm_frame ⇒ Object protected
- #next_button ⇒ Object
- #polkit_frame ⇒ Object protected
- #should_open_dialog? ⇒ Boolean protected
- #title ⇒ Object
Constructor Details
#initialize(settings) ⇒ Security
Returns a new instance of Security.
32 33 34 35 36 37 |
# File 'src/lib/installation/dialogs/security.rb', line 32 def initialize(settings) super() textdomain "installation" @settings = settings end |
Instance Method Details
#abort_button ⇒ Object
70 71 72 |
# File 'src/lib/installation/dialogs/security.rb', line 70 def "" end |
#back_button ⇒ Object
74 75 76 77 |
# File 'src/lib/installation/dialogs/security.rb', line 74 def # do not show back button when running on running system. See CWM::Dialog.back_button Yast::Mode.installation ? nil : "" end |
#contents ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'src/lib/installation/dialogs/security.rb', line 43 def contents # lazy require to avoid build dependency on firewall require "y2firewall/widgets/proposal" # lazy require to avoid build dependency on bootloader require "bootloader/grub2_widgets" left_col = [firewall_frame, polkit_frame] right_col = [cpu_frame] right_col << lsm_frame if lsm_configurable? HBox( HStretch(), VBox( VStretch(), *left_col, VStretch() ), HStretch(), VBox( VStretch(), *right_col, VStretch() ), HStretch() ) end |
#cpu_frame ⇒ Object (protected)
121 122 123 124 125 126 |
# File 'src/lib/installation/dialogs/security.rb', line 121 def cpu_frame frame( _("CPU"), ::Bootloader::CpuMitigationsWidget.new ) end |
#disable_buttons ⇒ Object
83 84 85 |
# File 'src/lib/installation/dialogs/security.rb', line 83 def [:abort] end |
#firewall_frame ⇒ Object (protected)
107 108 109 110 111 112 |
# File 'src/lib/installation/dialogs/security.rb', line 107 def firewall_frame frame( _("Firewall and SSH service"), Y2Firewall::Widgets::FirewallSSHProposal.new(@settings) ) end |
#frame(label, widget) ⇒ Object (protected)
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'src/lib/installation/dialogs/security.rb', line 135 def frame(label, ) Left( Frame( label, MarginBox( 0.5, 0.5, HBox( , HStretch() ) ) ) ) end |
#hostname ⇒ String (protected)
Hostname of the current system.
Getting the hostname is sometimes a little bit slow, so the value is cached to be reused in every dialog redraw
95 96 97 |
# File 'src/lib/installation/dialogs/security.rb', line 95 def hostname @hostname ||= Yast::Hostname.CurrentHostname end |
#lsm_configurable? ⇒ Boolean (protected)
103 104 105 |
# File 'src/lib/installation/dialogs/security.rb', line 103 def lsm_configurable? @settings.lsm_config.configurable? end |
#lsm_frame ⇒ Object (protected)
128 129 130 131 132 133 |
# File 'src/lib/installation/dialogs/security.rb', line 128 def lsm_frame frame( _("Major Linux Security Module"), Widgets::LSM.new(@settings) ) end |
#next_button ⇒ Object
79 80 81 |
# File 'src/lib/installation/dialogs/security.rb', line 79 def Yast::Mode.installation ? Yast::Label.OKButton : Yast::Label.FinishButton end |
#polkit_frame ⇒ Object (protected)
114 115 116 117 118 119 |
# File 'src/lib/installation/dialogs/security.rb', line 114 def polkit_frame frame( _("PolicyKit"), Widgets::PolkitDefaultPriv.new(@settings) ) end |
#should_open_dialog? ⇒ Boolean (protected)
99 100 101 |
# File 'src/lib/installation/dialogs/security.rb', line 99 def should_open_dialog? true end |
#title ⇒ Object
39 40 41 |
# File 'src/lib/installation/dialogs/security.rb', line 39 def title _("Security Configuration") end |