Module: Yast::PartitioningEpRaidDialogsInclude

Defined in:
../../src/include/partitioning/ep-raid-dialogs.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) CheckNumberOfDevicesForRaid(raid_type, num)



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 46

def CheckNumberOfDevicesForRaid(raid_type, num)
  min_num = MinimalNumberOfDevicesForRaid(raid_type)

  if Ops.less_than(num, min_num)
    info = {
      "raid0"     => "RAID0",
      "raid1"     => "RAID1",
      "raid5"     => "RAID5",
      "raid6"     => "RAID6",
      "raid10"    => "RAID10",
      "multipath" => "Multipath RAID"
    }
    # error popup, %1 is replaced by raid type e.g. "RAID1", %2 is replaced by integer
    Popup.Error(
      Builtins.sformat(
        _("For %1, select at least %2 device."),
        Ops.get(info, raid_type, "error"),
        min_num
      )
    )
    UI.SetFocus(Id(:unselected))
    return false
  else
    return true
  end
end

- (Object) DefaultChunkSizeK(raid_type)



74
75
76
77
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 74

def DefaultChunkSizeK(raid_type)
  info = { "raid0" => 32, "raid5" => 128, "raid6" => 128, "raid10" => 32 }
  Ops.get(info, raid_type, 4)
end

- (Object) DlgCreateRaidNew(data)



578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 578

def DlgCreateRaidNew(data)
  aliases = {
    "TypeDevices" => lambda do
      (
        data_ref = arg_ref(data.value);
        _MiniWorkflowStepRaidTypeDevices_result = MiniWorkflowStepRaidTypeDevices(
          data_ref
        );
        data.value = data_ref.value;
        _MiniWorkflowStepRaidTypeDevices_result
      )
    end,
    "Options"     => lambda do
      (
        data_ref = arg_ref(data.value);
        _MiniWorkflowStepRaidOptions_result = MiniWorkflowStepRaidOptions(
          data_ref
        );
        data.value = data_ref.value;
        _MiniWorkflowStepRaidOptions_result
      )
    end,
    "Role"        => lambda do
      (
        data_ref = arg_ref(data.value);
        _MiniWorkflowStepRole_result = MiniWorkflowStepRole(
          data_ref
        );
        data.value = data_ref.value;
        _MiniWorkflowStepRole_result
      )
    end,
    "FormatMount" => lambda do
      (
        data_ref = arg_ref(data.value);
        _MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
          data_ref
        );
        data.value = data_ref.value;
        _MiniWorkflowStepFormatMount_result
      )
    end,
    "Password"    => lambda do
      (
        data_ref = arg_ref(data.value);
        _MiniWorkflowStepPassword_result = MiniWorkflowStepPassword(
          data_ref
        );
        data.value = data_ref.value;
        _MiniWorkflowStepPassword_result
      )
    end
  }

  sequence = {
    "TypeDevices" => { :next => "Options" },
    "Options"     => { :next => "Role" },
    "Role"        => { :next => "FormatMount" },
    "FormatMount" => { :next => "Password", :finish => :finish },
    "Password"    => { :finish => :finish }
  }

  # dialog title
  title = Builtins.sformat(
    _("Add RAID %1"),
    Ops.get_string(data.value, "device", "error")
  )

  widget = MiniWorkflow.Run(
    title,
    StorageIcons.raid_icon,
    aliases,
    sequence,
    "TypeDevices"
  )

  widget == :finish
end

- (Object) DlgEditRaid(data)



692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 692

def DlgEditRaid(data)
  device = Ops.get_string(data.value, "device", "error")

  aliases = {
    "FormatMount" => lambda do
    (
      data_ref = arg_ref(data.value);
      _MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
        data_ref
      );
      data.value = data_ref.value;
      _MiniWorkflowStepFormatMount_result
    )
    end,
    "Password" => lambda do
    (
      data_ref = arg_ref(data.value);
      _MiniWorkflowStepPassword_result = MiniWorkflowStepPassword(data_ref);
      data.value = data_ref.value;
      _MiniWorkflowStepPassword_result
    )
    end
  }

  sequence = {
    "FormatMount" => { :next => "Password", :finish => :finish },
    "Password"    => { :finish => :finish }
  }

  # dialog title
  title = Builtins.sformat(_("Edit RAID %1"), device)

  widget = MiniWorkflow.Run(
    title,
    StorageIcons.raid_icon,
    aliases,
    sequence,
    "FormatMount"
  )

  widget == :finish
