def onMainWinApply(self, mainWin): forward_func = { "chooseServerPageVbox": self.onChooseServerPageNext, "loginPageVbox": self.onLoginPageNext, "chooseChannelPageVbox": self.onChooseChannelPageNext, "createProfilePageVbox": self.onCreateProfilePageNext, "provideCertificatePageVbox": self.onProvideCertificatePageNext, } currentVbox = mainWin.get_nth_page(mainWin.get_current_page()) vboxId = getWidgetName(currentVbox) if vboxId in forward_func: forward_func[vboxId](mainWin, None)
def onMainWinApply(self, mainWin): forward_func = { "chooseServerPageVbox" : self.onChooseServerPageNext, "loginPageVbox" : self.onLoginPageNext, "chooseChannelPageVbox" : self.onChooseChannelPageNext, "createProfilePageVbox" : self.onCreateProfilePageNext, "provideCertificatePageVbox" : self.onProvideCertificatePageNext, } currentVbox = mainWin.get_nth_page(mainWin.get_current_page()) vboxId = getWidgetName(currentVbox) if vboxId in forward_func: forward_func[vboxId](mainWin, None)
def onMainWinPrepare(self, mainWin, vbox): prepare_func = { "startPageVbox": self.onStartPagePrepare, "chooseServerPageVbox": self.onChooseServerPagePrepare, "loginPageVbox": self.onLoginPagePrepare, "chooseChannelPageVbox": self.onChooseChannelPagePrepare, "createProfilePageVbox": self.onCreateProfilePagePrepare, "reviewSubscriptionPageVbox": self.onReviewSubscriptionPagePrepare, "finishPageVbox": self.onFinishPagePrepare, } vboxId = getWidgetName(vbox) if vboxId in prepare_func: prepare_func[vboxId](mainWin, vbox)
def onMainWinPrepare(self, mainWin, vbox): prepare_func = { "startPageVbox": self.onStartPagePrepare, "chooseServerPageVbox" : self.onChooseServerPagePrepare, "loginPageVbox" : self.onLoginPagePrepare, "chooseChannelPageVbox" : self.onChooseChannelPagePrepare, "createProfilePageVbox" : self.onCreateProfilePagePrepare, "reviewSubscriptionPageVbox" : self.onReviewSubscriptionPagePrepare, "finishPageVbox" : self.onFinishPagePrepare, } vboxId = getWidgetName(vbox) if vboxId in prepare_func: prepare_func[vboxId](mainWin, vbox)
def __init__(self): self.cfg = config.initUp2dateConfig() gladeFile = "/usr/share/rhn/up2date_client/gui.glade" self.xml = gtk.glade.XML(gladeFile, "mainWin", domain="rhn-client-tools") self.xml.signal_autoconnect({ "onMainWinCancel": self.onMainWinCancel, "onMainWinPrepare": self.onMainWinPrepare, "onMainWinApply": self.onMainWinApply, }) rhnregGui.StartPage.__init__(self) rhnregGui.ChooseServerPage.__init__(self) rhnregGui.LoginPage.__init__(self) rhnregGui.ChooseChannelPage.__init__(self) rhnregGui.CreateProfilePage.__init__(self) rhnregGui.ReviewSubscriptionPage.__init__(self) rhnregGui.ProvideCertificatePage.__init__(self) rhnregGui.FinishPage.__init__(self) # Pack all the pages into the empty druid screens contents = self.startPageVbox() container = self.xml.get_widget("startPageVbox") container.pack_start(contents, True, True, 0) contents = self.chooseServerPageVbox() container = self.xml.get_widget("chooseServerPageVbox") container.pack_start(contents, True, True, 0) contents = self.loginPageVbox() container = self.xml.get_widget("loginPageVbox") container.pack_start(contents, True, True, 0) contents = self.chooseChannelPageVbox() container = self.xml.get_widget("chooseChannelPageVbox") container.pack_start(contents, True, True, 0) self.chooseChannelPageVbox = container contents = self.createProfilePageVbox() container = self.xml.get_widget("createProfilePageVbox") container.pack_start(contents, True, True, 0) contents = self.reviewSubscriptionPageVbox() container = self.xml.get_widget("reviewSubscriptionPageVbox") container.pack_start(contents, True, True, 0) contents = self.provideCertificatePageVbox() container = self.xml.get_widget("provideCertificatePageVbox") container.pack_start(contents, True, True, 0) self.provideCertificatePageVbox = container contents = self.finishPageVbox() container = self.xml.get_widget("finishPageVbox") container.pack_start(contents, True, True, 0) self.initProfile = False self.oemInfo = {} self.productInfo = {} self.already_registered_already_shown = False self.rhsm_already_registered_already_shown = False self.mainWin = self.xml.get_widget("mainWin") self.mainWin.connect("delete-event", gtk.main_quit) self.mainWin.connect("hide", gtk.main_quit) self.mainWin.connect("close", gtk.main_quit) self.pages = dict([(getWidgetName(self.mainWin.get_nth_page(n)), n) for n in range(self.mainWin.get_n_pages())]) # 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. def mySetBusyCursor(): setCursor(self.mainWin, gtk.CURSOR_WATCH) def mySetArrowCursor(): setCursor(self.mainWin, gtk.CURSOR_LEFT_PTR) rhnregGui.setBusyCursor = mySetBusyCursor rhnregGui.setArrowCursor = mySetArrowCursor self.mainWin.show_all() # GtkAssistant doesn't signal prepare to the first page when starting up self.onStartPagePrepare(None, None, manualPrepare=True)
def __init__(self): self.cfg = config.initUp2dateConfig() gladeFile = "/usr/share/rhn/up2date_client/gui.glade" self.xml = gtk.glade.XML(gladeFile, "mainWin", domain="rhn-client-tools") self.xml.signal_autoconnect ( { "onMainWinCancel" : self.onMainWinCancel, "onMainWinPrepare" : self.onMainWinPrepare, "onMainWinApply" : self.onMainWinApply, } ) rhnregGui.StartPage.__init__(self) rhnregGui.ChooseServerPage.__init__(self) rhnregGui.LoginPage.__init__(self) rhnregGui.ChooseChannelPage.__init__(self) rhnregGui.CreateProfilePage.__init__(self) rhnregGui.ReviewSubscriptionPage.__init__(self) rhnregGui.ProvideCertificatePage.__init__(self) rhnregGui.FinishPage.__init__(self) # Pack all the pages into the empty druid screens contents = self.startPageVbox() container = self.xml.get_widget("startPageVbox") container.pack_start(contents, True, True, 0) contents = self.chooseServerPageVbox() container = self.xml.get_widget("chooseServerPageVbox") container.pack_start(contents, True, True, 0) contents = self.loginPageVbox() container = self.xml.get_widget("loginPageVbox") container.pack_start(contents, True, True, 0) contents = self.chooseChannelPageVbox() container = self.xml.get_widget("chooseChannelPageVbox") container.pack_start(contents, True, True, 0) self.chooseChannelPageVbox = container contents = self.createProfilePageVbox() container = self.xml.get_widget("createProfilePageVbox") container.pack_start(contents, True, True, 0) contents = self.reviewSubscriptionPageVbox() container = self.xml.get_widget("reviewSubscriptionPageVbox") container.pack_start(contents, True, True, 0) contents = self.provideCertificatePageVbox() container = self.xml.get_widget("provideCertificatePageVbox") container.pack_start(contents, True, True, 0) self.provideCertificatePageVbox = container contents = self.finishPageVbox() container = self.xml.get_widget("finishPageVbox") container.pack_start(contents, True, True, 0) self.initProfile = False self.oemInfo = {} self.productInfo = {} self.already_registered_already_shown = False self.rhsm_already_registered_already_shown = False self.mainWin = self.xml.get_widget("mainWin") self.mainWin.connect("delete-event", gtk.main_quit) self.mainWin.connect("hide", gtk.main_quit) self.mainWin.connect("close", gtk.main_quit) self.pages = dict([(getWidgetName(self.mainWin.get_nth_page(n)), n) for n in range(self.mainWin.get_n_pages())]) # 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. def mySetBusyCursor(): setCursor(self.mainWin, gtk.CURSOR_WATCH) def mySetArrowCursor(): setCursor(self.mainWin, gtk.CURSOR_LEFT_PTR) rhnregGui.setBusyCursor = mySetBusyCursor rhnregGui.setArrowCursor = mySetArrowCursor self.mainWin.show_all() # GtkAssistant doesn't signal prepare to the first page when starting up self.onStartPagePrepare(None, None, manualPrepare=True)