Module: Yast::PartitioningEpLoopLibInclude

Defined in:
../../src/include/partitioning/ep-loop-lib.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) EpCreateLoop



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File '../../src/include/partitioning/ep-loop-lib.rb', line 32

def EpCreateLoop
  data = { "new" => true, "create" => true }

  Ops.set(data, "type", :loop)
  Ops.set(data, "format", true)

  if (
      data_ref = arg_ref(data);
      _DlgCreateLoop_result = DlgCreateLoop(data_ref);
      data = data_ref.value;
      _DlgCreateLoop_result
    )
    device = Storage.CreateLoop(
      Ops.get_string(data, "fpath", ""),
      Ops.get_boolean(data, "create_file", false),
      Ops.get_integer(data, "size_k", 0),
      Ops.get_string(data, "mount", "")
    )
    Ops.set(data, "device", device)

    Storage.ChangeVolumeProperties(data)

    UpdateMainStatus()
    UpdateNavigationTree(nil)
    TreePanel.Create
    UpdateTableFocus(device)
  end

  nil
end

- (Object) EpDeleteLoop(device)



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File '../../src/include/partitioning/ep-loop-lib.rb', line 104

def EpDeleteLoop(device)
  if device == nil
    # error popup
    Popup.Error(_("No crypt file selected."))
    return
  end

  if EpDeleteDevice(device)
    UpdateMainStatus()
    UpdateNavigationTree(:loop)
    TreePanel.Create
  end

  nil
end

- (Object) EpEditLoop(device)



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File '../../src/include/partitioning/ep-loop-lib.rb', line 64

def EpEditLoop(device)
  if device == nil
    Popup.Error(_("No crypt file selected."))
    return
  end

  target_map = Storage.GetTargetMap
  data = Storage.GetPartition(target_map, device)

  if Storage.IsUsedBy(data)
    # error popup, %1 is replaced by device name
    Popup.Error(
      Builtins.sformat(
        _(
          "The Crypt File %1 is in use. It cannot be\nedited. To edit %1, make sure it is not used."
        ),
        device
      )
    )
    return
  end

  if (
      data_ref = arg_ref(data);
      _DlgEditLoop_result = DlgEditLoop(data_ref);
      data = data_ref.value;
      _DlgEditLoop_result
    )
    Storage.ChangeVolumeProperties(data)

    UpdateMainStatus()
    UpdateNavigationTree(nil)
    TreePanel.Create
    UpdateTableFocus(device)
  end

  nil
end

- (Object) initialize_partitioning_ep_loop_lib(include_target)



28
29
30
# File '../../src/include/partitioning/ep-loop-lib.rb', line 28

def initialize_partitioning_ep_loop_lib(include_target)
  textdomain "storage"
end