end

- (Object) DlgResizeRaid(data)



658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 658

def DlgResizeRaid(data)
  aliases = {
    "TheOne" => lambda do
    (
      data_ref = arg_ref(data.value);
      _MiniWorkflowStepResizeRaid_result = MiniWorkflowStepResizeRaid(
        data_ref
      );
      data.value = data_ref.value;
      _MiniWorkflowStepResizeRaid_result
    )
    end
  }

  sequence = { "TheOne" => { :finish => :finish } }

  # dialog title
  title = Builtins.sformat(
    _("Resize RAID %1"),
    Ops.get_string(data.value, "device", "error")
  )

  widget = MiniWorkflow.Run(
    title,
    StorageIcons.raid_icon,
    aliases,
    sequence,
    "TheOne"
  )

  widget == :finish
end

- (Object) getParTerms(mdtype, sz)



371
372
373
374
375
376
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 371

def getParTerms(mdtype, sz)
  pars = Storage.AllowedParity(mdtype, sz)
  Builtins.maplist(pars) do |e|
    Item(Id(Ops.get_symbol(e, 0, :par_default)), Ops.get_string(e, 1, ""))
  end
end

- (Object) initialize_partitioning_ep_raid_dialogs(include_target)



29
30
31
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 29

def initialize_partitioning_ep_raid_dialogs(include_target)
  textdomain "storage"
end

- (Object) MinimalNumberOfDevicesForRaid(raid_type)



33
34
35
36
37
38
39
40
41
42
43
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 33

def MinimalNumberOfDevicesForRaid(raid_type)
  info = {
    "raid0"     => 2,
    "raid1"     => 2,
    "raid5"     => 3,
    "raid6"     => 4,
    "raid10"    => 2,
    "multipath" => 2
  }
  Ops.get(info, raid_type, 0)
end

- (Object) MiniWorkflowStepRaidOptions(data)



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 378

def MiniWorkflowStepRaidOptions(data)
  Builtins.y2milestone("MiniWorkflowStepRaidOptions data:%1", data.value)

  raid_type = Ops.get_string(data.value, "raid_type", "error")
  chunk_size = Ops.multiply(
    Ops.get_integer(data.value, "chunk_size_k") do
      DefaultChunkSizeK(raid_type)
    end,
    1024
  )
  parity_algorithm = Ops.get_symbol(
    data.value,
    "parity_algorithm",
    :par_default
  )

  chunk_sizes_list = Builtins.maplist(Integer.RangeFrom(11, 22)) do |i|
    Item(
      Id(Ops.shift_left(2, i)),
      Storage.ByteToHumanStringOmitZeroes(Ops.shift_left(2, i))
    )
  end

  options = VBox(
    Left(
      term(
        :ComboBoxSelected,
        Id(:chunk_size),
        _("Chunk Size"),
        chunk_sizes_list,
        Id(chunk_size)
      )
    )
  )

  par_list = getParTerms(
    raid_type,
    Builtins.size(Ops.get_list(data.value, "devices", []))
  )

  if Ops.greater_than(Builtins.size(par_list), 0)
    options = Builtins.add(
      options,
      Left(
        term(
          :ComboBoxSelected,
          Id(:parity_algorithm),
          Opt(:hstretch),
          # combo box label
          _("Parity &Algorithm"),
          par_list,
          Id(parity_algorithm)
        )
      )
    )
  end

  # heading
  contents = HVSquash(term(:FrameWithMarginBox, _("RAID Options"), options))

  MiniWorkflow.SetContents(
    Greasemonkey.Transform(contents),
    (
      data_ref = arg_ref(data.value);
      _MiniWorkflowStepRaidOptionsHelptext_result = MiniWorkflowStepRaidOptionsHelptext(
        data_ref
      );
      data.value = data_ref.value;
      _MiniWorkflowStepRaidOptionsHelptext_result
    )
  )
  MiniWorkflow.SetLastStep(false)

  widget = nil
  begin
    widget = MiniWorkflow.UserInput
  end until widget == :abort || widget == :back || widget == :next

  if widget == :next
    chunk_size = Convert.to_integer(UI.QueryWidget(Id(:chunk_size), :Value))

    if UI.WidgetExists(Id(:parity_algorithm))
      parity_algorithm = Convert.to_symbol(
        UI.QueryWidget(Id(:parity_algorithm), :Value)
      )
    end

    Ops.set(data.value, "chunk_size_k", Ops.divide(chunk_size, 1024))
    Ops.set(data.value, "parity_algorithm", parity_algorithm)
  end

  Builtins.y2milestone(
    "MiniWorkflowStepRaidOptions data:%1 ret:%2",
    data.value,
    widget
  )

  widget
