client/rhel/rhn-client-tools/rhn-client-tools.spec
| 19 +
client/rhel/rhn-client-tools/src/Makefile
| 2
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile
| 41 ++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_server_gui.py
| 72 ++++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_create_profile_gui.py
| 79 ++++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_finish_gui.py
| 77 ++++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_login_gui.py
| 131 +++++++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_provide_certificate_gui.py
| 71 ++++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_register_firstboot_gui_window.py
| 108 ++++++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_review_gui.py
| 66 +++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_start_gui.py
| 105 ++++++
client/rhel/rhn-client-tools/src/firstboot/Makefile
| 16
client/rhel/rhn-client-tools/src/firstboot/rhn_choose_server_gui.py
| 80 ++--
client/rhel/rhn-client-tools/src/firstboot/rhn_create_profile_gui.py
| 82 ++--
client/rhel/rhn-client-tools/src/firstboot/rhn_finish_gui.py
| 79 ++--
client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py
| 174 ++++------
client/rhel/rhn-client-tools/src/firstboot/rhn_provide_certificate_gui.py
| 72 ++--
client/rhel/rhn-client-tools/src/firstboot/rhn_register.py
| 32 +
client/rhel/rhn-client-tools/src/firstboot/rhn_register_firstboot_gui_window.py
| 108 ------
client/rhel/rhn-client-tools/src/firstboot/rhn_review_gui.py
| 67 +--
client/rhel/rhn-client-tools/src/firstboot/rhn_start_gui.py
| 65 ++-
rel-eng/Makefile.srpm
| 3
22 files changed, 1113 insertions(+), 436 deletions(-)
New commits:
commit 8a49d46cf6e895b13c6d68da173b63065bc5ce9a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Feb 19 14:52:19 2010 +0100
MD5
diff --git a/rel-eng/Makefile.srpm b/rel-eng/Makefile.srpm
index e1d16ff..b77a38f 100644
--- a/rel-eng/Makefile.srpm
+++ b/rel-eng/Makefile.srpm
@@ -11,7 +11,8 @@ ifdef X_RPMBUILD_DIR
X_RPMBUILD_DIR_OPTS = --define "_sourcedir $(CURDIR)" \
--define "_builddir $(X_RPMBUILD_DIR)/BUILD" \
--define "_srcrpmdir $(X_RPMBUILD_DIR)" \
- --define "_rpmdir $(X_RPMBUILD_DIR)"
+ --define "_rpmdir $(X_RPMBUILD_DIR)" \
+ --define "_source_filedigest_algorithm md5"
# The COMMIT parameter is used when we want to make tar.gz / .src.rpm
# from any commit we like (including HEAD). In that case thou, the
commit fac7c7e24691a923ca5041eb4584ed218eff22ce
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 25 16:01:07 2010 +0200
585188 - refactor the RHN Register firstboot code to match firstboot 1.110 on Fedora
12 and RHEL 6.
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 4b4ee3f..bdb8750 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -116,10 +116,11 @@ rm $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/hardware_hal.*
rm $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/hardware_gudev.*
%endif
-%if 0%{?rhel} < 6
+%if 0%{?rhel} > 0 && 0%{?rhel} < 6
rm -rf $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/firstboot
+rm -f $RPM_BUILD_ROOT%{_datadir}/firstboot/modules/rhn_register.*
%else
-rm -rf $RPM_BUILD_ROOT%{_datadir}/firstboot/modules
+rm -rf $RPM_BUILD_ROOT%{_datadir}/firstboot/modules/rhn_*_*.*
%endif
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications --vendor=rhn
rhn_register.desktop
@@ -259,7 +260,7 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/icons/hicolor/48x48/apps/up2date.png
%{_datadir}/applications/rhn_register.desktop
-%if 0%{?rhel} < 6
+%if 0%{?rhel} > 0 && 0%{?rhel} < 6
%{_datadir}/firstboot/modules/rhn_login_gui.*
%{_datadir}/firstboot/modules/rhn_register_firstboot_gui_window.*
%{_datadir}/firstboot/modules/rhn_start_gui.*
@@ -269,8 +270,8 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/firstboot/modules/rhn_review_gui.*
%{_datadir}/firstboot/modules/rhn_finish_gui.*
%else
+%{_datadir}/firstboot/modules/rhn_register.*
%{_datadir}/rhn/up2date_client/firstboot/rhn_login_gui.*
-%{_datadir}/rhn/up2date_client/firstboot/rhn_register_firstboot_gui_window.*
%{_datadir}/rhn/up2date_client/firstboot/rhn_start_gui.*
%{_datadir}/rhn/up2date_client/firstboot/rhn_choose_server_gui.*
%{_datadir}/rhn/up2date_client/firstboot/rhn_provide_certificate_gui.*
diff --git a/client/rhel/rhn-client-tools/src/firstboot/Makefile
b/client/rhel/rhn-client-tools/src/firstboot/Makefile
index 68fd1ac..7defb90 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/Makefile
+++ b/client/rhel/rhn-client-tools/src/firstboot/Makefile
@@ -2,12 +2,14 @@
#
# $Id$
+TOPMODULE = rhn_register
MODULES = rhn_login_gui \
- rhn_register_firstboot_gui_window \
rhn_start_gui rhn_choose_server_gui \
rhn_provide_certificate_gui rhn_create_profile_gui \
rhn_review_gui rhn_finish_gui
+TOPPYFILE = $(addsuffix .py, $(TOPMODULE))
PYFILES = $(addsuffix .py, $(MODULES))
+TOPOBJECT = $(TOPPYFILE) $(addsuffix .pyc, $(TOPMODULE))
OBJECTS = $(PYFILES) $(addsuffix .pyc, $(MODULES))
# Install stuff
@@ -16,26 +18,28 @@ INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = $(INSTALL) -m 755 --verbose -d
# Install Directories
+SYSTEMFIRSTBOOTDIR = $(PREFIX)/usr/share/firstboot/modules/
FIRSTBOOTDIR = $(PREFIX)/usr/share/rhn/up2date_client/firstboot/
PYCHECKER = /usr/bin/pychecker
-all:: $(OBJECTS)
+all:: $(TOPOBJECT) $(OBJECTS)
# default compile rule:
%.pyc: %.py
python -c "import py_compile; py_compile.compile('$<')"
-install: all $(FIRSTBOOTDIR)
+install: all $(FIRSTBOOTDIR) $(SYSTEMFIRSTBOOTDIR)
$(INSTALL_DATA) $(OBJECTS) $(FIRSTBOOTDIR)/
+ $(INSTALL_DATA) $(TOPOBJECT) $(SYSTEMFIRSTBOOTDIR)/
-$(FIRSTBOOTDIR) :
+$(SYSTEMFIRSTBOOTDIR) $(FIRSTBOOTDIR) :
@$(INSTALL_DIR) $@
clean:
@rm -rf *.pyc *~ .*~ *.o
pychecker::
- @$(PYCHECKER) $(PYFILES) || exit 0
+ @$(PYCHECKER) $(PYFILES) $(TOPPYFILE) || exit 0
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_choose_server_gui.py
b/client/rhel/rhn-client-tools/src/firstboot/rhn_choose_server_gui.py
index 83f88ab..6c8743c 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_choose_server_gui.py
+++ b/client/rhel/rhn-client-tools/src/firstboot/rhn_choose_server_gui.py
@@ -1,4 +1,4 @@
-# Copyright 2006 Red Hat, Inc.
+# Copyright 2006--2010 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,58 +15,62 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors:
+# Jan Pazdziora jpazdziora at redhat dot com
# Daniel Benamy <dbenamy(a)redhat.com>
-import os
import sys
-sys.path.append("/usr/share/rhn/up2date_client/")
sys.path.append("/usr/share/rhn")
-import rhnreg
-import rhnregGui
-import up2dateErrors
-from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+from up2date_client import rhnreg
+from up2date_client import rhnregGui
+from up2date_client import up2dateErrors
import gtk
from gtk import glade
+
import gettext
-_ = gettext.gettext
+_ = lambda x: gettext.ldgettext("rhn-client-tools", x)
-gettext.textdomain("rhn-client-tools")
gtk.glade.bindtextdomain("rhn-client-tools")
+from firstboot.module import Module
+from firstboot.constants import *
-class RhnChooseServerWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.ChooseServerPage):
- runPriority=106.5
- moduleName = _("Choose Server")
- windowTitle = moduleName
- shortMessage = _("Choose a Red Hat Network server")
- needsparent = 1
- needsnetwork = 1
- noSidebar = True
-
+class moduleClass(Module):
def __init__(self):
- RhnRegisterFirstbootGuiWindow.__init__(self)
- rhnregGui.ChooseServerPage.__init__(self)
- if rhnreg.registered():
- self.skipme = True
-
- def _getVbox(self):
- return self.chooseServerPageVbox()
-
- def updatePage(self):
- self.chooseServerPagePrepare()
-
- def apply(self, *args):
- """Returns True to change the page (to the one
set)."""
+ Module.__init__(self)
+ self.priority = 106.5
+ self.sidebarTitle = _("Choose Server")
+ self.title = _("Choose Server")
+
+ def needsNetwork(self):
+ return True
+
+ def apply(self, interface, testing=False):
+ if testing:
+ return RESULT_SUCCESS
+
try:
- if self.chooseServerPageApply() is False:
- self.parent.setPage("rhn_login_gui")
- return True
+ if self.chooseServerPage.chooseServerPageApply() is False:
+ interface.moveToPage(moduleTitle=_("Red Hat Login"))
+ return RESULT_JUMP
else:
- return None
+ return RESULT_FAILURE
except up2dateErrors.SSLCertificateVerifyFailedError:
- self.parent.setPage("rhn_provide_certificate_gui")
- return True
+ interface.moveToPage(moduleTitle=_("Provide Certificate"))
+ return RESULT_JUMP
+ # return RESULT_SUCCESS should work just as well since the
+ # certificate page with priority 107 is the next one anyway
+
+ def createScreen(self):
+ self.chooseServerPage = rhnregGui.ChooseServerPage()
+ self.vbox = gtk.VBox(spacing=5)
+ self.vbox.pack_start(self.chooseServerPage.chooseServerPageVbox(), True, True)
+ def initializeUI(self):
+ self.chooseServerPage.chooseServerPagePrepare()
+
+ def shouldAppear(self):
+ if rhnreg.registered():
+ return False
+ return True
-childWindow = RhnChooseServerWindow
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_create_profile_gui.py
b/client/rhel/rhn-client-tools/src/firstboot/rhn_create_profile_gui.py
index e49b520..13d974d 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_create_profile_gui.py
+++ b/client/rhel/rhn-client-tools/src/firstboot/rhn_create_profile_gui.py
@@ -1,6 +1,4 @@
-# rhn_register.py - GUI front end code for firstboot screen resolution
-#
-# Copyright 2003 Red Hat, Inc.
+# Copyright 2003--2010 Red Hat, Inc.
# Copyright 2003 Brent Fox <bfox(a)redhat.com>
#
# This program is free software; you can redistribute it and/or modify
@@ -17,63 +15,59 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
+# Authors:
+# Jan Pazdziora jpazdziora at redhat dot com
-import gtk
-import gobject
import sys
-import os
-import functions
+sys.path.append("/usr/share/rhn")
+from up2date_client import rhnreg
+from up2date_client import rhnregGui
-import gnome, gnome.ui
+import gtk
from gtk import glade
-from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
-sys.path.insert(0, "/usr/share/rhn/up2date_client/")
-sys.path.insert(1,"/usr/share/rhn")
-
-import rhnreg
-import rhnregGui
-import up2dateErrors
-import messageWindow
-
import gettext
-_ = gettext.gettext
-gettext.textdomain("rhn-client-tools")
-gtk.glade.bindtextdomain("rhn-client-tools")
+_ = lambda x: gettext.ldgettext("rhn-client-tools", x)
+gtk.glade.bindtextdomain("rhn-client-tools")
-class RhnCreateProfileWindow(RhnRegisterFirstbootGuiWindow,
rhnregGui.CreateProfilePage):
- #You must specify a runPriority for the order in which you wish your module to run
- runPriority = 108.7
- moduleName = _("Create Profile")
- windowTitle = moduleName
- shortMessage = _("Connect to Red Hat Network")
- needsparent = 1
- needsnetwork = 1
- noSidebar = True
+from firstboot.module import Module
+from firstboot.constants import *
+class moduleClass(Module):
def __init__(self):
- RhnRegisterFirstbootGuiWindow.__init__(self)
- rhnregGui.CreateProfilePage.__init__(self)
- if rhnreg.registered():
- self.skipme = True
+ Module.__init__(self)
+ self.priority = 108.7
+ self.sidebarTitle = _("Create Profile")
+ self.title = _("Create Profile")
- def updatePage(self):
- self.createProfilePagePrepare()
-
- def _getVbox(self):
- return self.createProfilePageVbox()
+ def needsNetwork(self):
+ return True
- def apply(self, *args):
+ def apply(self, interface, testing=False):
+ if testing:
+ return RESULT_SUCCESS
- ret = self.createProfilePageVerify()
+ ret = self.createProfilePage.createProfilePageVerify()
if ret:
- return None
+ return RESULT_FAILURE
- ret = self.createProfilePageApply()
+ ret = self.createProfilePage.createProfilePageApply()
if ret:
- return None
+ return RESULT_FAILURE
+ return RESULT_SUCCESS
+
+ def createScreen(self):
+ self.createProfilePage = rhnregGui.CreateProfilePage()
+ self.vbox = gtk.VBox(spacing=5)
+ self.vbox.pack_start(self.createProfilePage.createProfilePageVbox(), True, True)
+
+ def initializeUI(self):
+ self.createProfilePage.createProfilePagePrepare()
+
+ def shouldAppear(self):
+ if rhnreg.registered():
+ return False
return True
-childWindow = RhnCreateProfileWindow
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_finish_gui.py
b/client/rhel/rhn-client-tools/src/firstboot/rhn_finish_gui.py
index fa4c6ce..54fe35b 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_finish_gui.py
+++ b/client/rhel/rhn-client-tools/src/firstboot/rhn_finish_gui.py
@@ -1,4 +1,4 @@
-# Copyright 2006 Red Hat, Inc.
+# Copyright 2006--2010 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,63 +15,54 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors:
+# Jan Pazdziora jpazdziora at redhat dot com
# Daniel Benamy <dbenamy(a)redhat.com>
import sys
-sys.path.append("/usr/share/rhn/up2date_client/")
sys.path.append("/usr/share/rhn")
-import rhnreg
-import rhnregGui
-from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
-import config
+from up2date_client import rhnreg
+from up2date_client import rhnregGui
+from up2date_client import config
import gtk
from gtk import glade
+
import gettext
-_ = gettext.gettext
+_ = lambda x: gettext.ldgettext("rhn-client-tools", x)
-gettext.textdomain("rhn-client-tools")
gtk.glade.bindtextdomain("rhn-client-tools")
+from firstboot.module import Module
+from firstboot.constants import *
-class RhnFinishWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.FinishPage):
- runPriority=109
- moduleName = _("Finish Updates Setup")
- windowTitle = moduleName
- shortMessage = _("Connect to Red Hat Network")
- needsparent = 1
- needsnetwork = 1
- noSidebar = True
-
+class moduleClass(Module):
def __init__(self):
- RhnRegisterFirstbootGuiWindow.__init__(self)
- rhnregGui.FinishPage.__init__(self)
- if rhnreg.registered():
- self.skipme = True
-
- def _getVbox(self):
- return self.finishPageVbox()
-
- def updatePage(self):
-## if rhnregGui.hasBaseChannelAndUpdates():
-## self.druid.finish.set_label(_("_Finish"))
-## title = _("Finish setting up software updates")
-## else:
-## self.druid.finish.set_label(_("_Exit registration process"))
-## title = _("Registration unsuccessful")
- self.finishPagePrepare()
-## self.mainWin.set_title(title)
-## self.finishPage.set_title(title)
-
- def apply(self, *args):
- """Returns None to stay on the same page. Anything else will cause
- firstboot to advance but True is generally used. This is different from
- the gnome druid in rhn_register.
-
- """
+ Module.__init__(self)
+ self.priority = 109
+ self.sidebarTitle = _("Finish Updates Setup")
+ self.title = _("Finish Updates Setup")
+
+ def needsNetwork(self):
+ return True
+
+ def apply(self, interface, testing=False):
+ if testing:
+ return RESULT_SUCCESS
+
up2DateConfig = config.initUp2dateConfig()
up2DateConfig.save()
- return True
+ return RESULT_SUCCESS
+
+ def createScreen(self):
+ self.finishPage = rhnregGui.FinishPage()
+ self.vbox = gtk.VBox(spacing=5)
+ self.vbox.pack_start(self.finishPage.finishPageVbox(), True, True)
+
+ def initializeUI(self):
+ self.finishPage.finishPagePrepare()
+ def shouldAppear(self):
+ if rhnreg.registered():
+ return False
+ return True
-childWindow = RhnFinishWindow
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py
b/client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py
index 6fea3ab..516156e 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py
+++ b/client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py
@@ -1,6 +1,4 @@
-# rhn_register.py - GUI front end code for firstboot screen resolution
-#
-# Copyright 2003 Red Hat, Inc.
+# Copyright 2006--2010 Red Hat, Inc.
# Copyright 2003 Brent Fox <bfox(a)redhat.com>
#
# This program is free software; you can redistribute it and/or modify
@@ -17,115 +15,97 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
+# Authors:
+# Jan Pazdziora jpazdziora at redhat dot com
-import gtk
-import gobject
import sys
-import os
-import functions
+sys.path.append("/usr/share/rhn")
+from up2date_client import rhnreg
+from up2date_client import rhnregGui
+from up2date_client import up2dateErrors
+# from up2date_client import messageWindow
-import gnome, gnome.ui
+import gtk
from gtk import glade
-from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
-sys.path.insert(0, "/usr/share/rhn/up2date_client/")
-sys.path.insert(1,"/usr/share/rhn")
-
-import rhnreg
-import rhnregGui
-import up2dateErrors
-import messageWindow
-
-
-##
-## I18N
-##
import gettext
-_ = gettext.gettext
+_ = lambda x: gettext.ldgettext("rhn-client-tools", x)
-gettext.textdomain("rhn-client-tools")
-gtk.glade.bindtextdomain("rhn-client-tools", "/usr/share/locale")
+gtk.glade.bindtextdomain("rhn-client-tools")
+from firstboot.module import Module
+from firstboot.constants import *
+class moduleClass(Module):
+ def __init__(self):
+ Module.__init__(self)
+ self.priority = 108.5
+ self.sidebarTitle = _("Red Hat Login")
+ self.title = _("Red Hat Login")
-class RhnLoginWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.LoginPage):
- #You must specify a runPriority for the order in which you wish your module to run
- runPriority = 108
- moduleName = _("Red Hat Login")
- windowTitle = moduleName
- shortMessage = _("Register with Red Hat Network")
- needsparent = 1
- needsnetwork = 1
- noSidebar = True
+ def needsNetwork(self):
+ return True
- def __init__(self):
- RhnRegisterFirstbootGuiWindow.__init__(self)
- rhnregGui.LoginPage.__init__(self)
- if rhnreg.registered():
- self.skipme = True
-
- def updatePage(self):
-# self.getCaps()
- self.loginPagePrepare()
- self.goingNextFromNewAccountDialog = False
-
- def grabFocus(self):
- # We must set focus where we want it here. Setting it in updatePage
- # doesn't work.
- self.loginXml.get_widget("loginUserEntry").grab_focus()
-
- def _getVbox(self):
- return self.loginPageVbox()
-
- def apply(self, *args):
- """Returns None to stay on the same page. Anything else will cause
- firstboot to advance but True is generally used. This is different from
- the gnome druid in rhn_register.
-
- """
- if self.doDebug:
- print "applying rhn_login_gui"
-
- # This is a hack. This function will get called if they click next on
- # the login page (the else) or when they create an account (the if). In
- # that case we don't want to do the normal logging in stuff.
- if self.goingNextFromNewAccountDialog:
- assert rhnregGui.newAccount is True
- else:
- if self.loginPageVerify():
- return None
-
- assert rhnregGui.newAccount is False
-
- try:
- ret = self.loginPageApply()
- # TODO this exception can't reach here right now. ditch it and/or
- # figure out how we want to provide this functionality.
- except up2dateErrors.CommunicationError, e:
- msg = _("There was a communication error with the server: %s" %
e.errmsg)
- msg = msg + "\n\n" + _("Would you like to try changing the
network configuration and trying again?")
- dlg = messageWindow.YesNoDialog(msg)
- ret = dlg.getrc()
- if ret:
- return None
- else:
- self.parent.setPage("rhn_finish_gui")
+ def apply(self, interface, testing=False):
+ if testing:
+ return RESULT_SUCCESS
+
+ if self.loginPage.loginPageVerify():
+ return RESULT_FAILURE
+
+ try:
+ ret = self.loginPage.loginPageApply()
+ # TODO this exception can't reach here right now. ditch it and/or
+ # figure out how we want to provide this functionality.
+ except up2dateErrors.CommunicationError, e:
+ msg = _("There was a communication error with the server: %s" %
e.errmsg)
+ msg = msg + "\n\n" + _("Would you like to try changing the
network configuration and trying again?")
+ dlg = messageWindow.YesNoDialog(msg)
+ ret = dlg.getrc()
if ret:
- return None
+ return RESULT_FAILURE
+ else:
+ interface.moveToPage(moduleTitle=_("Finish Updates Setup"))
+ return RESULT_JUMP
+
+ if ret:
+ return RESULT_FAILURE
# We should try to activate hardware, even if no EUS in firstboot
rhnregGui.try_to_activate_hardware()
- self.parent.setPage('rhn_create_profile_gui')
+ return RESULT_SUCCESS
+
+ def createScreen(self):
+ self.loginPage = FirstbootLoginPage()
+ self.vbox = gtk.VBox(spacing=5)
+ self.vbox.pack_start(self.loginPage.loginPageVbox(), True, True)
+
+ def initializeUI(self):
+ self.loginPage.loginPagePrepare()
+
+ def shouldAppear(self):
+ if rhnreg.registered():
+ return False
return True
-
+
+ def focus(self):
+ self.loginPage.loginXml.get_widget("loginUserEntry").grab_focus()
+
+class FirstbootLoginPage(rhnregGui.LoginPage):
+ def __init__(self):
+ rhnregGui.LoginPage.__init__(self)
+
def goToPageAfterLogin(self):
- # This is a hack. More info above.
- self.goingNextFromNewAccountDialog = True
- self.parent.nextClicked()
-
- def onLoginPageNext(self, dummy=None, dummy2=None):
- # This is a hackish way to support enter advancing
- self.parent.nextClicked()
-
-childWindow = RhnLoginWindow
+ pass
+
+# FIXME: the Enter advancing is not working.
+#
+# def goToPageAfterLogin(self):
+# # This is a hack. More info above.
+# self.goingNextFromNewAccountDialog = True
+# self.parent.nextClicked()
+#
+# def onLoginPageNext(self, dummy=None, dummy2=None):
+# # This is a hackish way to support enter advancing
+# self.parent.nextClicked()
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_provide_certificate_gui.py
b/client/rhel/rhn-client-tools/src/firstboot/rhn_provide_certificate_gui.py
index 319d29a..68aeebc 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_provide_certificate_gui.py
+++ b/client/rhel/rhn-client-tools/src/firstboot/rhn_provide_certificate_gui.py
@@ -1,4 +1,4 @@
-# Copyright 2006 Red Hat, Inc.
+# Copyright 2006--2010 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,57 +15,61 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors:
+# Jan Pazdziora jpazdziora at redhat dot com
# Daniel Benamy <dbenamy(a)redhat.com>
-import os
import sys
-sys.path.append("/usr/share/rhn/up2date_client/")
sys.path.append("/usr/share/rhn")
-import rhnreg
-import rhnregGui
-import up2dateErrors
-from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+from up2date_client import rhnreg
+from up2date_client import rhnregGui
import gtk
from gtk import glade
+
import gettext
-_ = gettext.gettext
+_ = lambda x: gettext.ldgettext("rhn-client-tools", x)
-gettext.textdomain("rhn-client-tools")
gtk.glade.bindtextdomain("rhn-client-tools")
+from firstboot.module import Module
+from firstboot.constants import *
-class RhnProvideCertificateWindow(RhnRegisterFirstbootGuiWindow,
rhnregGui.ProvideCertificatePage):
- runPriority=107
- moduleName = _("Provide Certificate")
- windowTitle = moduleName
- shortMessage = _("Provide a certificate for this Red Hat Network server")
- needsparent = 1
- needsnetwork = 1
- noSidebar = True
-
+class moduleClass(Module):
def __init__(self):
- RhnRegisterFirstbootGuiWindow.__init__(self)
- rhnregGui.ProvideCertificatePage.__init__(self)
- if rhnreg.registered():
- self.skipme = True
-
- def _getVbox(self):
- return self.provideCertificatePageVbox()
-
- def apply(self, *args):
- """Returns True to change the page or None to stay on the same
page."""
- status = self.provideCertificatePageApply()
+ Module.__init__(self)
+ self.priority = 107.5
+ self.sidebarTitle = _("Provide Certificate")
+ self.title = _("Provide Certificate")
+
+ def needsNetwork(self):
+ return True
+
+ def apply(self, interface, testing=False):
+ if testing:
+ return RESULT_SUCCESS
+
+ status = self.provideCertificatePage.provideCertificatePageApply()
if status == 0: # cert was installed
- return True
+ return RESULT_SUCCESS
elif status == 1: # the user doesn't want to provide a cert right now
# TODO write a message to disk like the other cases? need to decide
# how we want to do error handling in general.
- self.parent.setPage("rhn_finish_gui")
- return True
+ interface.moveToPage(moduleTitle=_("Finish Updates Setup"))
+ return RESULT_JUMP
else: # an error occurred and the user was notified
assert status == 2
- return None
+ return RESULT_FAILURE
+
+ def createScreen(self):
+ self.provideCertificatePage = rhnregGui.ProvideCertificatePage()
+ self.vbox = gtk.VBox(spacing=5)
+ self.vbox.pack_start(self.provideCertificatePage.provideCertificatePageVbox(),
True, True)
+ def initializeUI(self):
+ self.provideCertificatePage.setUrlInWidget()
+
+ def shouldAppear(self):
+ if rhnreg.registered():
+ return False
+ return True
-childWindow = RhnProvideCertificateWindow
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_register.py
b/client/rhel/rhn-client-tools/src/firstboot/rhn_register.py
new file mode 100644
index 0000000..c07329f
--- /dev/null
+++ b/client/rhel/rhn-client-tools/src/firstboot/rhn_register.py
@@ -0,0 +1,32 @@
+# Copyright 2010 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# Authors:
+# Jan Pazdziora jpazdziora at redhat dot com
+
+from firstboot.moduleset import *
+
+import gettext
+_ = lambda x: gettext.ldgettext("rhn-client-tools", x)
+
+class moduleClass(ModuleSet):
+ def __init__(self):
+ ModuleSet.__init__(self)
+ self.priority = 2
+ self.sidebarTitle = _("Set Up Software Updates")
+ self.title = _("Set Up Software Updates")
+ self.path = "/usr/share/rhn/up2date_client/firstboot"
+
diff --git
a/client/rhel/rhn-client-tools/src/firstboot/rhn_register_firstboot_gui_window.py
b/client/rhel/rhn-client-tools/src/firstboot/rhn_register_firstboot_gui_window.py
deleted file mode 100644
index 60725ac..0000000
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_register_firstboot_gui_window.py
+++ /dev/null
@@ -1,108 +0,0 @@
-import functions # firstboot stuff
-import os
-import sys
-import gtk
-
-from firstboot_module_window import FirstbootModuleWindow
-
-sys.path.append("/usr/share/rhn/up2date_client/")
-sys.path.append("/usr/share/rhn")
-import messageWindow
-import rhnregGui
-
-class RhnRegisterFirstbootGuiWindow(FirstbootModuleWindow):
- """This is a base class for our firstboot screens. It shouldn't be
used
- directly.
-
- """
- needsparent = 1
-
- def __init__(self):
- FirstbootModuleWindow.__init__(self)
- self.doDebug = False
- # Variables that fb windows need to define
- assert hasattr(self, 'runPriority')
- assert hasattr(self, 'moduleName')
- assert hasattr(self, 'windowTitle')
- assert hasattr(self, 'shortMessage')
- assert hasattr(self, 'needsparent')
- # Method to provide the screen contents
- assert hasattr(self, '_getVbox')
-
- def passInParent(self,parent):
- self.parent = parent
-
- def getNext(self):
- pass
-
- def launch(self, doDebug=None):
- """Firstboot calls this to set up the screen. It will use the
_getVbox
- method provided by the derived classes to get the contents of the
- screen.
-
- """
- self.doDebug = doDebug
- if self.doDebug:
- print self.__class__.__name__, "launch called."
-
- self.icon =
functions.imageFromPath("/usr/share/system-config-display/pixmaps/system-config-display.png")
- self.mainVBox = gtk.VBox()
-
- internalVBox = gtk.VBox(False, 10)
- internalVBox.set_border_width(10)
-
- vbox = self._getVbox()
-
- internalVBox.pack_start(vbox, True)
- self.mainVBox.pack_start(internalVBox, True)
-
- # Set up cursor changing functions. Overriding functions that aren't in
- # classes like this could be called a hack, but I think it's the best
- # we can do with the current overall setup and isn't too bad.
- # Having it here will cause this to get called once per module, but I'm
- # not sure if it'll work to put it in the constructor.
- def mySetBusyCursor():
- cursor = gtk.gdk.Cursor(gtk.gdk.WATCH)
- # I think we have to set the cursor using firstboot's .window instead of
- # the one in our vboxes because the thing we use must be displayed when
- # we change the cursor and sometimes this gets called by a screen before
- # it's visible.
- # TODO See if we can add functions to firstboot to provide a nice way to
- # change the cursor.
- self.parent.win.window.set_cursor(cursor)
- while gtk.events_pending():
- gtk.main_iteration(False)
- def mySetArrowCursor():
- # I think we have to set the cursor using firstboot's .window instead of
- # the one in our vboxes because the thing we use must be displayed when
- # we change the cursor and sometimes this gets called by a screen before
- # it's visible.
- self.parent.win.window.set_cursor(None)
- while gtk.events_pending():
- gtk.main_iteration(False)
- rhnregGui.setBusyCursor = mySetBusyCursor
- rhnregGui.setArrowCursor = mySetArrowCursor
-
- return self.mainVBox, self.icon, self.windowTitle
-
- def grabFocus(self):
- if self.doDebug:
- print self.__class__.__name__, "grabFocus called."
- pass
-
- def fatalError(self, error, wrap=1):
- # FIXME
- if wrap:
- text = messageWindow.wrap_text(error)
- else:
- text = error
- dlg = messageWindow.ErrorDialog(text)
- self._goImmediatelyToFinish()
-
- def _goImmediatelyToFinish(self):
- self.parent.setPage("rhn_finish_gui")
- def dummyApply(self, *args):
- print "dummy"
- return True
- self.apply = dummyApply
- self.parent.nextClicked()
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_review_gui.py
b/client/rhel/rhn-client-tools/src/firstboot/rhn_review_gui.py
index 982a67f..eb12ae2 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_review_gui.py
+++ b/client/rhel/rhn-client-tools/src/firstboot/rhn_review_gui.py
@@ -1,4 +1,4 @@
-# Copyright 2006 Red Hat, Inc.
+# Copyright 2006--2010 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,52 +15,51 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors:
+# Jan Pazdziora jpazdziora at redhat dot com
# Daniel Benamy <dbenamy(a)redhat.com>
import sys
-sys.path.append("/usr/share/rhn/up2date_client/")
sys.path.append("/usr/share/rhn")
-import rhnreg
-import rhnregGui
-from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+from up2date_client import rhnreg
+from up2date_client import rhnregGui
import gtk
from gtk import glade
+
import gettext
-_ = gettext.gettext
+_ = lambda x: gettext.ldgettext("rhn-client-tools", x)
-gettext.textdomain("rhn-client-tools")
gtk.glade.bindtextdomain("rhn-client-tools")
+from firstboot.module import Module
+from firstboot.constants import *
-class RhnReviewWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.ReviewSubscriptionPage):
- runPriority=108.9
- moduleName = _("Review Subscription")
- windowTitle = moduleName
- shortMessage = _("Connect to Red Hat Network")
- needsparent = 1
- needsnetwork = 1
- noSidebar = True
-
+class moduleClass(Module):
def __init__(self):
- RhnRegisterFirstbootGuiWindow.__init__(self)
- rhnregGui.ReviewSubscriptionPage.__init__(self)
- if rhnreg.registered():
- self.skipme = True
-
- def _getVbox(self):
- return self.reviewSubscriptionPageVbox()
-
- def updatePage(self):
- self.reviewSubscriptionPagePrepare()
-
- def apply(self, *args):
- """Returns None to stay on the same page. Anything else will cause
- firstboot to advance but True is generally used. This is different from
- the gnome druid in rhn_register.
-
- """
+ Module.__init__(self)
+ self.priority = 108.9
+ self.sidebarTitle = _("Review Subscription")
+ self.title = _("Review Subscription")
+
+ def needsNetwork(self):
return True
+ def apply(self, interface, testing=False):
+ if testing:
+ return RESULT_SUCCESS
+
+ return RESULT_SUCCESS
+
+ def createScreen(self):
+ self.reviewSubscriptionPage = rhnregGui.ReviewSubscriptionPage()
+ self.vbox = gtk.VBox(spacing=5)
+ self.vbox.pack_start(self.reviewSubscriptionPage.reviewSubscriptionPageVbox(),
True, True)
+
+ def initializeUI(self):
+ self.reviewSubscriptionPage.reviewSubscriptionPagePrepare()
+
+ def shouldAppear(self):
+ if rhnreg.registered():
+ return False
+ return True
-childWindow = RhnReviewWindow
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_start_gui.py
b/client/rhel/rhn-client-tools/src/firstboot/rhn_start_gui.py
index 0a587c2..2346b20 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_start_gui.py
+++ b/client/rhel/rhn-client-tools/src/firstboot/rhn_start_gui.py
@@ -1,4 +1,4 @@
-# Copyright 2006 Red Hat, Inc.
+# Copyright 2006--2010 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,56 +15,64 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors:
+# Jan Pazdziora jpazdziora at redhat dot com
# Daniel Benamy <dbenamy(a)redhat.com>
-import os
import sys
-sys.path.append("/usr/share/rhn/up2date_client/")
sys.path.append("/usr/share/rhn")
-import rhnreg
-import rhnregGui
-from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+from up2date_client import rhnreg
+from up2date_client import rhnregGui
import gtk
from gtk import glade
+
import gettext
-_ = gettext.gettext
+_ = lambda x: gettext.ldgettext("rhn-client-tools", x)
-gettext.textdomain("rhn-client-tools")
gtk.glade.bindtextdomain("rhn-client-tools")
+from firstboot.module import Module
+from firstboot.constants import *
-class RhnStartWindow(RhnRegisterFirstbootGuiWindow):
- runPriority=106
- moduleName = _("Set Up Software Updates")
- windowTitle = moduleName
- shortMessage = _("Register with Red Hat Network")
- needsparent = 1
-
+from firstboot.loader import _haveNetwork
+
+class moduleClass(Module):
def __init__(self):
- RhnRegisterFirstbootGuiWindow.__init__(self)
- self.start_page = None
+ Module.__init__(self)
+ self.priority = 106
+ self.sidebarTitle = _("Set Up Software Updates")
+ self.title = _("Set Up Software Updates")
+
+ def apply(self, interface, testing=False):
+ if testing:
+ return RESULT_SUCCESS
+
+ if not self.start_page.startPageRegisterNow():
+ dlg = rhnregGui.ConfirmQuitDialog()
+ if dlg.rc == 0:
+ return RESULT_FAILURE
+ else:
+ interface.moveToPage(moduleTitle=_("Finish Updates Setup"))
+ return RESULT_JUMP
+ return RESULT_SUCCESS
+
+ def createScreen(self):
+ self.vbox = gtk.VBox(spacing=5)
+ self.vbox.pack_start(self._getVbox(), True, True)
+
+ def initializeUI(self):
+ pass
def _getVbox(self):
if rhnreg.registered():
self.start_page = KsRegisteredPage()
return self.start_page.startPageVbox()
- if self.parent.checkNetwork():
+ if _haveNetwork():
self.start_page = rhnregGui.StartPage(firstboot=True)
else:
self.start_page = NoNetworkPage()
return self.start_page.startPageVbox()
- def apply(self, *args):
- """Returns True to change the page (to the one
set)."""
- if not self.start_page.startPageRegisterNow():
- dlg = rhnregGui.ConfirmQuitDialog()
- if not dlg.rc:
- self.parent.setPage("rhn_start_gui")
- else:
- self.parent.setPage("rhn_finish_gui")
- return True
-
class KsRegisteredPage:
def __init__(self):
@@ -102,4 +110,3 @@ class NoNetworkPage:
def why_register_button_clicked(self, button):
rhnregGui.WhyRegisterDialog()
-childWindow = RhnStartWindow
commit 945391d1501aa5987cc4dff365533f665795ba2a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 25 15:36:50 2010 +0200
585188 - only install legacy firstboot on RHEL 5 (and earlier), the new firstboot for
other systems.
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 25c8dc0..4b4ee3f 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -116,6 +116,12 @@ rm $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/hardware_hal.*
rm $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/hardware_gudev.*
%endif
+%if 0%{?rhel} < 6
+rm -rf $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/firstboot
+%else
+rm -rf $RPM_BUILD_ROOT%{_datadir}/firstboot/modules
+%endif
+
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications --vendor=rhn
rhn_register.desktop
%if 0%{?suse_version}
%suse_update_desktop_file rhn_register System
@@ -252,6 +258,8 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/icons/hicolor/32x32/apps/up2date.png
%{_datadir}/icons/hicolor/48x48/apps/up2date.png
%{_datadir}/applications/rhn_register.desktop
+
+%if 0%{?rhel} < 6
%{_datadir}/firstboot/modules/rhn_login_gui.*
%{_datadir}/firstboot/modules/rhn_register_firstboot_gui_window.*
%{_datadir}/firstboot/modules/rhn_start_gui.*
@@ -260,6 +268,16 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/firstboot/modules/rhn_create_profile_gui.*
%{_datadir}/firstboot/modules/rhn_review_gui.*
%{_datadir}/firstboot/modules/rhn_finish_gui.*
+%else
+%{_datadir}/rhn/up2date_client/firstboot/rhn_login_gui.*
+%{_datadir}/rhn/up2date_client/firstboot/rhn_register_firstboot_gui_window.*
+%{_datadir}/rhn/up2date_client/firstboot/rhn_start_gui.*
+%{_datadir}/rhn/up2date_client/firstboot/rhn_choose_server_gui.*
+%{_datadir}/rhn/up2date_client/firstboot/rhn_provide_certificate_gui.*
+%{_datadir}/rhn/up2date_client/firstboot/rhn_create_profile_gui.*
+%{_datadir}/rhn/up2date_client/firstboot/rhn_review_gui.*
+%{_datadir}/rhn/up2date_client/firstboot/rhn_finish_gui.*
+%endif
%changelog
* Wed May 05 2010 Jan Pazdziora 1.1.3-1
commit 07068b19b2704250d19370fa9ff8edafae358ce1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 25 14:28:20 2010 +0200
585188 - the firstboot modules for RHEL 5 shall retire in firstboot-legacy-rhel5.
The current firstboot modules are not compatible with latest Fedoras and
future RHEL 6. However, to still have a way to build firstboot for RHEL 5,
we will hold those modules in separate directory until they are no longer
needed.
diff --git a/client/rhel/rhn-client-tools/src/Makefile
b/client/rhel/rhn-client-tools/src/Makefile
index 62ea30c..90faa0c 100644
--- a/client/rhel/rhn-client-tools/src/Makefile
+++ b/client/rhel/rhn-client-tools/src/Makefile
@@ -6,7 +6,7 @@ PREFIX ?=
VERSION ?=
# Dirs we need to walk into
-SUBDIRS = up2date_client actions firstboot bin
+SUBDIRS = up2date_client actions firstboot firstboot-legacy-rhel5 bin
# For subdirs, required exports
export PREFIX
diff --git a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile
new file mode 100644
index 0000000..bbd6365
--- /dev/null
+++ b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile
@@ -0,0 +1,41 @@
+# Makefile for installing man pages for the up2date client
+#
+# $Id$
+
+MODULES = rhn_login_gui \
+ rhn_register_firstboot_gui_window \
+ rhn_start_gui rhn_choose_server_gui \
+ rhn_provide_certificate_gui rhn_create_profile_gui \
+ rhn_review_gui rhn_finish_gui
+PYFILES = $(addsuffix .py, $(MODULES))
+OBJECTS = $(PYFILES) $(addsuffix .pyc, $(MODULES))
+
+# Install stuff
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = $(INSTALL) -m 644
+INSTALL_DIR = $(INSTALL) -m 755 --verbose -d
+
+# Install Directories
+FIRSTBOOTDIR = $(PREFIX)/usr/share/firstboot/modules/
+
+
+PYCHECKER = /usr/bin/pychecker
+
+all:: $(OBJECTS)
+
+# default compile rule:
+%.pyc: %.py
+ python -c "import py_compile; py_compile.compile('$<')"
+
+install: all $(FIRSTBOOTDIR)
+ $(INSTALL_DATA) $(OBJECTS) $(FIRSTBOOTDIR)/
+
+$(FIRSTBOOTDIR) :
+ @$(INSTALL_DIR) $@
+
+clean:
+ @rm -rf *.pyc *~ .*~ *.o
+
+pychecker::
+ @$(PYCHECKER) $(PYFILES) || exit 0
+
diff --git
a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_server_gui.py
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_server_gui.py
new file mode 100644
index 0000000..83f88ab
--- /dev/null
+++ b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_server_gui.py
@@ -0,0 +1,72 @@
+# Copyright 2006 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# Authors:
+# Daniel Benamy <dbenamy(a)redhat.com>
+
+import os
+import sys
+sys.path.append("/usr/share/rhn/up2date_client/")
+sys.path.append("/usr/share/rhn")
+import rhnreg
+import rhnregGui
+import up2dateErrors
+from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+
+import gtk
+from gtk import glade
+import gettext
+_ = gettext.gettext
+
+gettext.textdomain("rhn-client-tools")
+gtk.glade.bindtextdomain("rhn-client-tools")
+
+
+class RhnChooseServerWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.ChooseServerPage):
+ runPriority=106.5
+ moduleName = _("Choose Server")
+ windowTitle = moduleName
+ shortMessage = _("Choose a Red Hat Network server")
+ needsparent = 1
+ needsnetwork = 1
+ noSidebar = True
+
+ def __init__(self):
+ RhnRegisterFirstbootGuiWindow.__init__(self)
+ rhnregGui.ChooseServerPage.__init__(self)
+ if rhnreg.registered():
+ self.skipme = True
+
+ def _getVbox(self):
+ return self.chooseServerPageVbox()
+
+ def updatePage(self):
+ self.chooseServerPagePrepare()
+
+ def apply(self, *args):
+ """Returns True to change the page (to the one
set)."""
+ try:
+ if self.chooseServerPageApply() is False:
+ self.parent.setPage("rhn_login_gui")
+ return True
+ else:
+ return None
+ except up2dateErrors.SSLCertificateVerifyFailedError:
+ self.parent.setPage("rhn_provide_certificate_gui")
+ return True
+
+
+childWindow = RhnChooseServerWindow
diff --git
a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_create_profile_gui.py
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_create_profile_gui.py
new file mode 100644
index 0000000..e49b520
--- /dev/null
+++ b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_create_profile_gui.py
@@ -0,0 +1,79 @@
+# rhn_register.py - GUI front end code for firstboot screen resolution
+#
+# Copyright 2003 Red Hat, Inc.
+# Copyright 2003 Brent Fox <bfox(a)redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+import gtk
+import gobject
+import sys
+import os
+import functions
+
+import gnome, gnome.ui
+from gtk import glade
+
+from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+sys.path.insert(0, "/usr/share/rhn/up2date_client/")
+sys.path.insert(1,"/usr/share/rhn")
+
+import rhnreg
+import rhnregGui
+import up2dateErrors
+import messageWindow
+
+import gettext
+_ = gettext.gettext
+gettext.textdomain("rhn-client-tools")
+gtk.glade.bindtextdomain("rhn-client-tools")
+
+
+class RhnCreateProfileWindow(RhnRegisterFirstbootGuiWindow,
rhnregGui.CreateProfilePage):
+ #You must specify a runPriority for the order in which you wish your module to run
+ runPriority = 108.7
+ moduleName = _("Create Profile")
+ windowTitle = moduleName
+ shortMessage = _("Connect to Red Hat Network")
+ needsparent = 1
+ needsnetwork = 1
+ noSidebar = True
+
+ def __init__(self):
+ RhnRegisterFirstbootGuiWindow.__init__(self)
+ rhnregGui.CreateProfilePage.__init__(self)
+ if rhnreg.registered():
+ self.skipme = True
+
+ def updatePage(self):
+ self.createProfilePagePrepare()
+
+ def _getVbox(self):
+ return self.createProfilePageVbox()
+
+ def apply(self, *args):
+
+ ret = self.createProfilePageVerify()
+ if ret:
+ return None
+
+ ret = self.createProfilePageApply()
+ if ret:
+ return None
+
+ return True
+
+childWindow = RhnCreateProfileWindow
diff --git a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_finish_gui.py
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_finish_gui.py
new file mode 100644
index 0000000..fa4c6ce
--- /dev/null
+++ b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_finish_gui.py
@@ -0,0 +1,77 @@
+# Copyright 2006 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# Authors:
+# Daniel Benamy <dbenamy(a)redhat.com>
+
+import sys
+sys.path.append("/usr/share/rhn/up2date_client/")
+sys.path.append("/usr/share/rhn")
+import rhnreg
+import rhnregGui
+from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+import config
+
+import gtk
+from gtk import glade
+import gettext
+_ = gettext.gettext
+
+gettext.textdomain("rhn-client-tools")
+gtk.glade.bindtextdomain("rhn-client-tools")
+
+
+class RhnFinishWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.FinishPage):
+ runPriority=109
+ moduleName = _("Finish Updates Setup")
+ windowTitle = moduleName
+ shortMessage = _("Connect to Red Hat Network")
+ needsparent = 1
+ needsnetwork = 1
+ noSidebar = True
+
+ def __init__(self):
+ RhnRegisterFirstbootGuiWindow.__init__(self)
+ rhnregGui.FinishPage.__init__(self)
+ if rhnreg.registered():
+ self.skipme = True
+
+ def _getVbox(self):
+ return self.finishPageVbox()
+
+ def updatePage(self):
+## if rhnregGui.hasBaseChannelAndUpdates():
+## self.druid.finish.set_label(_("_Finish"))
+## title = _("Finish setting up software updates")
+## else:
+## self.druid.finish.set_label(_("_Exit registration process"))
+## title = _("Registration unsuccessful")
+ self.finishPagePrepare()
+## self.mainWin.set_title(title)
+## self.finishPage.set_title(title)
+
+ def apply(self, *args):
+ """Returns None to stay on the same page. Anything else will cause
+ firstboot to advance but True is generally used. This is different from
+ the gnome druid in rhn_register.
+
+ """
+ up2DateConfig = config.initUp2dateConfig()
+ up2DateConfig.save()
+ return True
+
+
+childWindow = RhnFinishWindow
diff --git a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_login_gui.py
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_login_gui.py
new file mode 100644
index 0000000..6fea3ab
--- /dev/null
+++ b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_login_gui.py
@@ -0,0 +1,131 @@
+# rhn_register.py - GUI front end code for firstboot screen resolution
+#
+# Copyright 2003 Red Hat, Inc.
+# Copyright 2003 Brent Fox <bfox(a)redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+import gtk
+import gobject
+import sys
+import os
+import functions
+
+import gnome, gnome.ui
+from gtk import glade
+
+from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+sys.path.insert(0, "/usr/share/rhn/up2date_client/")
+sys.path.insert(1,"/usr/share/rhn")
+
+import rhnreg
+import rhnregGui
+import up2dateErrors
+import messageWindow
+
+
+##
+## I18N
+##
+import gettext
+_ = gettext.gettext
+
+gettext.textdomain("rhn-client-tools")
+gtk.glade.bindtextdomain("rhn-client-tools", "/usr/share/locale")
+
+
+
+class RhnLoginWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.LoginPage):
+ #You must specify a runPriority for the order in which you wish your module to run
+ runPriority = 108
+ moduleName = _("Red Hat Login")
+ windowTitle = moduleName
+ shortMessage = _("Register with Red Hat Network")
+ needsparent = 1
+ needsnetwork = 1
+ noSidebar = True
+
+ def __init__(self):
+ RhnRegisterFirstbootGuiWindow.__init__(self)
+ rhnregGui.LoginPage.__init__(self)
+ if rhnreg.registered():
+ self.skipme = True
+
+ def updatePage(self):
+# self.getCaps()
+ self.loginPagePrepare()
+ self.goingNextFromNewAccountDialog = False
+
+ def grabFocus(self):
+ # We must set focus where we want it here. Setting it in updatePage
+ # doesn't work.
+ self.loginXml.get_widget("loginUserEntry").grab_focus()
+
+ def _getVbox(self):
+ return self.loginPageVbox()
+
+ def apply(self, *args):
+ """Returns None to stay on the same page. Anything else will cause
+ firstboot to advance but True is generally used. This is different from
+ the gnome druid in rhn_register.
+
+ """
+ if self.doDebug:
+ print "applying rhn_login_gui"
+
+ # This is a hack. This function will get called if they click next on
+ # the login page (the else) or when they create an account (the if). In
+ # that case we don't want to do the normal logging in stuff.
+ if self.goingNextFromNewAccountDialog:
+ assert rhnregGui.newAccount is True
+ else:
+ if self.loginPageVerify():
+ return None
+
+ assert rhnregGui.newAccount is False
+
+ try:
+ ret = self.loginPageApply()
+ # TODO this exception can't reach here right now. ditch it and/or
+ # figure out how we want to provide this functionality.
+ except up2dateErrors.CommunicationError, e:
+ msg = _("There was a communication error with the server: %s" %
e.errmsg)
+ msg = msg + "\n\n" + _("Would you like to try changing the
network configuration and trying again?")
+ dlg = messageWindow.YesNoDialog(msg)
+ ret = dlg.getrc()
+ if ret:
+ return None
+ else:
+ self.parent.setPage("rhn_finish_gui")
+ if ret:
+ return None
+
+ # We should try to activate hardware, even if no EUS in firstboot
+ rhnregGui.try_to_activate_hardware()
+
+ self.parent.setPage('rhn_create_profile_gui')
+ return True
+
+ def goToPageAfterLogin(self):
+ # This is a hack. More info above.
+ self.goingNextFromNewAccountDialog = True
+ self.parent.nextClicked()
+
+ def onLoginPageNext(self, dummy=None, dummy2=None):
+ # This is a hackish way to support enter advancing
+ self.parent.nextClicked()
+
+childWindow = RhnLoginWindow
diff --git
a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_provide_certificate_gui.py
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_provide_certificate_gui.py
new file mode 100644
index 0000000..319d29a
--- /dev/null
+++
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_provide_certificate_gui.py
@@ -0,0 +1,71 @@
+# Copyright 2006 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# Authors:
+# Daniel Benamy <dbenamy(a)redhat.com>
+
+import os
+import sys
+sys.path.append("/usr/share/rhn/up2date_client/")
+sys.path.append("/usr/share/rhn")
+import rhnreg
+import rhnregGui
+import up2dateErrors
+from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+
+import gtk
+from gtk import glade
+import gettext
+_ = gettext.gettext
+
+gettext.textdomain("rhn-client-tools")
+gtk.glade.bindtextdomain("rhn-client-tools")
+
+
+class RhnProvideCertificateWindow(RhnRegisterFirstbootGuiWindow,
rhnregGui.ProvideCertificatePage):
+ runPriority=107
+ moduleName = _("Provide Certificate")
+ windowTitle = moduleName
+ shortMessage = _("Provide a certificate for this Red Hat Network server")
+ needsparent = 1
+ needsnetwork = 1
+ noSidebar = True
+
+ def __init__(self):
+ RhnRegisterFirstbootGuiWindow.__init__(self)
+ rhnregGui.ProvideCertificatePage.__init__(self)
+ if rhnreg.registered():
+ self.skipme = True
+
+ def _getVbox(self):
+ return self.provideCertificatePageVbox()
+
+ def apply(self, *args):
+ """Returns True to change the page or None to stay on the same
page."""
+ status = self.provideCertificatePageApply()
+ if status == 0: # cert was installed
+ return True
+ elif status == 1: # the user doesn't want to provide a cert right now
+ # TODO write a message to disk like the other cases? need to decide
+ # how we want to do error handling in general.
+ self.parent.setPage("rhn_finish_gui")
+ return True
+ else: # an error occurred and the user was notified
+ assert status == 2
+ return None
+
+
+childWindow = RhnProvideCertificateWindow
diff --git
a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_register_firstboot_gui_window.py
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_register_firstboot_gui_window.py
new file mode 100644
index 0000000..60725ac
--- /dev/null
+++
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_register_firstboot_gui_window.py
@@ -0,0 +1,108 @@
+import functions # firstboot stuff
+import os
+import sys
+import gtk
+
+from firstboot_module_window import FirstbootModuleWindow
+
+sys.path.append("/usr/share/rhn/up2date_client/")
+sys.path.append("/usr/share/rhn")
+import messageWindow
+import rhnregGui
+
+class RhnRegisterFirstbootGuiWindow(FirstbootModuleWindow):
+ """This is a base class for our firstboot screens. It shouldn't be
used
+ directly.
+
+ """
+ needsparent = 1
+
+ def __init__(self):
+ FirstbootModuleWindow.__init__(self)
+ self.doDebug = False
+ # Variables that fb windows need to define
+ assert hasattr(self, 'runPriority')
+ assert hasattr(self, 'moduleName')
+ assert hasattr(self, 'windowTitle')
+ assert hasattr(self, 'shortMessage')
+ assert hasattr(self, 'needsparent')
+ # Method to provide the screen contents
+ assert hasattr(self, '_getVbox')
+
+ def passInParent(self,parent):
+ self.parent = parent
+
+ def getNext(self):
+ pass
+
+ def launch(self, doDebug=None):
+ """Firstboot calls this to set up the screen. It will use the
_getVbox
+ method provided by the derived classes to get the contents of the
+ screen.
+
+ """
+ self.doDebug = doDebug
+ if self.doDebug:
+ print self.__class__.__name__, "launch called."
+
+ self.icon =
functions.imageFromPath("/usr/share/system-config-display/pixmaps/system-config-display.png")
+ self.mainVBox = gtk.VBox()
+
+ internalVBox = gtk.VBox(False, 10)
+ internalVBox.set_border_width(10)
+
+ vbox = self._getVbox()
+
+ internalVBox.pack_start(vbox, True)
+ self.mainVBox.pack_start(internalVBox, True)
+
+ # Set up cursor changing functions. Overriding functions that aren't in
+ # classes like this could be called a hack, but I think it's the best
+ # we can do with the current overall setup and isn't too bad.
+ # Having it here will cause this to get called once per module, but I'm
+ # not sure if it'll work to put it in the constructor.
+ def mySetBusyCursor():
+ cursor = gtk.gdk.Cursor(gtk.gdk.WATCH)
+ # I think we have to set the cursor using firstboot's .window instead of
+ # the one in our vboxes because the thing we use must be displayed when
+ # we change the cursor and sometimes this gets called by a screen before
+ # it's visible.
+ # TODO See if we can add functions to firstboot to provide a nice way to
+ # change the cursor.
+ self.parent.win.window.set_cursor(cursor)
+ while gtk.events_pending():
+ gtk.main_iteration(False)
+ def mySetArrowCursor():
+ # I think we have to set the cursor using firstboot's .window instead of
+ # the one in our vboxes because the thing we use must be displayed when
+ # we change the cursor and sometimes this gets called by a screen before
+ # it's visible.
+ self.parent.win.window.set_cursor(None)
+ while gtk.events_pending():
+ gtk.main_iteration(False)
+ rhnregGui.setBusyCursor = mySetBusyCursor
+ rhnregGui.setArrowCursor = mySetArrowCursor
+
+ return self.mainVBox, self.icon, self.windowTitle
+
+ def grabFocus(self):
+ if self.doDebug:
+ print self.__class__.__name__, "grabFocus called."
+ pass
+
+ def fatalError(self, error, wrap=1):
+ # FIXME
+ if wrap:
+ text = messageWindow.wrap_text(error)
+ else:
+ text = error
+ dlg = messageWindow.ErrorDialog(text)
+ self._goImmediatelyToFinish()
+
+ def _goImmediatelyToFinish(self):
+ self.parent.setPage("rhn_finish_gui")
+ def dummyApply(self, *args):
+ print "dummy"
+ return True
+ self.apply = dummyApply
+ self.parent.nextClicked()
diff --git a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_review_gui.py
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_review_gui.py
new file mode 100644
index 0000000..982a67f
--- /dev/null
+++ b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_review_gui.py
@@ -0,0 +1,66 @@
+# Copyright 2006 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# Authors:
+# Daniel Benamy <dbenamy(a)redhat.com>
+
+import sys
+sys.path.append("/usr/share/rhn/up2date_client/")
+sys.path.append("/usr/share/rhn")
+import rhnreg
+import rhnregGui
+from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+
+import gtk
+from gtk import glade
+import gettext
+_ = gettext.gettext
+
+gettext.textdomain("rhn-client-tools")
+gtk.glade.bindtextdomain("rhn-client-tools")
+
+
+class RhnReviewWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.ReviewSubscriptionPage):
+ runPriority=108.9
+ moduleName = _("Review Subscription")
+ windowTitle = moduleName
+ shortMessage = _("Connect to Red Hat Network")
+ needsparent = 1
+ needsnetwork = 1
+ noSidebar = True
+
+ def __init__(self):
+ RhnRegisterFirstbootGuiWindow.__init__(self)
+ rhnregGui.ReviewSubscriptionPage.__init__(self)
+ if rhnreg.registered():
+ self.skipme = True
+
+ def _getVbox(self):
+ return self.reviewSubscriptionPageVbox()
+
+ def updatePage(self):
+ self.reviewSubscriptionPagePrepare()
+
+ def apply(self, *args):
+ """Returns None to stay on the same page. Anything else will cause
+ firstboot to advance but True is generally used. This is different from
+ the gnome druid in rhn_register.
+
+ """
+ return True
+
+
+childWindow = RhnReviewWindow
diff --git a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_start_gui.py
b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_start_gui.py
new file mode 100644
index 0000000..0a587c2
--- /dev/null
+++ b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_start_gui.py
@@ -0,0 +1,105 @@
+# Copyright 2006 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# Authors:
+# Daniel Benamy <dbenamy(a)redhat.com>
+
+import os
+import sys
+sys.path.append("/usr/share/rhn/up2date_client/")
+sys.path.append("/usr/share/rhn")
+import rhnreg
+import rhnregGui
+from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
+
+import gtk
+from gtk import glade
+import gettext
+_ = gettext.gettext
+
+gettext.textdomain("rhn-client-tools")
+gtk.glade.bindtextdomain("rhn-client-tools")
+
+
+class RhnStartWindow(RhnRegisterFirstbootGuiWindow):
+ runPriority=106
+ moduleName = _("Set Up Software Updates")
+ windowTitle = moduleName
+ shortMessage = _("Register with Red Hat Network")
+ needsparent = 1
+
+ def __init__(self):
+ RhnRegisterFirstbootGuiWindow.__init__(self)
+ self.start_page = None
+
+ def _getVbox(self):
+ if rhnreg.registered():
+ self.start_page = KsRegisteredPage()
+ return self.start_page.startPageVbox()
+ if self.parent.checkNetwork():
+ self.start_page = rhnregGui.StartPage(firstboot=True)
+ else:
+ self.start_page = NoNetworkPage()
+ return self.start_page.startPageVbox()
+
+ def apply(self, *args):
+ """Returns True to change the page (to the one
set)."""
+ if not self.start_page.startPageRegisterNow():
+ dlg = rhnregGui.ConfirmQuitDialog()
+ if not dlg.rc:
+ self.parent.setPage("rhn_start_gui")
+ else:
+ self.parent.setPage("rhn_finish_gui")
+ return True
+
+class KsRegisteredPage:
+
+ def __init__(self):
+ gladefile = "/usr/share/rhn/up2date_client/rh_register.glade"
+ ksRegisteredXml = gtk.glade.XML(gladefile,
"ksRegisteredFirstbootVbox",
+ domain="rhn-client-tools")
+ self.vbox = ksRegisteredXml.get_widget('ksRegisteredFirstbootVbox')
+
+ def startPageVbox(self):
+ return self.vbox
+
+ def startPageRegisterNow(self):
+ return True
+
+
+class NoNetworkPage:
+
+ def __init__(self):
+ gladefile = "/usr/share/rhn/up2date_client/rh_register.glade"
+ noNetworkXml = gtk.glade.XML(gladefile, "noNetworkFirstbootVbox",
+ domain="rhn-client-tools")
+ self.vbox = noNetworkXml.get_widget('noNetworkFirstbootVbox')
+ noNetworkXml.signal_autoconnect({
+ "on_whyRegisterButton_clicked" : self.why_register_button_clicked,
+ })
+
+ def startPageVbox(self):
+ return self.vbox
+
+ def startPageRegisterNow(self):
+ # Sure, we'll register now. heh heh heh
+ # Just continue on past the rhn stuff.
+ return True
+
+ def why_register_button_clicked(self, button):
+ rhnregGui.WhyRegisterDialog()
+
+childWindow = RhnStartWindow
diff --git a/client/rhel/rhn-client-tools/src/firstboot/Makefile
b/client/rhel/rhn-client-tools/src/firstboot/Makefile
index bbd6365..68fd1ac 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/Makefile
+++ b/client/rhel/rhn-client-tools/src/firstboot/Makefile
@@ -16,7 +16,7 @@ INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = $(INSTALL) -m 755 --verbose -d
# Install Directories
-FIRSTBOOTDIR = $(PREFIX)/usr/share/firstboot/modules/
+FIRSTBOOTDIR = $(PREFIX)/usr/share/rhn/up2date_client/firstboot/
PYCHECKER = /usr/bin/pychecker