Helpviewer/Bookmarks/AddBookmarkDialog.py

changeset 1131
7781e396c903
parent 1112
8a7d1b9d18db
child 1509
c0b5e693b0eb
equal deleted inserted replaced
1130:3e9f0330f833 1131:7781e396c903
25 """ 25 """
26 Constructor 26 Constructor
27 27
28 @param parent reference to the parent object (QObject) 28 @param parent reference to the parent object (QObject)
29 """ 29 """
30 QSortFilterProxyModel.__init__(self, parent) 30 super().__init__(parent)
31 31
32 def columnCount(self, parent): 32 def columnCount(self, parent):
33 """ 33 """
34 Public method to return the number of columns. 34 Public method to return the number of columns.
35 35
80 80
81 @param parent reference to the parent widget (QWidget) 81 @param parent reference to the parent widget (QWidget)
82 @param bookmarksManager reference to the bookmarks manager 82 @param bookmarksManager reference to the bookmarks manager
83 object (BookmarksManager) 83 object (BookmarksManager)
84 """ 84 """
85 QDialog.__init__(self, parent) 85 super().__init__(parent)
86 self.setupUi(self) 86 self.setupUi(self)
87 87
88 self.__bookmarksManager = None 88 self.__bookmarksManager = None
89 self.__addedNode = None 89 self.__addedNode = None
90 self.__addFolder = False 90 self.__addFolder = False
204 """ 204 """
205 Public slot handling the acceptance of the dialog. 205 Public slot handling the acceptance of the dialog.
206 """ 206 """
207 if (not self.__addFolder and not self.addressEdit.text()) or \ 207 if (not self.__addFolder and not self.addressEdit.text()) or \
208 not self.nameEdit.text(): 208 not self.nameEdit.text():
209 QDialog.accept(self) 209 super().accept()
210 return 210 return
211 211
212 idx = self.currentIndex() 212 idx = self.currentIndex()
213 if not idx.isValid(): 213 if not idx.isValid():
214 idx = self.__bookmarksManager.bookmarksModel().index(0, 0) 214 idx = self.__bookmarksManager.bookmarksModel().index(0, 0)
224 bookmark.url = self.addressEdit.text() 224 bookmark.url = self.addressEdit.text()
225 225
226 self.__bookmarksManager.addBookmark(parent, bookmark) 226 self.__bookmarksManager.addBookmark(parent, bookmark)
227 self.__addedNode = bookmark 227 self.__addedNode = bookmark
228 228
229 QDialog.accept(self) 229 super().accept()

eric ide

mercurial