end

- (Object) MiniWorkflowStepRaidOptionsHelptext(data)



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 334

def MiniWorkflowStepRaidOptionsHelptext(data)
  raid_type = Ops.get_string(data.value, "raid_type", "error")

  # helptext
  helptext = _(
    "<p><b>Chunk Size:</b><br>It is the smallest \"atomic\" mass\n" +
      "of data that can be written to the devices. A reasonable chunk size for RAID 5 is 128 kB. For RAID 0,\n" +
      "32 kB is a good starting point. For RAID 1, the chunk size does not affect the array very much.</p>\n"
  )

  if Builtins.contains(["raid5", "raid6", "raid10"], raid_type)
    helptext = Ops.add(helptext, "<p><b>")
    helptext = Ops.add(helptext, _("Parity Algorithm:"))
    helptext = Ops.add(helptext, "</b><br>")

    if raid_type == "raid5" || raid_type == "raid6"
      # helptext
      helptext = Ops.add(
        helptext,
        _(
          "The parity algorithm to use with RAID5/6.\nLeft-symmetric is the one that offers maximum performance on typical disks with rotating platters.\n"
        )
      )
    elsif raid_type == "raid10"
      # helptext
      helptext = Ops.add(
        helptext,
        _(
          "For further details regarding the parity \nalgorithm please look at the man page for mdadm (man mdadm).\n"
        )
      )
    end
    helptext = Ops.add(helptext, "</p>")
  end
  helptext
end

- (Object) MiniWorkflowStepRaidTypeDevices(data)



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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
214
215
216
217
218
219
220
221
222
223
224
225
226
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
280
281
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
329
330
331
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 145

