summaryrefslogtreecommitdiffstats
path: root/iw/dependencies.py
blob: 62e2d119fa73288291fbeb3a435aa5c74cb48e43 (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
from iw import *
from gtk import *
from gui import _

class UnresolvedDependenciesWindow (InstallWindow):

    def __init__ (self, ics):
	InstallWindow.__init__ (self, ics)
        ics.setTitle (_("Unresolved Dependencies"))
        ics.setNextEnabled (1)
        ics.readHTML ("depend")
        self.dependCB = None

    def getNext (self):
        if self.dependCB and self.dependCB.get_active ():
            self.todo.selectDeps (self.deps)
        return None
    
    def getScreen (self):
	threads_leave ()
        self.deps = self.todo.verifyDeps ()
	threads_enter ()
        if not self.deps:
            return None

        sw = GtkScrolledWindow ()
        sw.set_border_width (5)
        sw.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC)

        list = GtkCList (2, (_("Package"), _("Requirement")))
        list.freeze ()
        for (name, suggest) in self.deps:
            list.append ((name, suggest))
	list.columns_autosize ()
        list.thaw ()
        sw.add (list)

        self.dependCB = GtkCheckButton (_("Install packages to satisfy dependencies"))
        self.dependCB.set_active (TRUE)
        align = GtkAlignment (0.5, 0.5)
        align.add (self.dependCB)

        box = GtkVBox (FALSE, 5)
        box.pack_start (sw, TRUE)
        box.pack_start (align, FALSE)

        return box