Beispiel #1
0
    def __init__(self, td=None):
        QtGui.QMainWindow.__init__(self)
        self.td = td or datetime.date.today()
        self.initDB()
        login = LoginPage()
        if login.exec_():
            self.user = User(str(login.username.text()))
            self.initFromDB()
            self.createAction()
            self.createMenu()
            self.createPageWidgets()

            p = QtGui.QPalette()
            p.setColor(p.Background, ColorBackground)
            p.setColor(p.WindowText, ColorHighlightText)
            self.setPalette(p)

            layout = QtGui.QHBoxLayout()
            self.centralWidget = QtGui.QWidget()
            self.centralWidget.setLayout(layout)
            self.setCentralWidget(self.centralWidget)
            self.treecontrol = TreeControl()
            self.treecontrol.clickSignal.connect(self.switchLayout)
            layout.addWidget(self.treecontrol)
            layout.addLayout(self.stackedLayout)

            self.resize(800, 600)
            self.setWindowTitle(u'家族信托投资管理平台 - {0}'.format(self.user.name))
            self.setWindowIcon(QtGui.QIcon(r'icon/main.png'))

            self.statusBar().showMessage(u'准备就绪')
            self.show()
        else:
            QtGui.qApp.quit()
Beispiel #2
0
    def __init__(self):
        super(Desktop, self).__init__()
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.initDB()
        login = LoginPage()
        if login.exec_():
            self.user = env.User(str(login.username.text()))
            self.initFromDB()
            self.log = LogPanel()
            self.logstream = LogStream()
            self.logstream.message.connect(self.log.on_stream_update)
            sys.stdout = self.logstream

            self.sysdate = QtGui.QDateEdit(datetime.date.today())
            self.sysdate.setCalendarPopup(True)
            self.sysdate.setFixedWidth(120)
            self.sysdate.dateChanged.connect(self.on_sysdate_change)
            self.sysdate.setToolTip(u'系统日期')

            self.createAction()
            self.createMenu()
            self.createSystemTray()

            layout = QtGui.QGridLayout()
            self.centralWidget = QtGui.QWidget()
            self.centralWidget.setLayout(layout)
            self.setCentralWidget(self.centralWidget)
            self.treecontrol = TreeControl()
            self.treecontrol.clickSignal.connect(self.switchLayout)
            self.createPages()
            self.topLayout = QtGui.QHBoxLayout()

            self.topLayout.addWidget(self.sysdate,
                                     alignment=QtCore.Qt.AlignLeft)
            layout.addLayout(self.topLayout, 0, 0, 1, 7)
            layout.addWidget(self.treecontrol, 1, 0, 20, 1)
            layout.addLayout(self.stackedLayout, 1, 1, 20, 6)

            self.centralWidget = QtGui.QWidget()
            self.centralWidget.setLayout(layout)
            self.setCentralWidget(self.centralWidget)
            self.resize(800, 600)
            self.setWindowTitle(u'固定收益部交易管理平台 - {0}'.format(self.user.name))
            self.setWindowIcon(QtGui.QIcon(env.sysIcon))

            self.show()
            self.statusBar().showMessage(u'启动万得链接...')
            self.wst = WindStartThread()
            self.wst.finished.connect(self.windlaunched)
            self.wst.start()
        else:
            login.close()
            self.close()
            QtGui.qApp.quit()
