238 @param title title for the bookmark |
238 @param title title for the bookmark |
239 @type str |
239 @type str |
240 @param url URL for the bookmark |
240 @param url URL for the bookmark |
241 @type QUrl |
241 @type QUrl |
242 """ |
242 """ |
243 dlg = HelpBookmarkPropertiesDialog(title, url.toString(), self) |
243 dlg = HelpBookmarkPropertiesDialog(title, url.toString(), parent=self) |
244 if dlg.exec() == QDialog.DialogCode.Accepted: |
244 if dlg.exec() == QDialog.DialogCode.Accepted: |
245 title, url = dlg.getData() |
245 title, url = dlg.getData() |
246 self.__addBookmark(title, url) |
246 self.__addBookmark(title, url) |
247 self.sortItems() |
247 self.sortItems() |
248 self.__saveBookmarks() |
248 self.__saveBookmarks() |
276 |
276 |
277 @param itm reference to the bookmark item to be edited |
277 @param itm reference to the bookmark item to be edited |
278 @type QListWidgetItem |
278 @type QListWidgetItem |
279 """ |
279 """ |
280 dlg = HelpBookmarkPropertiesDialog( |
280 dlg = HelpBookmarkPropertiesDialog( |
281 itm.text(), itm.data(self.UrlRole).toString(), self |
281 itm.text(), itm.data(self.UrlRole).toString(), parent=self |
282 ) |
282 ) |
283 if dlg.exec() == QDialog.DialogCode.Accepted: |
283 if dlg.exec() == QDialog.DialogCode.Accepted: |
284 title, url = dlg.getData() |
284 title, url = dlg.getData() |
285 itm.setText(title) |
285 itm.setText(title) |
286 itm.setData(self.UrlRole, QUrl(url)) |
286 itm.setData(self.UrlRole, QUrl(url)) |
467 """ |
467 """ |
468 Private slot to import bookmarks from a JSON file. |
468 Private slot to import bookmarks from a JSON file. |
469 """ |
469 """ |
470 from .HelpBookmarksImportDialog import HelpBookmarksImportDialog |
470 from .HelpBookmarksImportDialog import HelpBookmarksImportDialog |
471 |
471 |
472 dlg = HelpBookmarksImportDialog(self) |
472 dlg = HelpBookmarksImportDialog(parent=self) |
473 if dlg.exec() == QDialog.DialogCode.Accepted: |
473 if dlg.exec() == QDialog.DialogCode.Accepted: |
474 replace, filename = dlg.getData() |
474 replace, filename = dlg.getData() |
475 |
475 |
476 try: |
476 try: |
477 with open(filename, "r") as f: |
477 with open(filename, "r") as f: |