Yast UI
YPartitionSplitter Class Reference

Hard disk partition splitter tool (optional widget) More...

Detailed Description

Hard disk partition splitter tool (optional widget)

Following widget variants exist: PartitionSplitter

Example:

# encoding: utf-8
module Yast
class PartitionSplitter1Client < Client
def main
Yast.import "UI"
if !UI.HasSpecialWidget(:PartitionSplitter)
UI.OpenDialog(
VBox(
Label(
"Error: This UI doesn't support the PartitionSplitter widget!"
),
PushButton(Opt(:default), "&OK")
)
)
UI.UserInput
UI.CloseDialog
return
end
@unit = "MB"
@win_used = 350
@total_free = 1500
@min_free = 50
@linux_min = 300
@linux_size = 800
UI.OpenDialog(
VBox(
HSpacing(60), # wider default size
PartitionSplitter(
@win_used,
@total_free,
@linux_size,
@linux_min,
@min_free,
Ops.add("Windows\nused\n%1 ", @unit),
Ops.add("Windows\nfree\n%1 ", @unit),
Ops.add("Linux\n%1 ", @unit),
Ops.add(Ops.add("Windows free (", @unit), ")"),
Ops.add(Ops.add("Linux (", @unit), ")")
),
PushButton(Opt(:default), "&OK")
)
)
UI.UserInput
UI.CloseDialog
nil
end
end
end
Yast::PartitionSplitter1Client.new.main

Example:

# encoding: utf-8
module Yast
class PartitionSplitter2Client < Client
def main
Yast.import "UI"
if !UI.HasSpecialWidget(:Slider) || !UI.HasSpecialWidget(:BarGraph)
UI.OpenDialog(
VBox(
Label(
"Error: This UI doesn't support the required special widgets!"
),
PushButton(Opt(:default), "&OK")
)
)
UI.UserInput
UI.CloseDialog
return
end
@unit = "MB"
@win_used = 350
@total_free = 1500
@min_free = 50
@linux_min = 300
@linux_size = 800
UI.OpenDialog(
VBox(
HSpacing(60), # wider default size
Left(Label("Now:")),
BarGraph(
Opt(:vstretch),
[@win_used, @total_free],
[
Ops.add("Windows\nused\n%1 ", @unit),
Ops.add("Windows\nfree\n%1 ", @unit)
]
),
VSpacing(1),
Left(Label("After installation:")),
PartitionSplitter(
@win_used,
@total_free,
@linux_size,
@linux_min,
@min_free,
Ops.add("Windows\nused\n%1 ", @unit),
Ops.add("Windows\nfree\n%1 ", @unit),
Ops.add("Linux\n%1 ", @unit),
Ops.add(Ops.add("Windows free (", @unit), ")"),
Ops.add(Ops.add("Linux (", @unit), ")")
),
PushButton(Opt(:default), "&OK")
)
)
UI.UserInput
UI.CloseDialog
nil
end
end
end
Yast::PartitionSplitter2Client.new.main

A very specialized widget to allow a user to comfortably split an existing hard disk partition in two parts. Shows a bar graph that displays the used space of the partition, the remaining free space (before the split) of the partition and the space of the new partition (as suggested). Below the bar graph is a slider with an input fields to the left and right where the user can either input the desired remaining free space or the desired size of the new partition or drag the slider to do this.

The total size is usedSize+freeSize.

The user can resize the new partition between minNewPartSize and totalFreeSize-minFreeSize.

Note
This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with HasSpecialWidget( :PartitionSplitter ) before using it.

The documentation for this class was generated from the following file: