SHARE
TWEET

Untitled

a guest May 22nd, 2017 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2. from PyQt4 import QtCore, QtGui
  3. from adminCon import Ui_Form
  4. from commands import Admin_Com
  5.  
  6. class MainWindow(QtGui.QWidget):
  7.     def __init__(self, parent=None):
  8.         QtGui.QWidget.__init__(self, parent)
  9.         self.ui = Ui_Form()
  10.         self.ui.setupUi(self)
  11.         self.admin = Admin_Com()
  12.         self.setWindowTitle('PyMMO User Admin')
  13.                
  14. #        QtCore.QObject.connect(self.ui.newUser, QtCore.SIGNAL("clicked()"), self.newUser)
  15. #        QtCore.QObject.connect(self.ui.changePass, QtCore.SIGNAL("clicked()"), self.changePass)
  16.         QtCore.QObject.connect(self.ui.deleteUser, QtCore.SIGNAL("clicked()"), self.delUser)
  17.         QtCore.QObject.connect(self.ui.quit, QtCore.SIGNAL("clicked()"), app.quit)
  18.  
  19.  
  20.     def clearFields(self):
  21.         self.ui.lineEdit.clear()
  22.         self.ui.password.clear()
  23.        
  24.     def newUser(self):
  25.         passWord = unicode(self.ui.password.text())
  26.         userName = unicode(self.ui.lineEdit.text())
  27.         self.admin.newUser(userName, passWord)
  28.         self.clearFields()
  29.        
  30.     def changePass(self):
  31.         passWord = unicode(self.ui.password.text())
  32.         userName = unicode(self.ui.lineEdit.text())
  33.         self.admin.changePass(userName, passWord)
  34.         self.clearFields()
  35.            
  36.     def delUser(self):
  37.         userName = unicode(self.ui.lineEdit.text())
  38.         self.admin.delUser(userName)
  39.         self.clearFields()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top