aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiktor w brodlo <wiktor@brodlo.net>2011-07-21 13:41:10 +0000
committerwiktor w brodlo <wiktor@brodlo.net>2011-07-21 13:41:10 +0000
commitb8b73c7edc37bbc5f121ff761104a44cd65d81db (patch)
tree738253bbffb7694ef1450b1d2b8200dd993da2cc
parentdispatch.py: iw modules require two arguments to their constructor (diff)
downloadanaconda-b8b73c7edc37bbc5f121ff761104a44cd65d81db.tar.gz
anaconda-b8b73c7edc37bbc5f121ff761104a44cd65d81db.tar.bz2
anaconda-b8b73c7edc37bbc5f121ff761104a44cd65d81db.zip
iw/welcome_gui.py: rework the system for easy extensibility
-rw-r--r--iw/welcome_gui.py142
1 files changed, 76 insertions, 66 deletions
diff --git a/iw/welcome_gui.py b/iw/welcome_gui.py
index b7576e8..01f3f31 100644
--- a/iw/welcome_gui.py
+++ b/iw/welcome_gui.py
@@ -28,79 +28,89 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
class WelcomeWindow (InstallWindow):
- def setWindow(self, title, text, chapter, linktext=None):
- (xml, align) = gui.getGladeWidget("welcome.glade", "welcome_align")
- title_ = self.xml.get_widget("title")
- text_ = self.xml.get_widget("text")
- title_.set_markup("<span style=\"font-size: 200%\">%s</span>")
- title_.set_attribute("label", _("Chapter %i: %s") % (chapter, title))
- text_.set_attribute("text", text)
-
- def welcome(self, anaconda):
- self.setWindow(_("Welcome to the Gentoo installer!"),
- _("This wizard will take you through installing Gentoo \
- on your computer. We will follow the official Gentoo \
- Handbook (with a few changes) and if at any point \
- you'd like to consult the handbook, you'll find the \
- link in the top-right corner of the window.\n\n\
- We'll start off asking you for the language and \
- keyboard layout you'd like the installer and your \
- future system to use. We will then skip straight to \
- Chapter 4 and continue with the installation."),
- 0, "Gentoo Handbook")
+ windows = {
+ "welcome" : (
+ _("Welcome to the Gentoo installer!"),
+ _("This wizard will take you through installing Gentoo \
+ on your computer. We will follow the official Gentoo \
+ Handbook (with a few changes) and if at any point \
+ you'd like to consult the handbook, you'll find the \
+ link in the top-right corner of the window.\n\n\
+ We'll start off asking you for the language and \
+ keyboard layout you'd like the installer and your \
+ future system to use. We will then skip straight to \
+ Chapter 4 and continue with the installation."),
+ 0, "Gentoo Handbook"),
- def preparedisks(self, anaconda):
- self.setWindow(_("Preparing the Disks"),
- _("To be able to install Gentoo, you must create the \
- necessary partitions. The following screens will \
- help you choose the right disk configuration for \
- your system."), 4)
+ "preparedisks" : (
+ _("Preparing the Disks"),
+ _("To be able to install Gentoo, you must create the \
+ necessary partitions. The following screens will \
+ help you choose the right disk configuration for \
+ your system."),
+ 4, None),
- def installationfiles(self, anaconda):
- self.setWindow(_("Installing the Gentoo Installation Files"),
- _("Gentoo installs work through a stage3 archive. In \
- this chapter the installer will help you choose the \
- right compilation options for your machine. "), 5)
+ "installationfiles" : (
+ _("Installing the Gentoo Installation Files"),
+ _("Gentoo installs work through a stage3 archive. In \
+ this chapter the installer will help you choose the \
+ right compilation options for your machine. "),
+ 5, None),
- def basesystem(self, anaconda):
- self.setWindow(_("Installing the Gentoo Installation Files"),
- _("In this chapter you will set your Gentoo mirrors, \
- select your profile and choose your the USE flags."),
- 6)
+ "basesystem" : (
+ _("Installing the Gentoo Installation Files"),
+ _("In this chapter you will set your Gentoo mirrors, \
+ select your profile and choose your the USE flags."),
+ 6, None),
- def configurekernel(self, anaconda):
- self.setWindow(_("Configuring the Kernel"),
- _("The Linux kernel is the core of every distribution. \
- This chapter explains how to configure your kernel. \
- You will only have to set your timezone, as the \
- installer will just copy the LiveDVD kernel to your \
- new system."),
- 7)
+ "configurekernel": (
+ _("Configuring the Kernel"),
+ _("The Linux kernel is the core of every distribution. \
+ This chapter explains how to configure your kernel. \
+ You will only have to set your timezone, as the \
+ installer will just copy the LiveDVD kernel to your \
+ new system."),
+ 7, None),
- def configuresystem(self, anaconda):
- self.setWindow(_("Configuring your System"),
- _("In this chapter you will only have to set your root \
- password as the rest is figured out automatically ;-)"),
- 8)
+ "configuresystem" : (
+ _("Configuring your System"),
+ _("In this chapter you will only have to set your root \
+ password as the rest is figured out automatically ;-)"),
+ 8, None),
- def systools(self, anaconda):
- self.setWindow(_("Installing Necessary System Tools"),
- _("In this chapter we help you choose and install some important tools."),
- 9)
+ "systools" : (
+ _("Installing Necessary System Tools"),
+ _("In this chapter we help you choose and install some important tools."),
+ 9, None),
- def bootloader(self, anaconda):
- self.setWindow(_("Configuring the Bootloader"),
- _("In this chapter you'll be able configure the GRUB \
- bootloader."),
- 10)
+ "bootloader" : (
+ _("Configuring the Bootloader"),
+ _("In this chapter you'll be able configure the GRUB bootloader."),
+ 10, None),
- def finalizing(self, anaconda):
- self.setWindow(_("Finalizing your Gentoo Installation"),
- _("You're almost done. We'll just create a user for \
- your system.\n\
- You'll also be able to choose if you'd like the X \
- Window System and a desktop environment installed on \
- your new system. "),
- 11)
+ "finalizing" : (
+ _("Finalizing your Gentoo Installation"),
+ _("You're almost done. We'll just create a user for \
+ your system.\n\
+ You'll also be able to choose if you'd like the X \
+ Window System and a desktop environment installed on \
+ your new system. "),
+ 11, None)
+ }
+
+ def getScreen(self, anaconda):
+ (step, _anaconda) = anaconda.dispatch.currentStep()
+ (title, text, chapter, linktext) = self.windows[step]
+ self.setWindow(title, text, chapter, linktext)
+
+ def setWindow(self, title, text, chapter, linktext):
+ (xml, align) = gui.getGladeWidget("welcome.glade", "welcome_align")
+ title_ = self.xml.get_widget("title")
+ text_ = self.xml.get_widget("text")
+ title_.set_markup("<span style=\"font-size: 200%\">%s</span>")
+ title_.set_attribute("label", _("Chapter %i: %s") % (chapter, title))
+ text_.set_attribute("text", text)
+
+
def getNext(self):
return None