9 |
9 |
10 from PyQt4.QtCore import pyqtSlot, Qt, QDateTime, QByteArray |
10 from PyQt4.QtCore import pyqtSlot, Qt, QDateTime, QByteArray |
11 from PyQt4.QtGui import QDialog, QFont, QFontMetrics, QSortFilterProxyModel |
11 from PyQt4.QtGui import QDialog, QFont, QFontMetrics, QSortFilterProxyModel |
12 |
12 |
13 from .CookieModel import CookieModel |
13 from .CookieModel import CookieModel |
14 from .CookieDetailsDialog import CookieDetailsDialog |
|
15 from .CookiesExceptionsDialog import CookiesExceptionsDialog |
|
16 |
14 |
17 from .Ui_CookiesDialog import Ui_CookiesDialog |
15 from .Ui_CookiesDialog import Ui_CookiesDialog |
18 |
16 |
19 |
17 |
20 class CookiesDialog(QDialog, Ui_CookiesDialog): |
18 class CookiesDialog(QDialog, Ui_CookiesDialog): |
94 expires = model.data(model.index(row, 4)).toString("yyyy-MM-dd hh:mm") |
92 expires = model.data(model.index(row, 4)).toString("yyyy-MM-dd hh:mm") |
95 value = bytes( |
93 value = bytes( |
96 QByteArray.fromPercentEncoding(model.data(model.index(row, 5)))).decode() |
94 QByteArray.fromPercentEncoding(model.data(model.index(row, 5)))).decode() |
97 |
95 |
98 if self.__detailsDialog is None: |
96 if self.__detailsDialog is None: |
|
97 from .CookieDetailsDialog import CookieDetailsDialog |
99 self.__detailsDialog = CookieDetailsDialog(self) |
98 self.__detailsDialog = CookieDetailsDialog(self) |
100 self.__detailsDialog.setData(domain, name, path, secure, expires, value) |
99 self.__detailsDialog.setData(domain, name, path, secure, expires, value) |
101 self.__detailsDialog.show() |
100 self.__detailsDialog.show() |
102 |
101 |
103 @pyqtSlot() |
102 @pyqtSlot() |
106 Private slot to add a new exception. |
105 Private slot to add a new exception. |
107 """ |
106 """ |
108 selection = self.cookiesTable.selectionModel().selectedRows() |
107 selection = self.cookiesTable.selectionModel().selectedRows() |
109 if len(selection) == 0: |
108 if len(selection) == 0: |
110 return |
109 return |
|
110 |
|
111 from .CookiesExceptionsDialog import CookiesExceptionsDialog |
111 |
112 |
112 firstSelected = selection[0] |
113 firstSelected = selection[0] |
113 domainSelection = firstSelected.sibling(firstSelected.row(), 0) |
114 domainSelection = firstSelected.sibling(firstSelected.row(), 0) |
114 domain = self.__proxyModel.data(domainSelection, Qt.DisplayRole) |
115 domain = self.__proxyModel.data(domainSelection, Qt.DisplayRole) |
115 dlg = CookiesExceptionsDialog(self.__cookieJar, self) |
116 dlg = CookiesExceptionsDialog(self.__cookieJar, self) |