def MiniWorkflowStepRaidTypeDevices(data)
  Builtins.y2milestone(
    "MiniWorkflowStepRaidTypeDevices data:%1",
    data.value
  )

  raid_type = Ops.get_string(data.value, "raid_type", "raid0")
  device = Ops.get_string(data.value, "device", "error")
  devices = Ops.get_list(data.value, "devices", [])

  callback = lambda do |devices2|
    devices2 = deep_copy(devices2)
    sizeK = 0
    sizeK_ref = arg_ref(sizeK)
    Storage.ComputeMdSize(
      Builtins.tosymbol(raid_type),
      Builtins.maplist(devices2) do |device2|
        Ops.get_string(device2, "device", "")
      end,
      sizeK_ref
    )
    sizeK = sizeK_ref.value
    sizeK
  end

  fields = StorageSettings.FilterTable(
    [:device, :udev_path, :udev_id, :size, :encrypted, :type]
  )

  target_map = Storage.GetTargetMap
  unused_devices = Builtins.filter(get_possible_rds(target_map)) do |dev|
    !Storage.IsUsedBy(dev) &&
      !Builtins.contains(devices, Ops.get_string(dev, "device", ""))
  end
  used_devices = Builtins.filter(get_possible_rds(target_map)) do |dev|
    !Storage.IsUsedBy(dev) &&
      Builtins.contains(devices, Ops.get_string(dev, "device", ""))
  end

  contents = VBox(
    Left(
      # heading
      HVSquash(
 HBox(
   term(
		:FrameWithMarginBox,
		_("RAID Type"),
		RadioButtonGroup(
Id(:raid_type),
VBox(
  # Translators, 'Striping' is a technical term here. Translate only if
  # you are sure!! If in doubt, leave it in English.
  term(
    :LeftRadioButton,
    Id(:raid0),
    Opt(:notify),
    _("RAID &0  (Striping)"),
    raid_type == "raid0"
  ),
  # Translators, 'Mirroring' is a technical term here. Translate only if
  # you are sure!! If in doubt, leave it in English.
  term(
    :LeftRadioButton,
    Id(:raid1),
    Opt(:notify),
    _("RAID &1  (Mirroring)"),
    raid_type == "raid1"
  ),
  # Translators, 'Redundant Striping' is a technical term here. Translate
  # only if you are sure!! If in doubt, leave it in English.
  term(
    :LeftRadioButton,
    Id(:raid5),
    Opt(:notify),
    _("RAID &5  (Redundant Striping)"),
    raid_type == "raid5"
  ),
  # Translators, 'Redundant Striping' is a technical term here. Translate only if
  # you are sure!! If in doubt, leave it in English.
  term(
    :LeftRadioButton,
    Id(:raid6),
    Opt(:notify),
    _("RAID &6  (Dual Redundant Striping)"),
    raid_type == "raid6"
  ),
  # Translators, 'Mirroring' and 'Striping' are technical terms here. Translate only if
  # you are sure!! If in doubt, leave it in English.
  term(
    :LeftRadioButton,
    Id(:raid10),
    Opt(:notify),
    _("RAID &10  (Mirroring and Striping)"),
    raid_type == "raid10"
  )
)
		)
   ),
   HSpacing(1),
   Top(
		TextEntry(
Id(:raid_name),
# label text
_("Raid &Name (optional)")
		)
   )
        )
      )
    )
  )

  contents = Builtins.add(contents, VSpacing(1))
  contents = Builtins.add(
    contents,
    DevicesSelectionBox.Create(
      unused_devices,
      used_devices,
      fields,
      fun_ref(callback, "integer (list <map>)"),
      # label for selection box
      _("Available Devices:"),
      # label for selection box
      _("Selected Devices:"),
      true
    )
  )

  MiniWorkflow.SetContents(
    Greasemonkey.Transform(contents),
    MiniWorkflowStepRaidTypeDevicesHelptext()
  )
  MiniWorkflow.SetLastStep(false)

  UI.ChangeWidget(Id(:raid_name), :ValidChars, Builtins.deletechars(String.CGraph, "'\""))

  widget = nil
  begin
    widget = MiniWorkflow.UserInput
    DevicesSelectionBox.Handle(widget)

    case widget
      when :raid0, :raid1, :raid10, :raid5, :raid6
        raid_type = Builtins.substring(
          Builtins.tostring(
            Convert.to_symbol(UI.QueryWidget(Id(:raid_type), :Value))
          ),
          1
        )
        DevicesSelectionBox.UpdateSelectedSize
      when :next
        devices = Builtins.maplist(DevicesSelectionBox.GetSelectedDevices) do |device2|
          Ops.get_string(device2, "device", "")
        end

        if !CheckNumberOfDevicesForRaid(raid_type, Builtins.size(devices))
          widget = :again
        end
    end
  end until widget == :abort || widget == :back || widget == :next

  if widget == :next
    rname = UI.QueryWidget(Id(:raid_name), :Value)
	if !rname.empty?
	  data.value["device"] = "/dev/md/"+rname
	else
	  data.value["device"] = "/dev/md"+data.value.fetch("nr",0).to_s
	end
    data.value["raid_type"] = raid_type
    data.value["devices"] = devices

    size_k = 0
    size_k_ref = arg_ref(size_k)
    Storage.ComputeMdSize(Builtins.tosymbol(raid_type), devices, size_k_ref)
    size_k = size_k_ref.value
    Ops.set(data.value, "size_k", size_k)

    Ops.set(data.value, "using_devices", devices)
  end

  Builtins.y2milestone(
    "MiniWorkflowStepRaidTypeDevices data:%1 ret:%2",
    data.value,
    widget
  )

  widget
end

- (Object) MiniWorkflowStepRaidTypeDevicesHelptext



80
81
82
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
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 80

