Module rhn_register_firstboot_gui_window
|
|
1 import functions
2 import os
3 import gtk
4
5 from firstboot_module_window import FirstbootModuleWindow
6
7 from up2date_client import messageWindow
8 from up2date_client import rhnregGui
9
11 """This is a base class for our firstboot screens. It shouldn't be used
12 directly.
13
14 """
15 needsparent = 1
16
18 FirstbootModuleWindow.__init__(self)
19 self.doDebug = False
20
21 assert hasattr(self, 'runPriority')
22 assert hasattr(self, 'moduleName')
23 assert hasattr(self, 'windowTitle')
24 assert hasattr(self, 'shortMessage')
25 assert hasattr(self, 'needsparent')
26
27 assert hasattr(self, '_getVbox')
28
31
34
35 - def launch(self, doDebug=None):
36 """Firstboot calls this to set up the screen. It will use the _getVbox
37 method provided by the derived classes to get the contents of the
38 screen.
39
40 """
41 self.doDebug = doDebug
42 if self.doDebug:
43 print(self.__class__.__name__, "launch called.")
44
45 self.icon = functions.imageFromPath("/usr/share/system-config-display/pixmaps/system-config-display.png")
46 self.mainVBox = gtk.VBox()
47
48 internalVBox = gtk.VBox(False, 10)
49 internalVBox.set_border_width(10)
50
51 vbox = self._getVbox()
52
53 internalVBox.pack_start(vbox, True)
54 self.mainVBox.pack_start(internalVBox, True)
55
56
57
58
59
60
61 def mySetBusyCursor():
62 cursor = gtk.gdk.Cursor(gtk.gdk.WATCH)
63
64
65
66
67
68
69 self.parent.win.window.set_cursor(cursor)
70 while gtk.events_pending():
71 gtk.main_iteration(False)
72 def mySetArrowCursor():
73
74
75
76
77 self.parent.win.window.set_cursor(None)
78 while gtk.events_pending():
79 gtk.main_iteration(False)
80 rhnregGui.setBusyCursor = mySetBusyCursor
81 rhnregGui.setArrowCursor = mySetArrowCursor
82
83 return self.mainVBox, self.icon, self.windowTitle
84
86 if self.doDebug:
87 print(self.__class__.__name__, "grabFocus called.")
88 pass
89
98
104 self.apply = dummyApply
105 self.parent.nextClicked()
106