src/eric7/PdfViewer/PdfViewerWindow.py

branch
eric7
changeset 9729
f17d787ca4fa
parent 9722
63135ab601e7
child 10130
c444a1721e23
equal deleted inserted replaced
9727:c34b4286545a 9729:f17d787ca4fa
260 "pdfviewer_file_properties", 260 "pdfviewer_file_properties",
261 ) 261 )
262 self.propertiesAct.setStatusTip(self.tr("Show the document properties")) 262 self.propertiesAct.setStatusTip(self.tr("Show the document properties"))
263 self.propertiesAct.setWhatsThis( 263 self.propertiesAct.setWhatsThis(
264 self.tr( 264 self.tr(
265 """<b>Properties</b><p>Opens a dialog showing the document""" 265 """<b>Properties</b><p>Shows the info tab of the document"""
266 """ properties.</p>""" 266 """ properties.</p>"""
267 ) 267 )
268 ) 268 )
269 self.propertiesAct.triggered.connect(self.__showDocumentProperties) 269 self.propertiesAct.triggered.connect(self.__showDocumentProperties)
270 self.__actions.append(self.propertiesAct) 270 self.__actions.append(self.propertiesAct)
964 while not canceled and err == QPdfDocument.Error.IncorrectPassword: 964 while not canceled and err == QPdfDocument.Error.IncorrectPassword:
965 err = self.__pdfDocument.load(fileName) 965 err = self.__pdfDocument.load(fileName)
966 if err == QPdfDocument.Error.IncorrectPassword: 966 if err == QPdfDocument.Error.IncorrectPassword:
967 password, ok = QInputDialog.getText( 967 password, ok = QInputDialog.getText(
968 self, 968 self,
969 self.tr("Load PDF File"), 969 self.tr("Open PDF File"),
970 self.tr("Enter password to read the document:"), 970 self.tr("Enter password to show the document:"),
971 QLineEdit.EchoMode.Password, 971 QLineEdit.EchoMode.Password,
972 ) 972 )
973 if ok: 973 if ok:
974 self.__pdfDocument.setPassword(password) 974 self.__pdfDocument.setPassword(password)
975 else: 975 else:
976 canceled = True 976 canceled = True
977 if err != QPdfDocument.Error.None_: 977 if err != QPdfDocument.Error.None_:
978 EricMessageBox.critical( 978 EricMessageBox.critical(
979 self, 979 self,
980 self.tr("Load PDF File"), 980 self.tr("Open PDF File"),
981 self.tr( 981 self.tr(
982 """<p>The PDF file <b>{0}</b> could not be loaded.</p>""" 982 """<p>The PDF file <b>{0}</b> could not be loaded.</p>"""
983 """<p>Reason: {1}</p>""" 983 """<p>Reason: {1}</p>"""
984 ).format(fileName, self.__getErrorString(err)), 984 ).format(fileName, self.__getErrorString(err)),
985 ) 985 )

eric ide

mercurial