187 |
187 |
188 self.process = None |
188 self.process = None |
189 |
189 |
190 if self.patchesList.topLevelItemCount() == 0: |
190 if self.patchesList.topLevelItemCount() == 0: |
191 # no bookmarks defined |
191 # no bookmarks defined |
192 self.__generateItem(self.trUtf8("no patches found"), "") |
192 self.__generateItem(self.trUtf8("no patches found"), "", True) |
193 self.patchesList.doItemsLayout() |
193 self.patchesList.doItemsLayout() |
194 self.__resizeColumns() |
194 self.__resizeColumns() |
195 self.__resort() |
195 self.__resort() |
196 |
196 |
197 def on_buttonBox_clicked(self, button): |
197 def on_buttonBox_clicked(self, button): |
231 Private method to resize the list columns. |
231 Private method to resize the list columns. |
232 """ |
232 """ |
233 self.patchesList.header().resizeSections(QHeaderView.ResizeToContents) |
233 self.patchesList.header().resizeSections(QHeaderView.ResizeToContents) |
234 self.patchesList.header().setStretchLastSection(True) |
234 self.patchesList.header().setStretchLastSection(True) |
235 |
235 |
236 def __generateItem(self, name, summary): |
236 def __generateItem(self, name, summary, error=False): |
237 """ |
237 """ |
238 Private method to generate a patch item in the list of patches. |
238 Private method to generate a patch item in the list of patches. |
239 |
239 |
240 @param name name of the patch (string) |
240 @param name name of the patch (string) |
241 @param summary first line of the patch header (string) |
241 @param summary first line of the patch header (string) |
242 """ |
242 @param error flag indicating an error entry (boolean) |
243 self.__patchesCount += 1 |
243 """ |
244 itm = QTreeWidgetItem(self.patchesList, [ |
244 if error: |
245 "{0:>7}".format(self.__patchesCount), |
245 itm = QTreeWidgetItem(self.patchesList, [ |
246 name, |
246 "", |
247 self.__mode == "qapplied" and \ |
247 name, |
248 self.trUtf8("applied") or \ |
248 "", |
249 self.trUtf8("not applied"), |
249 summary |
250 summary |
250 ]) |
251 ]) |
251 else: |
|
252 self.__patchesCount += 1 |
|
253 itm = QTreeWidgetItem(self.patchesList, [ |
|
254 "{0:>7}".format(self.__patchesCount), |
|
255 name, |
|
256 self.__mode == "qapplied" and \ |
|
257 self.trUtf8("applied") or \ |
|
258 self.trUtf8("not applied"), |
|
259 summary |
|
260 ]) |
252 itm.setTextAlignment(0, Qt.AlignRight) |
261 itm.setTextAlignment(0, Qt.AlignRight) |
253 itm.setTextAlignment(2, Qt.AlignHCenter) |
262 itm.setTextAlignment(2, Qt.AlignHCenter) |
254 |
263 |
255 def __markTopItem(self, name): |
264 def __markTopItem(self, name): |
256 """ |
265 """ |