Helpviewer/HelpTabWidget.py

changeset 3020
542e97d4ecb3
parent 2999
28c75409a78f
child 3022
57179e4cdadd
equal deleted inserted replaced
3019:7912530a33e2 3020:542e97d4ecb3
517 printDialog = QPrintDialog(printer, self) 517 printDialog = QPrintDialog(printer, self)
518 if printDialog.exec_() == QDialog.Accepted: 518 if printDialog.exec_() == QDialog.Accepted:
519 try: 519 try:
520 frame.print_(printer) 520 frame.print_(printer)
521 except AttributeError: 521 except AttributeError:
522 E5MessageBox.critical(self, 522 E5MessageBox.critical(
523 self,
523 self.trUtf8("eric5 Web Browser"), 524 self.trUtf8("eric5 Web Browser"),
524 self.trUtf8( 525 self.trUtf8(
525 """<p>Printing is not available due to a bug in""" 526 """<p>Printing is not available due to a bug in"""
526 """ PyQt4. Please upgrade.</p>""")) 527 """ PyQt4. Please upgrade.</p>"""))
527 return 528 return
559 printDialog = QPrintDialog(printer, self) 560 printDialog = QPrintDialog(printer, self)
560 if printDialog.exec_() == QDialog.Accepted: 561 if printDialog.exec_() == QDialog.Accepted:
561 try: 562 try:
562 frame.print_(printer) 563 frame.print_(printer)
563 except AttributeError: 564 except AttributeError:
564 E5MessageBox.critical(self, 565 E5MessageBox.critical(
566 self,
565 self.trUtf8("eric5 Web Browser"), 567 self.trUtf8("eric5 Web Browser"),
566 self.trUtf8( 568 self.trUtf8(
567 """<p>Printing is not available due to a bug in""" 569 """<p>Printing is not available due to a bug in"""
568 """ PyQt4. Please upgrade.</p>""")) 570 """ PyQt4. Please upgrade.</p>"""))
569 return 571 return
609 @param printer reference to the printer object (QPrinter) 611 @param printer reference to the printer object (QPrinter)
610 """ 612 """
611 try: 613 try:
612 self.__printPreviewBrowser.print_(printer) 614 self.__printPreviewBrowser.print_(printer)
613 except AttributeError: 615 except AttributeError:
614 E5MessageBox.critical(self, 616 E5MessageBox.critical(
617 self,
615 self.trUtf8("eric5 Web Browser"), 618 self.trUtf8("eric5 Web Browser"),
616 self.trUtf8( 619 self.trUtf8(
617 """<p>Printing is not available due to a bug in PyQt4.""" 620 """<p>Printing is not available due to a bug in PyQt4."""
618 """Please upgrade.</p>""")) 621 """Please upgrade.</p>"""))
619 return 622 return
771 Public method to check, if the application should be shut down. 774 Public method to check, if the application should be shut down.
772 775
773 @return flag indicating a shut down (boolean) 776 @return flag indicating a shut down (boolean)
774 """ 777 """
775 if self.count() > 1 and Preferences.getHelp("WarnOnMultipleClose"): 778 if self.count() > 1 and Preferences.getHelp("WarnOnMultipleClose"):
776 mb = E5MessageBox.E5MessageBox(E5MessageBox.Information, 779 mb = E5MessageBox.E5MessageBox(
780 E5MessageBox.Information,
777 self.trUtf8("Are you sure you want to close the window?"), 781 self.trUtf8("Are you sure you want to close the window?"),
778 self.trUtf8("""Are you sure you want to close the window?\n""" 782 self.trUtf8("""Are you sure you want to close the window?\n"""
779 """You have %n tab(s) open.""", "", self.count()), 783 """You have %n tab(s) open.""", "", self.count()),
780 modal=True, 784 modal=True,
781 parent=self) 785 parent=self)
785 quitButton.setIcon(UI.PixmapCache.getIcon("close.png")) 789 quitButton.setIcon(UI.PixmapCache.getIcon("close.png"))
786 else: 790 else:
787 quitButton = mb.addButton( 791 quitButton = mb.addButton(
788 self.trUtf8("&Quit"), E5MessageBox.AcceptRole) 792 self.trUtf8("&Quit"), E5MessageBox.AcceptRole)
789 quitButton.setIcon(UI.PixmapCache.getIcon("exit.png")) 793 quitButton.setIcon(UI.PixmapCache.getIcon("exit.png"))
790 closeTabButton = mb.addButton(self.trUtf8("C&lose Current Tab"), 794 closeTabButton = mb.addButton(
791 E5MessageBox.AcceptRole) 795 self.trUtf8("C&lose Current Tab"), E5MessageBox.AcceptRole)
792 closeTabButton.setIcon(UI.PixmapCache.getIcon("tabClose.png")) 796 closeTabButton.setIcon(UI.PixmapCache.getIcon("tabClose.png"))
793 mb.addButton(E5MessageBox.Cancel) 797 mb.addButton(E5MessageBox.Cancel)
794 mb.exec_() 798 mb.exec_()
795 if mb.clickedButton() == quitButton: 799 if mb.clickedButton() == quitButton:
796 return True 800 return True

eric ide

mercurial