|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2016 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the Python side for calling the password manager. |
|
8 """ |
|
9 |
|
10 from __future__ import unicode_literals |
|
11 |
|
12 from PyQt5.QtCore import pyqtSlot, QObject, QByteArray |
|
13 |
|
14 |
|
15 class PasswordManagerJsObject(QObject): |
|
16 """ |
|
17 Class implementing the Python side for calling the password manager. |
|
18 """ |
|
19 def __init__(self, parent=None): |
|
20 """ |
|
21 Constructor |
|
22 |
|
23 @param parent reference to the parent object |
|
24 @type ExternalJsObject |
|
25 """ |
|
26 super(PasswordManagerJsObject, self).__init__(parent) |
|
27 |
|
28 self.__external = parent |
|
29 |
|
30 @pyqtSlot(str, str, str, QByteArray) |
|
31 def formSubmitted(self, urlStr, userName, password, data): |
|
32 """ |
|
33 Public slot passing form data to the password manager. |
|
34 |
|
35 @param urlStr form submission URL |
|
36 @type str |
|
37 @param userName name of the user |
|
38 @type str |
|
39 @param password user password |
|
40 @type str |
|
41 @param data data to be submitted |
|
42 @type QByteArray |
|
43 """ |
|
44 from WebBrowser.WebBrowserWindow import WebBrowserWindow |
|
45 WebBrowserWindow.passwordManager().formSubmitted( |
|
46 urlStr, userName, password, data, self.__external.page()) |