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
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
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
|
# File '../../src/include/partitioning/ep-settings.rb', line 71
def CreateSettingsPanel(user_data)
user_data = deep_copy(user_data)
_PreselectVisibleFields = lambda do
hidden_fields = StorageSettings.GetHiddenFields
Builtins.maplist(Integer.Range(Builtins.size(@visible_fields))) do |i|
label = Ops.get_string(@visible_fields, [i, :label], "")
fields = Ops.get_list(@visible_fields, [i, :fields], [])
selected = !Builtins::Multiset.includes(hidden_fields, fields)
Item(Id(i), label, selected)
end
end
mount_by_items = Builtins.maplist(@mount_bys) do |item_id, label|
Item(Id(item_id), label)
end
filesystems = Builtins.filter(
[:ext2, :ext3, :ext4, :reiser, :xfs, :btrfs]
) do |fs|
FileSystems.IsSupported(fs) && !FileSystems.IsUnsupported(fs)
end
filesystem_items = Builtins.maplist(filesystems) do |fs|
Item(Id(fs), FileSystems.GetName(fs, "Error"))
end
partalign_items = Builtins.maplist([:align_optimal, :align_cylinder]) do |pal|
Item(Id(pal), Builtins.substring(Builtins.sformat("%1", pal), 7))
end
UI.ReplaceWidget(
:tree_panel,
Greasemonkey.Transform(
VBox(
term(:IconAndHeading, _("Settings"), StorageIcons.settings_icon),
VBox(
Left(
term(
:ComboBoxSelected,
Id(:default_mountby),
Opt(:notify),
_("Default Mount by"),
mount_by_items,
Id(Storage.GetDefaultMountBy)
)
),
Left(
term(
:ComboBoxSelected,
Id(:default_fs),
Opt(:notify),
_("Default File System"),
filesystem_items,
Id(Partitions.DefaultFs)
)
),
Left(
term(
:ComboBoxSelected,
Id(:part_align),
Opt(:notify),
_("Alignment of Newly Created Partitions"),
partalign_items,
Id(Storage.GetPartitionAlignment)
)
),
VSpacing(1),
Left(
term(
:ComboBoxSelected,
Id(:display_name),
Opt(:notify),
_("Show Storage Devices by"),
[
Item(Id(:device), _("Device Name")),
Item(Id(:id), _("Device ID")),
Item(Id(:path), _("Device Path"))
],
Id(StorageSettings.GetDisplayName)
)
),
Left(
HBox(
MultiSelectionBox(
Id(:visible_fields),
Opt(:shrinkable, :notify),
_("Visible Information on Storage Devices"),
_PreselectVisibleFields.call
),
HStretch()
)
)
),
VStretch()
)
)
)
helptext = _("<p>This view shows general storage\nsettings:</p>")
helptext = Ops.add(
helptext,
_(
"<p><b>Default Mount by</b> gives the mount by\n" +
"method for newly created file systems. <i>Device Name</i> uses the kernel\n" +
"device name, which is not persistent. <i>Device ID</i> and <i>Device Path</i>\n" +
"use names generated by udev from hardware information. These should be\n" +
"persistent but unfortunately this is not always true. Finally <i>UUID</i> and\n" +
"<i>Volume Label</i> use the file systems UUID and label.</p>\n"
)
)
helptext = Ops.add(
helptext,
_(
"<p><b>Default File System</b> gives the file\nsystem type for newly created file systems.</p>\n"
)
)
helptext = Ops.add(
helptext,
_(
"<p><b>Alignment of Newly Created Partitions</b>\n" +
"determines how created partitions are aligned. <b>cylinder</b> is the traditional alignment at cylinder boundaries of the disk. <b>optimal</b> aligns the \n" +
"partitions for best performance according to hints provided by the Linux \n" +
"kernel or tries to be compatible with Windows Vista and Win 7.</p>\n"
)
)
helptext = Ops.add(
helptext,
_(
"<p><b>Show Storage Devices by</b> controls\nthe name displayed for hard disks in the navigation tree.</p>"
)
)
helptext = Ops.add(
helptext,
_(
"<p><b>Visible Information On Storage\nDevices</b> allows to hide information in the tables and overview.</p>"
)
)
Wizard.RestoreHelp(helptext)
nil
end
|