8 """ |
8 """ |
9 |
9 |
10 import sqlite3 |
10 import sqlite3 |
11 |
11 |
12 from PyQt4.QtCore import pyqtSlot, Qt |
12 from PyQt4.QtCore import pyqtSlot, Qt |
13 from PyQt4.QtGui import QDialog, QTreeWidgetItem, QListWidgetItem, QInputDialog, QLineEdit |
13 from PyQt4.QtGui import QDialog, QTreeWidgetItem, QListWidgetItem, \ |
|
14 QInputDialog, QLineEdit |
14 from PyQt4.QtHelp import QHelpEngineCore |
15 from PyQt4.QtHelp import QHelpEngineCore |
15 |
16 |
16 from .Ui_QtHelpFiltersDialog import Ui_QtHelpFiltersDialog |
17 from .Ui_QtHelpFiltersDialog import Ui_QtHelpFiltersDialog |
17 |
18 |
18 |
19 |
62 def on_filtersList_currentItemChanged(self, current, previous): |
63 def on_filtersList_currentItemChanged(self, current, previous): |
63 """ |
64 """ |
64 Private slot to update the attributes depending on the current filter. |
65 Private slot to update the attributes depending on the current filter. |
65 |
66 |
66 @param current reference to the current item (QListWidgetitem) |
67 @param current reference to the current item (QListWidgetitem) |
67 @param previous reference to the previous current item (QListWidgetItem) |
68 @param previous reference to the previous current item |
|
69 (QListWidgetItem) |
68 """ |
70 """ |
69 checkedList = [] |
71 checkedList = [] |
70 if current is not None: |
72 if current is not None: |
71 checkedList = self.__filterMap[current.text()] |
73 checkedList = self.__filterMap[current.text()] |
72 for index in range(0, self.attributesList.topLevelItemCount()): |
74 for index in range(0, self.attributesList.topLevelItemCount()): |
162 except sqlite3.DatabaseError: |
164 except sqlite3.DatabaseError: |
163 pass # ignore database errors |
165 pass # ignore database errors |
164 |
166 |
165 for attr in self.__removedAttributes: |
167 for attr in self.__removedAttributes: |
166 self.__db.execute( |
168 self.__db.execute( |
167 "DELETE FROM FilterAttributeTable WHERE Name = '{0}'".format(attr)) |
169 "DELETE FROM FilterAttributeTable WHERE Name = '{0}'" |
|
170 .format(attr)) |
168 self.__db.commit() |
171 self.__db.commit() |
169 self.__db.close() |
172 self.__db.close() |
170 |
173 |
171 @pyqtSlot() |
174 @pyqtSlot() |
172 def on_buttonBox_accepted(self): |
175 def on_buttonBox_accepted(self): |