On Monday 19 October 2009 09:18:58 pm Paul McNett wrote:
> John wrote:
> > I have been playing with dSecurityManager. And I have it sort of working
> > but I wonder if there is a way to NOT display the form behind the login
> > dialog.
>
> I guess there wasn't a good way, so update to r5476 and then:
>
> cd dabo/dabo
> python dSecurityManager.py
>
> There's some new test code there that should do what you want. Here's the
> test code:
>
> """
> 194 if __name__ == "__main__":
> 195 app = dabo.dApp(MainFormClass=None)
> 196 app.setup()
> 197
> 198 class TestSM(dSecurityManager):
> 199 def validateLogin(self, user, passwd):
> 200 print user, passwd
> 201 if user == "paul" and passwd == "23":
> 202 return True
> 203 return False
> 204
> 205 app.SecurityManager = TestSM()
> 206 if app.SecurityManager.login():
> 207 app.MainForm = dabo.ui.dFormMain()
> 208 app.start()
>
> """
>
> Paul
I'm having trouble working with the new code.
1. there is a blank form that appears behind the login dialog.
Not a beig deal if I can close it - at least hide it.
2. after a valid login I need to close the dialog along with the background
mainform.
But attempting to close the background form also closed the entire app.
Hiding sort of works
3. I need to display my form.
The only way I could open my form was to use the following code.
if __name__ == "__main__":
app = dabo.dApp()
app.setup()
class TestSM(dSecurityManager):
def validateLogin(self, user, passwd):
return True
print user, passwd
if user == "paul" and passwd == "23":
return True
return False
app.SecurityManager = TestSM()
app.Icon = "pes.ico"
app.BasePrefKey = "PesED"
app.setAppInfo("appName", "PES Education")
app.setAppInfo("appShortName", "PES Education")
app.setAppInfo("Icon", "pes.ico")
app.AboutFormClass = PesAbout
if app.SecurityManager.login():
frm = MainForm()
frm.show()
app.start()
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]