Helpviewer/QtHelpDocumentationDialog.py

branch
Py2 comp.
changeset 3058
0a02c433f52d
parent 3057
10516539f238
parent 3020
542e97d4ecb3
child 3060
5883ce99ee12
equal deleted inserted replaced
3057:10516539f238 3058:0a02c433f52d
66 return 66 return
67 67
68 for fileName in fileNames: 68 for fileName in fileNames:
69 ns = QHelpEngineCore.namespaceName(fileName) 69 ns = QHelpEngineCore.namespaceName(fileName)
70 if not ns: 70 if not ns:
71 E5MessageBox.warning(self, 71 E5MessageBox.warning(
72 self,
72 self.trUtf8("Add Documentation"), 73 self.trUtf8("Add Documentation"),
73 self.trUtf8( 74 self.trUtf8(
74 """The file <b>{0}</b> is not a valid""" 75 """The file <b>{0}</b> is not a valid"""
75 """ Qt Help File.""").format(fileName) 76 """ Qt Help File.""").format(fileName)
76 ) 77 )
77 continue 78 continue
78 79
79 if len(self.documentsList.findItems(ns, Qt.MatchFixedString)): 80 if len(self.documentsList.findItems(ns, Qt.MatchFixedString)):
80 E5MessageBox.warning(self, 81 E5MessageBox.warning(
82 self,
81 self.trUtf8("Add Documentation"), 83 self.trUtf8("Add Documentation"),
82 self.trUtf8( 84 self.trUtf8(
83 """The namespace <b>{0}</b> is already registered.""")\ 85 """The namespace <b>{0}</b> is already registered.""")\
84 .format(ns) 86 .format(ns)
85 ) 87 )
94 @pyqtSlot() 96 @pyqtSlot()
95 def on_removeButton_clicked(self): 97 def on_removeButton_clicked(self):
96 """ 98 """
97 Private slot to remove a document from the help database. 99 Private slot to remove a document from the help database.
98 """ 100 """
99 res = E5MessageBox.question(self, 101 res = E5MessageBox.question(
102 self,
100 self.trUtf8("Remove Documentation"), 103 self.trUtf8("Remove Documentation"),
101 self.trUtf8( 104 self.trUtf8(
102 """Do you really want to remove the selected documentation """ 105 """Do you really want to remove the selected documentation """
103 """sets from the database?""")) 106 """sets from the database?"""))
104 if not res: 107 if not res:
108 111
109 items = self.documentsList.selectedItems() 112 items = self.documentsList.selectedItems()
110 for item in items: 113 for item in items:
111 ns = item.text() 114 ns = item.text()
112 if ns in list(openedDocs.values()): 115 if ns in list(openedDocs.values()):
113 res = E5MessageBox.yesNo(self, 116 res = E5MessageBox.yesNo(
117 self,
114 self.trUtf8("Remove Documentation"), 118 self.trUtf8("Remove Documentation"),
115 self.trUtf8( 119 self.trUtf8(
116 """Some documents currently opened reference the """ 120 """Some documents currently opened reference the """
117 """documentation you are attempting to remove. """ 121 """documentation you are attempting to remove. """
118 """Removing the documentation will close those """ 122 """Removing the documentation will close those """

eric ide

mercurial