aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gaffney <agaffney@gentoo.org>2007-03-03 02:58:08 +0000
committerAndrew Gaffney <agaffney@gentoo.org>2007-03-03 02:58:08 +0000
commit71de141908c55c437560facfeed9797719149d75 (patch)
tree5563938bab1f6d33d9c737816b5d64519260a347 /src/fe/gtk/gtkfe.py
parentpass GRP flag when installing bootloader (diff)
downloadgli-71de141908c55c437560facfeed9797719149d75.tar.gz
gli-71de141908c55c437560facfeed9797719149d75.tar.bz2
gli-71de141908c55c437560facfeed9797719149d75.zip
change the way screens are loaded
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/gli/branches/overhaul@1732 f8877401-5920-0410-a79b-8e2d7e04ca0d
Diffstat (limited to 'src/fe/gtk/gtkfe.py')
-rwxr-xr-xsrc/fe/gtk/gtkfe.py92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/fe/gtk/gtkfe.py b/src/fe/gtk/gtkfe.py
index 6da53f1..ec4a81d 100755
--- a/src/fe/gtk/gtkfe.py
+++ b/src/fe/gtk/gtkfe.py
@@ -24,43 +24,51 @@ class Installer:
install_type = "standard"
cur_screen = None
- menuItems = [ { 'text': _('Install Mode'), 'module': __import__("InstallMode") },
-# { 'text': _('Pre-install Config'), 'module': __import__("ClientConfig") },
- { 'text': _('Partitioning'), 'module': __import__("Partition") },
- { 'text': _('Local Mounts'), 'module': __import__("LocalMounts") },
- { 'text': _('Network Mounts'), 'module': __import__("NetworkMounts") },
- { 'text': _('Stage'), 'module': __import__("Stage") },
- { 'text': _('Portage Tree'), 'module': __import__("PortageTree") },
- { 'text': _('make.conf'), 'module': __import__("MakeDotConf") },
- { 'text': _('RootPass'), 'module': __import__("RootPass") },
- { 'text': _('Timezone'), 'module': __import__("Timezone") },
- { 'text': _('Kernel'), 'module': __import__("Kernel") },
- { 'text': _('KernelSources'), 'module': __import__("KernelSources") },
- { 'text': _('KernelConfig'), 'module': __import__("KernelConfig") },
- { 'text': _('Networking'), 'module': __import__("Networking") },
- { 'text': _('Logger'), 'module': __import__("Logger") },
- { 'text': _('CronDaemon'), 'module': __import__("CronDaemon") },
- { 'text': _('Bootloader'), 'module': __import__("Bootloader") },
-# { 'text': _('Startup Services'), 'module': __import__("StartupServices") },
-# { 'text': _('Other Settings'), 'module': __import__("OtherSettings") },
-# { 'text': _('Users'), 'module': __import__("Users") },
- { 'text': _('Extra Packages'), 'module': __import__("ExtraPackages") },
- { 'text': _('Install Done'), 'module': __import__("InstallDone") },
- { 'text': _('Install Failed'), 'module': __import__("InstallFailed") }
- ]
+ screens = {
+ "InstallMode": None,
+ "Partition": None,
+ "LocalMounts": None,
+ "NetworkMounts": None,
+ "Stage": None,
+ "PortageTree": None,
+ "MakeDotConf": None,
+ "RootPass": None,
+ "Timezone": None,
+ "Kernel": None,
+ "KernelSources": None,
+ "KernelConfig": None,
+ "Networking": None,
+ "Logger": None,
+ "CronDaemon": None,
+ "Bootloader": None,
+# "StartupServices": None,
+# "OtherSettings": None,
+# "Users": None,
+ "ExtraPackages": None,
+ "InstallDone": None,
+ "InstallFailed": None
+ }
def __init__(self):
- self.install_profile = GLIInstallProfile.InstallProfile()
- self.cc = GLIClientController.GLIClientController(self.install_profile)
-
self.window = None
self.panel = None
self._cur_panel = 0
self.__full_path = self.get_current_path()
+
+ # Show splash screen
self.splash = SplashScreen(self.__full_path)
self.splash.show()
while gtk.events_pending():
gtk.main_iteration()
+
+ # Import screen modules
+ for screen in self.screens:
+ self.screens[screen] = __import__(screen)
+
+ # Instantiate installer objects
+ self.install_profile = GLIInstallProfile.InstallProfile()
+ self.cc = GLIClientController.GLIClientController(self.install_profile)
+
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.title = _("Gentoo Linux Installer")
self.window.realize()
@@ -80,18 +88,13 @@ class Installer:
self.headerbox.add(headerimg)
self.globalbox.pack_start(self.headerbox, expand=False, fill=False, padding=0)
- # Future bar
-# self.futurebar = GLIFutureBar([element['text'] for element in self.menuItems])
-# self.globalbox.pack_start(self.futurebar, expand=False, fill=False, padding=5)
-# self.globalbox.pack_start(gtk.HSeparator(), expand=False, fill=False, padding=0)
-
# Progress bar
- progress_box = gtk.HBox(False, 0)
- progress_box.pack_start(gtk.Label("Install Progress"), expand=False, fill=False, padding=10)
- self.progress_bar = gtk.ProgressBar()
- progress_box.pack_start(self.progress_bar, expand=True, fill=True, padding=10)
- self.globalbox.pack_start(progress_box, expand=False, fill=False, padding=5)
- self.globalbox.pack_start(gtk.HSeparator(), expand=False, fill=False, padding=0)
+# progress_box = gtk.HBox(False, 0)
+# progress_box.pack_start(gtk.Label("Install Progress"), expand=False, fill=False, padding=10)
+# self.progress_bar = gtk.ProgressBar()
+# progress_box.pack_start(self.progress_bar, expand=True, fill=True, padding=10)
+# self.globalbox.pack_start(progress_box, expand=False, fill=False, padding=5)
+# self.globalbox.pack_start(gtk.HSeparator(), expand=False, fill=False, padding=0)
# Top box
self.topbox = gtk.HBox(False, 0)
@@ -151,7 +154,7 @@ class Installer:
self.splash.destroy()
self.window.show_all()
- self.load_screen("Install Mode")
+ self.load_screen("InstallMode")
def redraw_buttons(self):
self.bottombox.hide_all()
@@ -171,13 +174,10 @@ class Installer:
if self.cur_screen:
self.rightframe.remove(self.cur_screen)
del self.cur_screen
- for i, item in enumerate(self.menuItems):
- if item['text'] == name:
- self.cur_screen = item['module'].Panel(self)
- percent = int((i) / float(len(self.menuItems) - 1) * 100)
- self.progress_bar.set_fraction(float(percent) / 100)
- self.progress_bar.set_text(str(percent) + "%")
- break
+ self.cur_screen = self.screens[name].Panel(self)
+# percent = int((i) / float(len(self.screens) - 1) * 100)
+# self.progress_bar.set_fraction(float(percent) / 100)
+# self.progress_bar.set_text(str(percent) + "%")
self.rightframe.add(self.cur_screen)
self.cur_screen.activate()
helptext = self.cur_screen._helptext