91 Private slot to remove a document from the help database. |
91 Private slot to remove a document from the help database. |
92 """ |
92 """ |
93 res = E5MessageBox.question(self, |
93 res = E5MessageBox.question(self, |
94 self.trUtf8("Remove Documentation"), |
94 self.trUtf8("Remove Documentation"), |
95 self.trUtf8("""Do you really want to remove the selected documentation """ |
95 self.trUtf8("""Do you really want to remove the selected documentation """ |
96 """sets from the database?"""), |
96 """sets from the database?""")) |
97 QMessageBox.StandardButtons(\ |
97 if not res: |
98 QMessageBox.No | \ |
|
99 QMessageBox.Yes), |
|
100 QMessageBox.No) |
|
101 if res == QMessageBox.No: |
|
102 return |
98 return |
103 |
99 |
104 openedDocs = self.__mw.getSourceFileList() |
100 openedDocs = self.__mw.getSourceFileList() |
105 |
101 |
106 items = self.documentsList.selectedItems() |
102 items = self.documentsList.selectedItems() |
107 for item in items: |
103 for item in items: |
108 ns = item.text() |
104 ns = item.text() |
109 if ns in list(openedDocs.values()): |
105 if ns in list(openedDocs.values()): |
110 res = E5MessageBox.warning(self, |
106 res = E5MessageBox.yesNo(self, |
111 self.trUtf8("Remove Documentation"), |
107 self.trUtf8("Remove Documentation"), |
112 self.trUtf8("""Some documents currently opened reference the """ |
108 self.trUtf8("""Some documents currently opened reference the """ |
113 """documentation you are attempting to remove. """ |
109 """documentation you are attempting to remove. """ |
114 """Removing the documentation will close those """ |
110 """Removing the documentation will close those """ |
115 """documents. Remove anyway?"""), |
111 """documents. Remove anyway?"""), |
116 QMessageBox.StandardButtons(\ |
112 type_ = E5MessageBox.Warning) |
117 QMessageBox.Yes | \ |
113 if not res: |
118 QMessageBox.No), |
|
119 QMessageBox.No) |
|
120 if res == QMessageBox.No: |
|
121 return |
114 return |
122 self.__unregisteredDocs.append(ns) |
115 self.__unregisteredDocs.append(ns) |
123 for id in openedDocs: |
116 for id in openedDocs: |
124 if openedDocs[id] == ns and id not in self.__tabsToClose: |
117 if openedDocs[id] == ns and id not in self.__tabsToClose: |
125 self.__tabsToClose.append(id) |
118 self.__tabsToClose.append(id) |