Exemple #1
0
from org.csstudio.opibuilder.scriptUtil import PVUtil
from java.lang import System
from org.eclipse.jface.dialogs import MessageDialog

ok = PVUtil.getDouble(pvs[0])
if ok == 1:
    userName = System.getProperty("UserName")
    password = System.getProperty("Password")
    if userName == "admin" and password == "123456":
        widget.setPropertyValue("visible", True)
    else:
        MessageDialog.openError(None, "Error",
                                "The user name or password is wrong!")
        pvs[0].setValue(0)
Exemple #2
0
from org.eclipse.jface.dialogs import MessageDialog
from org.eclipse.jface.window import Window
from SWTLoginDialog import *    
        
    
dialog = LoginDialog(Display.getCurrent().getActiveShell())
a = dialog.open() 
if a == Window.OK:
    info = dialog.getLoginInfo()
    if info[0] == "admin" and info[1]=="123456":
        display.getWidget("SWTLogin").setVisible(True)
    else:
        MessageDialog.openError(None, "Error", "The user name or password you input is wrong!")