Module: Yast::PartitioningEpRaidInclude
- Defined in:
- ../../src/include/partitioning/ep-raid.rb
Instance Method Summary (collapse)
- - (Object) CreateRaidDevicesTab(user_data)
- - (Object) CreateRaidMainPanel(user_data)
- - (Object) CreateRaidOverviewTab(user_data)
- - (Object) CreateRaidPanel(user_data)
- - (Object) EpContextMenuRaid(device)
- - (Object) HandleRaidButtons(device, event)
- - (Object) HandleRaidMainPanel(user_data, event)
- - (Object) HandleRaidOverviewTab(user_data, event)
- - (Object) HandleRaidPanel(user_data, event)
- - (Object) initialize_partitioning_ep_raid(include_target)
- - (Object) RaidButtonBox
Instance Method Details
- (Object) CreateRaidDevicesTab(user_data)
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File '../../src/include/partitioning/ep-raid.rb', line 227 def CreateRaidDevicesTab(user_data) user_data = deep_copy(user_data) part_device = Convert.to_string(user_data) _Predicate = lambda do |disk, partition| disk = deep_copy(disk) partition = deep_copy(partition) StorageFields.PredicateUsedByDevice(disk, partition, [part_device]) end fields = StorageSettings.FilterTable( [ :device, :udev_path, :udev_id, :size, :format, :encrypted, :type, :used_by ] ) target_map = Storage.GetTargetMap table_header = StorageFields.TableHeader(fields) table_contents = StorageFields.TableContents( fields, target_map, fun_ref(_Predicate, "symbol (map, map)") ) UI.ReplaceWidget( :tab_panel, VBox( Table( Id(:table), Opt(:keepSorting, :notify), table_header, table_contents ) ) ) # helptext helptext = _( "<p>This view shows all devices used by the\nselected RAID.</p>" ) Wizard.RestoreHelp(Ops.add(helptext, StorageFields.TableHelptext(fields))) nil end |
- (Object) CreateRaidMainPanel(user_data)
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File '../../src/include/partitioning/ep-raid.rb', line 83 def CreateRaidMainPanel(user_data) user_data = deep_copy(user_data) _Predicate = lambda do |disk, partition| disk = deep_copy(disk) partition = deep_copy(partition) StorageFields.PredicateDiskType(disk, partition, [:CT_MD]) end fields = StorageSettings.FilterTable( [ :device, :size, :format, :encrypted, :type, :fs_type, :label, :mount_point, :mount_by, :used_by, :raid_type, :chunk_size ] ) target_map = Storage.GetTargetMap table_header = StorageFields.TableHeader(fields) table_contents = StorageFields.TableContents( fields, target_map, fun_ref(_Predicate, "symbol (map, map)") ) UI.ReplaceWidget( :tree_panel, Greasemonkey.Transform( VBox( HStretch(), # heading term(:IconAndHeading, _("RAID"), StorageIcons.raid_icon), Table( Id(:table), Opt(:keepSorting, :notify, :notifyContextMenu), table_header, table_contents ), HBox( # push button text PushButton(Id(:add), Opt(:key_F3), _("Add RAID...")), RaidButtonBox(), HStretch() ) ) ) ) # helptext helptext = _("<p>This view shows all RAIDs except BIOS RAIDs.</p>") Wizard.RestoreHelp(Ops.add(helptext, StorageFields.TableHelptext(fields))) nil end |
- (Object) CreateRaidOverviewTab(user_data)
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File '../../src/include/partitioning/ep-raid.rb', line 167 def CreateRaidOverviewTab(user_data) user_data = deep_copy(user_data) part_device = Convert.to_string(user_data) target_map = Storage.GetTargetMap fields = StorageSettings.FilterOverview( [ :heading_device, :device, :size, :encrypted, :udev_id, :used_by, :heading_md, :raid_type, :chunk_size, :parity_algorithm, :heading_filesystem, :fs_type, :mount_point, :mount_by, :uuid, :label ] ) UI.ReplaceWidget( :tab_panel, VBox( HStretch(), StorageFields.Overview(fields, target_map, part_device), Left(RaidButtonBox()) ) ) # helptext helptext = _( "<p>This view shows detailed information about the\nselected RAID.</p>" ) Wizard.RestoreHelp( Ops.add(helptext, StorageFields.OverviewHelptext(fields)) ) nil end |
- (Object) CreateRaidPanel(user_data)
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File '../../src/include/partitioning/ep-raid.rb', line 282 def CreateRaidPanel(user_data) user_data = deep_copy(user_data) device = Convert.to_string(user_data) data = { :overview => { :create => fun_ref(method(:CreateRaidOverviewTab), "void (any)"), :handle => fun_ref( method(:HandleRaidOverviewTab), "void (any, map)" ), :user_data => user_data }, :devices => { :create => fun_ref(method(:CreateRaidDevicesTab), "void (any)"), :user_data => user_data } } UI.ReplaceWidget( :tree_panel, Greasemonkey.Transform( VBox( # heading term( :IconAndHeading, Builtins.sformat(_("RAID: %1"), device), StorageIcons.raid_icon ), DumbTab( Id(:tab), [ # push button text Item(Id(:overview), _("&Overview")), # push button text Item(Id(:devices), _("&Used Devices")) ], ReplacePoint(Id(:tab_panel), TabPanel.empty_panel) ) ) ) ) TabPanel.Init(data, :overview) nil end |
- (Object) EpContextMenuRaid(device)
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File '../../src/include/partitioning/ep-raid.rb', line 35 def EpContextMenuRaid(device) = ContextMenu.Simple( [ Item(Id(:edit), _("Edit")), Item(Id(:resize), _("Resize")), Item(Id(:delete), _("Delete")) ] ) case when :edit EpEditRaid(device) when :resize EpResizeRaid(device) when :delete EpDeleteRaid(device) end nil end |
- (Object) HandleRaidButtons(device, event)
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File '../../src/include/partitioning/ep-raid.rb', line 67 def HandleRaidButtons(device, event) event = deep_copy(event) case Event.IsWidgetActivated(event) when :add EpCreateRaid() when :edit EpEditRaid(device) when :resize EpResizeRaid(device) when :delete EpDeleteRaid(device) end nil end |
- (Object) HandleRaidMainPanel(user_data, event)
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File '../../src/include/partitioning/ep-raid.rb', line 149 def HandleRaidMainPanel(user_data, event) user_data = deep_copy(user_data) event = deep_copy(event) device = Convert.to_string(UI.QueryWidget(Id(:table), :CurrentItem)) HandleRaidButtons(device, event) case Event.IsWidgetContextMenuActivated(event) when :table EpContextMenuDevice(device) end UI.SetFocus(Id(:table)) nil end |
- (Object) HandleRaidOverviewTab(user_data, event)
216 217 218 219 220 221 222 223 224 |
# File '../../src/include/partitioning/ep-raid.rb', line 216 def HandleRaidOverviewTab(user_data, event) user_data = deep_copy(user_data) event = deep_copy(event) HandleRaidButtons(Convert.to_string(user_data), event) UI.SetFocus(Id(:text)) nil end |
- (Object) HandleRaidPanel(user_data, event)
331 332 333 334 335 336 337 |
# File '../../src/include/partitioning/ep-raid.rb', line 331 def HandleRaidPanel(user_data, event) user_data = deep_copy(user_data) event = deep_copy(event) TabPanel.Handle(event) nil end |
- (Object) initialize_partitioning_ep_raid(include_target)
28 29 30 31 32 33 |
# File '../../src/include/partitioning/ep-raid.rb', line 28 def initialize_partitioning_ep_raid(include_target) textdomain "storage" Yast.include include_target, "partitioning/ep-raid-dialogs.rb" Yast.include include_target, "partitioning/ep-raid-lib.rb" end |
- (Object) RaidButtonBox
56 57 58 59 60 61 62 63 64 65 |
# File '../../src/include/partitioning/ep-raid.rb', line 56 def RaidButtonBox HBox( # push button text PushButton(Id(:edit), Opt(:key_F4), _("Edit...")), # push button text PushButton(Id(:resize), Opt(:key_F6), _("Resize...")), # push button text PushButton(Id(:delete), Opt(:key_F5), _("Delete...")) ) end |