summaryrefslogtreecommitdiffstats
path: root/iw/rootpartition.py
blob: 0ae3fb3f38430d3a0196fed29473a33bdd4f8e7c (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from gtk import *
from iw import *
from thread import *
import isys
import gettext

cat = gettext.Catalog ("anaconda", "/usr/share/locale")
_ = cat.gettext

class ConfirmPartitionWindow (InstallWindow):
    def __init__ (self, ics):
	InstallWindow.__init__ (self, ics)

        self.todo = ics.getToDo ()
        ics.setTitle (_("Confirm Partitioning Selection"))
        ics.setHTML ("<HTML><BODY>Select a root partition"
                     "</BODY></HTML>")
	ics.setNextEnabled (TRUE)
        
    def getScreen (self):
        return self.window

    def getPrev (self):
        return PartitionWindow

class PartitionWindow (InstallWindow):
    def __init__ (self, ics):
	InstallWindow.__init__ (self, ics)

        self.todo = ics.getToDo ()
        ics.setTitle (_("Root Partition Selection"))
        ics.setHTML ("<HTML><BODY>Select a root partition"
                     "</BODY></HTML>")
	ics.setNextEnabled (TRUE)
        from gnomepyfsedit import fsedit

        if not self.todo.ddruid:
            drives = self.todo.drives.available ().keys ()
            drives.sort ()
            self.todo.ddruid = \
                fsedit(1, drives, [])
            self.todo.ddruid.setCallback (self.enableCallback, self)


    def getNext (self):
        print "calling self.ddruid.next ()"
        self.todo.ddruid.next ()
        print "done calling self.ddruid.next ()"
        
        win = self.todo.ddruid.getConfirm ()
        if win:
            print "confirm"
            bin = GtkFrame (None, _obj = win)
            bin.set_shadow_type (SHADOW_NONE)
            window = ConfirmPartitionWindow
            window.window = bin
            return window

        fstab = self.todo.ddruid.getFstab ()
        for (partition, mount, fsystem, size) in fstab:
            self.todo.addMount(partition, mount, fsystem)

        return None

    def enableCallback (self, value):
        self.ics.setNextEnabled (value)

    def getScreen (self):   
        self.bin = GtkFrame (None, _obj = self.todo.ddruid.getWindow ())
        self.bin.set_shadow_type (SHADOW_NONE)
        self.todo.ddruid.edit ()
        
        return self.bin