Beispiel #3
0
    def __init__(self):
        super(Desktop, self).__init__()
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.initDB()
        login = LoginPage()
        if login.exec_():
            self.user = env.User(str(login.username.text()))
            self.initFromDB()
            self.log = LogPanel()
            self.logstream = LogStream()
            self.logstream.message.connect(self.log.on_stream_update)
            sys.stdout = self.logstream

            self.sysdate = QtGui.QDateEdit(datetime.date.today())
            self.sysdate.setCalendarPopup(True)
            self.sysdate.setFixedWidth(120)
            self.sysdate.dateChanged.connect(self.on_sysdate_change)
            self.sysdate.setToolTip(u'系统日期')

            self.createAction()
            self.createMenu()
            self.createSystemTray()

            layout = QtGui.QGridLayout()
            self.centralWidget = QtGui.QWidget()
            self.centralWidget.setLayout(layout)
            self.setCentralWidget(self.centralWidget)
            self.treecontrol = TreeControl()
            self.treecontrol.clickSignal.connect(self.switchLayout)
            self.createPages()
            self.topLayout = QtGui.QHBoxLayout()

            self.topLayout.addWidget(self.sysdate, alignment=QtCore.Qt.AlignLeft)
            layout.addLayout(self.topLayout, 0, 0, 1, 7)
            layout.addWidget(self.treecontrol, 1, 0, 20, 1)
            layout.addLayout(self.stackedLayout, 1, 1, 20, 6)

            self.centralWidget = QtGui.QWidget()
            self.centralWidget.setLayout(layout)
            self.setCentralWidget(self.centralWidget)
            self.resize(800, 600)
            self.setWindowTitle(u'固定收益部交易管理平台 - {0}'.format(self.user.name))
            self.setWindowIcon(QtGui.QIcon(env.sysIcon))

            self.show()
            self.statusBar().showMessage(u'启动万得链接...')
            self.wst = WindStartThread()
            self.wst.finished.connect(self.windlaunched)
            self.wst.start()
        else:
            login.close()
            self.close()
            QtGui.qApp.quit()
Beispiel #4
0
    def logout(self):
        """
        Clicks the 'logout' button. Returns :class:`LoginPage`.

        ..warning::

            Since login isn't done anymore, this actually results in
            exiting the server.

        """
        self('logout_button').click()
        from login import LoginPage
        return LoginPage.verify(self.browser, self.port)
Beispiel #5
0
    def logout(self):
        """
        Clicks the 'logout' button. Returns :class:`LoginPage`.

        ..warning::

            Since login isn't done anymore, this actually results in
            exiting the server.

        """
        self('logout_button').click()
        from login import LoginPage
        return LoginPage.verify(self.browser, self.port)
        def getData():
            '''Gets data from entry and registers them'''
            first_name = input_first_name.get()
            last_name = input_last_name.get()
            username = input_username.get()
            password = input_password.get()
            address = input_address.get()
            contact = input_contact.get()
            age = input_age.get()
            self.question = dropdown_security_questions.get()
            question_answer = dropdown_entry.get()
            if first_name and last_name and username and password and age and address and contact and self.question and question_answer:
                try:
                    for i in RegisterPage.security_questions:
                        if i.get('question') == self.question:
                            question_id = i.get('id')
                    res = sql_conn.Register().register(first_name, last_name,
                                                       username, password, age,
                                                       address, contact,
                                                       question_id,
                                                       question_answer)
                    if res:
                        messagebox.showinfo('Success',
                                            'Registered Successfully')

                        # Opens the window for login

                        self.root.withdraw()
                        login_wind = Toplevel(self.root)
                        LoginPage(login_wind)
                    else:
                        messagebox.showerror(
                            'Error',
                            'Something Went Wrong \n Please Try Again Later')
                except Exception as e:
                    messagebox.showerror(
                        title="Error",
                        message='Something went wrong please try again')
            else:
                messagebox.showerror('Error', 'All fields are required')
Beispiel #7
0
    def login(self):

        login_wind = Toplevel(self.root)
        LoginPage(login_wind)
Beispiel #8
0
 def navigate_to_login(self):
     self.root.withdraw()
     from login import LoginPage
     l = LoginPage()
     l.main()
Beispiel #9
0
 def click_login_button(self):
     self.click(10, "css", self._login_button_locator)
     from login import LoginPage
     return LoginPage(self.driver)
 def test_login_chrome(self):
     page = LoginPage()
     page.login(self.driver, "*****@*****.**", "beaukattinti1!")
Beispiel #11
0
 def login(self):
     LoginPage(self.driver).login(self.username, self.password)