Module rhn_login_gui
[hide private]
[frames] | no frames]

Source Code for Module rhn_login_gui

  1  # rhn_register.py - GUI front end code for firstboot screen resolution 
  2  # 
  3  # Copyright 2003 Red Hat, Inc. 
  4  # Copyright 2003 Brent Fox <bfox@redhat.com> 
  5  # 
  6  # This program is free software; you can redistribute it and/or modify 
  7  # it under the terms of the GNU General Public License as published by 
  8  # the Free Software Foundation; version 2 of the License. 
  9  # 
 10  # This program is distributed in the hope that it will be useful, 
 11  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  # GNU General Public License for more details. 
 14  # 
 15  # You should have received a copy of the GNU General Public License 
 16  # along with this program; if not, write to the Free Software 
 17  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
 18  # 
 19   
 20  import gtk 
 21  import gobject 
 22  import os 
 23  import functions 
 24   
 25  import gnome, gnome.ui 
 26  from gtk import glade 
 27   
 28  from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow 
 29   
 30  from up2date_client import rhnreg 
 31  from up2date_client import rhnregGui 
 32   
 33  import gettext 
 34  t = gettext.translation('rhn-client-tools', fallback=True) 
 35  _ = t.ugettext 
 36  gtk.glade.bindtextdomain("rhn-client-tools", "/usr/share/locale") 
 37   
 38   
 39   
40 -class RhnLoginWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.LoginPage):
41 #You must specify a runPriority for the order in which you wish your module to run 42 runPriority = 108 43 moduleName = _("Red Hat Login") 44 windowTitle = moduleName 45 shortMessage = _("Register with Red Hat Satellite") 46 needsparent = 1 47 needsnetwork = 1 48 noSidebar = True 49
50 - def __init__(self):
51 RhnRegisterFirstbootGuiWindow.__init__(self) 52 rhnregGui.LoginPage.__init__(self) 53 if rhnreg.registered(): 54 self.skipme = True
55
56 - def updatePage(self):
57 # self.getCaps() 58 self.loginPagePrepare() 59 self.goingNextFromNewAccountDialog = False
60
61 - def grabFocus(self):
62 # We must set focus where we want it here. Setting it in updatePage 63 # doesn't work. 64 self.loginXml.get_widget("loginUserEntry").grab_focus()
65
66 - def _getVbox(self):
67 return self.loginPageVbox()
68
69 - def apply(self, *args):
70 """Returns None to stay on the same page. Anything else will cause 71 firstboot to advance but True is generally used. This is different from 72 the gnome druid in rhn_register. 73 74 """ 75 if self.doDebug: 76 print("applying rhn_login_gui") 77 78 # This is a hack. This function will get called if they click next on 79 # the login page (the else) or when they create an account (the if). In 80 # that case we don't want to do the normal logging in stuff. 81 if self.goingNextFromNewAccountDialog: 82 assert rhnregGui.newAccount is True 83 else: 84 if self.loginPageVerify(): 85 return None 86 87 assert rhnregGui.newAccount is False 88 89 if self.loginPageApply(): 90 return None 91 92 # We should try to activate hardware, even if no EUS in firstboot 93 rhnregGui.try_to_activate_hardware() 94 95 self.parent.setPage('rhn_create_profile_gui') 96 return True
97
98 - def goToPageAfterLogin(self):
99 # This is a hack. More info above. 100 self.goingNextFromNewAccountDialog = True 101 self.parent.nextClicked()
102
103 - def onLoginPageNext(self, dummy=None, dummy2=None):
104 # This is a hackish way to support enter advancing 105 self.parent.nextClicked()
106 107 childWindow = RhnLoginWindow 108