42 self.whitelist.setModel(self.__proxyModel) |
42 self.whitelist.setModel(self.__proxyModel) |
43 |
43 |
44 self.searchEdit.textChanged.connect( |
44 self.searchEdit.textChanged.connect( |
45 self.__proxyModel.setFilterFixedString) |
45 self.__proxyModel.setFilterFixedString) |
46 |
46 |
47 self.removeButton.clicked[()].connect(self.whitelist.removeSelected) |
47 self.removeButton.clicked.connect(self.whitelist.removeSelected) |
48 self.removeAllButton.clicked[()].connect(self.whitelist.removeAll) |
48 self.removeAllButton.clicked.connect(self.whitelist.removeAll) |
49 |
49 |
50 @pyqtSlot() |
50 @pyqtSlot() |
51 def on_addButton_clicked(self): |
51 def on_addButton_clicked(self): |
52 """ |
52 """ |
53 Private slot to add an entry to the whitelist. |
53 Private slot to add an entry to the whitelist. |
54 """ |
54 """ |
55 host, ok = QInputDialog.getText( |
55 host, ok = QInputDialog.getText( |
56 self, |
56 self, |
57 self.trUtf8("ClickToFlash Whitelist"), |
57 self.tr("ClickToFlash Whitelist"), |
58 self.trUtf8("Enter host name to add to whitelist:"), |
58 self.tr("Enter host name to add to whitelist:"), |
59 QLineEdit.Normal) |
59 QLineEdit.Normal) |
60 if ok and host != "" and host not in self.__model.stringList(): |
60 if ok and host != "" and host not in self.__model.stringList(): |
61 self.__model.insertRow(self.__model.rowCount()) |
61 self.__model.insertRow(self.__model.rowCount()) |
62 self.__model.setData( |
62 self.__model.setData( |
63 self.__model.index(self.__model.rowCount() - 1), host) |
63 self.__model.index(self.__model.rowCount() - 1), host) |