393 E5MessageBox.critical( |
391 E5MessageBox.critical( |
394 None, |
392 None, |
395 self.tr("Exporting Bookmarks"), |
393 self.tr("Exporting Bookmarks"), |
396 self.tr("""Error exporting bookmarks to <b>{0}</b>.""") |
394 self.tr("""Error exporting bookmarks to <b>{0}</b>.""") |
397 .format(fileName)) |
395 .format(fileName)) |
398 |
|
399 # TODO: Bookmarks: remove this obsolete method |
|
400 def __convertFromOldBookmarks(self): |
|
401 """ |
|
402 Private method to convert the old bookmarks into the new ones. |
|
403 """ |
|
404 bmNames = Preferences.Prefs.settings.value('Bookmarks/Names') |
|
405 bmFiles = Preferences.Prefs.settings.value('Bookmarks/Files') |
|
406 |
|
407 if bmNames is not None and bmFiles is not None: |
|
408 if len(bmNames) == len(bmFiles): |
|
409 convertedRootNode = BookmarkNode(BookmarkNode.Folder) |
|
410 convertedRootNode.title = self.tr("Converted {0}")\ |
|
411 .format(QDate.currentDate().toString( |
|
412 Qt.SystemLocaleShortDate)) |
|
413 for i in range(len(bmNames)): |
|
414 node = BookmarkNode(BookmarkNode.Bookmark, |
|
415 convertedRootNode) |
|
416 node.title = bmNames[i] |
|
417 url = QUrl(bmFiles[i]) |
|
418 if not url.scheme(): |
|
419 url.setScheme("file") |
|
420 node.url = url.toString() |
|
421 self.addBookmark(self.menu(), convertedRootNode) |
|
422 |
|
423 Preferences.Prefs.settings.remove('Bookmarks') |
|
424 |
396 |
425 def iconChanged(self, url): |
397 def iconChanged(self, url): |
426 """ |
398 """ |
427 Public slot to update the icon image for an URL. |
399 Public slot to update the icon image for an URL. |
428 |
400 |