def MiniWorkflowStepRaidTypeDevicesHelptext
  # helptext
  helptext = _("<p>Select the RAID type for the new RAID.</p>")

  # helptext
  helptext = Ops.add(
    helptext,
    _(
      "<p><b>RAID 0:</b> This level increases your disk performance.\nThere is <b>NO</b> redundancy in this mode. If one of the drives crashes, data recovery will not be possible.</p>\n"
    )
  )

  # helptext
  helptext = Ops.add(
    helptext,
    _(
      "<p><b>RAID 1:</b> <br>This mode has the best redundancy. It can be\n" +
        "used with two or more disks. This mode maintains an exact copy of all data on all\n" +
        "disks. As long as at least one disk is still working, no data is lost. The partitions\n" +
        "used for this type of RAID should have approximately the same size.</p>\n"
    )
  )

  # helptext
  helptext = Ops.add(
    helptext,
    _(
      "<p><b>RAID 5:</b> <br>This mode combines management of a larger number\n" +
        "of disks and still maintains some redundancy. This mode can be used on three disks or more.\n" +
        "If one disk fails, all data is still intact. If two disks fail simultaneously, all data is lost</p>\n"
    )
  )

  # helptext
  helptext = Ops.add(
    helptext,
    _(
      "<p><b>Raid Name</b> gives you the possibility to provide a meaningful\n" +
        "name for the raid. This is optional. If name is provided, the device is\n" +
 "available as <tt>/dev/md/&lt;name&gt;</tt>.</p>\n"
    )
  )

  # helptext
  helptext = Ops.add(
    helptext,
    _(
      "<p>Add partitions to your RAID. According to\n" +
        "the RAID type, the usable disk size is the sum of these partitions (RAID0), the size\n" +
        "of the smallest partition (RAID 1), or (N-1)*smallest partition (RAID 5).</p>\n"
    )
  )

  # helptext
  helptext = Ops.add(
    helptext,
    _(
      "<p>Generally, the partitions should be on different drives,\nto get the redundancy and performance you want.</p>\n"
    )
  )

  helptext
end

- (Object) MiniWorkflowStepResizeHelptext



479
480
481
482
483
484
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 479

def MiniWorkflowStepResizeHelptext
  # helptext
  helptext = _("<p>Change the devices that are used for the RAID.</p>")

  helptext
end

- (Object) MiniWorkflowStepResizeRaid(data)



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
# File '../../src/include/partitioning/ep-raid-dialogs.rb', line 487

def MiniWorkflowStepResizeRaid(data)
  Builtins.y2milestone("MiniWorkflowStepResizeRaid data:%1", data.value)

  device = Ops.get_string(data.value, "device", "error")
  raid_type = Ops.get_string(data.value, "raid_type", "error")
  devices_new = []

  callback = lambda do |devices|
    devices = deep_copy(devices)
    sizeK = 0
    sizeK_ref = arg_ref(sizeK)
    Storage.ComputeMdSize(
      Builtins.tosymbol(raid_type),
      Builtins.maplist(devices) do |device2|
        Ops.get_string(device2, "device", "")
      end,
      sizeK_ref
    )
    sizeK = sizeK_ref.value
    sizeK
  end

  fields = StorageSettings.FilterTable(
    [:device, :udev_path, :udev_id, :size, :encrypted, :type]
  )

  target_map = Storage.GetTargetMap
  unused_devices = Builtins.filter(get_possible_rds(target_map)) do |dev|
    Ops.get_string(dev, "used_by_device", "") == ""
  end
  used_devices = Builtins.filter(get_possible_rds(target_map)) do |dev|
    Ops.get_string(dev, "used_by_device", "") == device
  end

  contents = VBox()

  contents = Builtins.add(
    contents,
    DevicesSelectionBox.Create(
      unused_devices,
      used_devices,
      fields,
      fun_ref(callback, "integer (list <map>)"),
      _("Available Devices:"),
      _("Selected Devices:"),
      true
    )
  )

  MiniWorkflow.SetContents(
    Greasemonkey.Transform(contents),
    MiniWorkflowStepResizeHelptext()
  )
  MiniWorkflow.SetLastStep(true)

  widget = nil
  begin
    widget = MiniWorkflow.UserInput
    DevicesSelectionBox.Handle(widget)

    case widget
      when :next
        devices_new = Builtins.maplist(
          DevicesSelectionBox.GetSelectedDevices
        ) { |device2| Ops.get_string(device2, "device", "") }

        if !CheckNumberOfDevicesForRaid(
            raid_type,
            Builtins.size(devices_new)
          )
          widget = :again
        end
    end
  end until widget == :abort || widget == :back || widget == :next

  if widget == :next
    Ops.set(data.value, "devices_new", devices_new)

    widget = :finish
  end

  Builtins.y2milestone(
    "MiniWorkflowStepResizeRaid data:%1 ret:%2",
    data.value,
    widget
  )

  widget
end