Helpviewer/Bookmarks/BookmarksManager.py

changeset 3656
441956d8fce5
parent 3591
2f2a4a76dd22
child 3670
f0cb7579c0b4
equal deleted inserted replaced
3654:ffeb85cdc72d 3656:441956d8fce5
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 import os 12 import os
13 13
14 from PyQt4.QtCore import pyqtSignal, Qt, QT_TRANSLATE_NOOP, QObject, QFile, \ 14 from PyQt5.QtCore import pyqtSignal, Qt, QT_TRANSLATE_NOOP, QObject, QFile, \
15 QIODevice, QXmlStreamReader, QDate, QDateTime, QFileInfo, QUrl 15 QIODevice, QXmlStreamReader, QDate, QDateTime, QFileInfo, QUrl, \
16 from PyQt4.QtGui import QUndoStack, QUndoCommand, QApplication, QDialog 16 QCoreApplication
17 from PyQt5.QtWidgets import QUndoStack, QUndoCommand, QDialog
17 18
18 from E5Gui import E5MessageBox, E5FileDialog 19 from E5Gui import E5MessageBox, E5FileDialog
19 20
20 from .BookmarkNode import BookmarkNode 21 from .BookmarkNode import BookmarkNode
21 22
529 (BookmarksManager) 530 (BookmarksManager)
530 @param parent reference to the parent node (BookmarkNode) 531 @param parent reference to the parent node (BookmarkNode)
531 @param row row number of bookmark (integer) 532 @param row row number of bookmark (integer)
532 """ 533 """
533 super(RemoveBookmarksCommand, self).__init__( 534 super(RemoveBookmarksCommand, self).__init__(
534 QApplication.translate("BookmarksManager", "Remove Bookmark")) 535 QCoreApplication.translate("BookmarksManager", "Remove Bookmark"))
535 536
536 self._row = row 537 self._row = row
537 self._bookmarksManager = bookmarksManager 538 self._bookmarksManager = bookmarksManager
538 try: 539 try:
539 self._node = parent.children()[row] 540 self._node = parent.children()[row]
570 @param parent reference to the parent node (BookmarkNode) 571 @param parent reference to the parent node (BookmarkNode)
571 @param node reference to the node to be inserted (BookmarkNode) 572 @param node reference to the node to be inserted (BookmarkNode)
572 @param row row number of bookmark (integer) 573 @param row row number of bookmark (integer)
573 """ 574 """
574 RemoveBookmarksCommand.__init__(self, bookmarksManager, parent, row) 575 RemoveBookmarksCommand.__init__(self, bookmarksManager, parent, row)
575 self.setText(QApplication.translate( 576 self.setText(QCoreApplication.translate(
576 "BookmarksManager", "Insert Bookmark")) 577 "BookmarksManager", "Insert Bookmark"))
577 self._node = node 578 self._node = node
578 579
579 def undo(self): 580 def undo(self):
580 """ 581 """
611 self._newValue = newValue 612 self._newValue = newValue
612 self._node = node 613 self._node = node
613 614
614 if self._title: 615 if self._title:
615 self._oldValue = self._node.title 616 self._oldValue = self._node.title
616 self.setText(QApplication.translate( 617 self.setText(QCoreApplication.translate(
617 "BookmarksManager", "Name Change")) 618 "BookmarksManager", "Name Change"))
618 else: 619 else:
619 self._oldValue = self._node.url 620 self._oldValue = self._node.url
620 self.setText(QApplication.translate( 621 self.setText(QCoreApplication.translate(
621 "BookmarksManager", "Address Change")) 622 "BookmarksManager", "Address Change"))
622 623
623 def undo(self): 624 def undo(self):
624 """ 625 """
625 Public slot to perform the undo action. 626 Public slot to perform the undo action.

eric ide

mercurial