1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
from gtk import *
from iw import *
from thread import *
import gettext
cat = gettext.Catalog ("anaconda", "/usr/share/locale")
_ = cat.gettext
FSEDIT_CLEAR_LINUX = (1 << 0)
FSEDIT_CLEAR_ALL = (1 << 2)
FSEDIT_USE_EXISTING = (1 << 3)
class AutoPartitionWindow (InstallWindow):
def __init__ (self, ics):
InstallWindow.__init__ (self, ics)
self.todo = ics.getToDo ()
ics.setTitle (_("Auto partition"))
ics.setNextEnabled (TRUE)
def getNext (self):
attempt = [
( "/boot", 16, 0x83, 0, -1 ),
( "/", 256, 0x83, 0, -1 ),
( "/usr", 512, 0x83, 1, -1 ),
( "/var", 256, 0x83, 0, -1 ),
( "/home", 512, 0x83, 1, -1 ),
( "Swap-auto", 64, 0x82, 0, -1 ),
]
ret = self.todo.ddruid.attempt (attempt, _("Workstation"), self.type)
return None
def typeSelected (self, button, data):
self.type = data
def getScreen (self):
box = GtkVBox (FALSE)
group = GtkRadioButton (None, _("Remove all data"))
group.connect ("clicked", self.typeSelected, FSEDIT_CLEAR_ALL)
box.pack_start (group, FALSE)
item = GtkRadioButton (group, _("Remove Linux partitions"))
item.connect ("clicked", self.typeSelected, FSEDIT_CLEAR_LINUX)
box.pack_start (item, FALSE)
item = GtkRadioButton (group, _("Use existing free space"))
item.connect ("clicked", self.typeSelected, FSEDIT_USE_EXISTING)
box.pack_start (item, FALSE)
item.set_active (TRUE)
return box
|