Helpviewer/HelpWindow.py

changeset 15
f6ccc31d6e72
parent 13
1af94a91f439
child 37
bfe92e414977
equal deleted inserted replaced
14:092aa8fafa4e 15:f6ccc31d6e72
54 import Utilities 54 import Utilities
55 55
56 import UI.PixmapCache 56 import UI.PixmapCache
57 import UI.Config 57 import UI.Config
58 58
59 from eric4config import getConfig 59 from eric5config import getConfig
60 60
61 class HelpWindow(QMainWindow): 61 class HelpWindow(QMainWindow):
62 """ 62 """
63 Class implementing the web browser main window. 63 Class implementing the web browser main window.
64 64
85 85
86 @param home the URL to be shown (string) 86 @param home the URL to be shown (string)
87 @param path the path of the working dir (usually '.') (string) 87 @param path the path of the working dir (usually '.') (string)
88 @param parent parent widget of this window (QWidget) 88 @param parent parent widget of this window (QWidget)
89 @param name name of this window (string) 89 @param name name of this window (string)
90 @param fromEric flag indicating whether it was called from within eric4 (boolean) 90 @param fromEric flag indicating whether it was called from within eric5 (boolean)
91 @keyparam initShortcutsOnly flag indicating to just initialize the keyboard 91 @keyparam initShortcutsOnly flag indicating to just initialize the keyboard
92 shortcuts (boolean) 92 shortcuts (boolean)
93 @keyparam searchWord word to search for (string) 93 @keyparam searchWord word to search for (string)
94 """ 94 """
95 QMainWindow.__init__(self, parent) 95 QMainWindow.__init__(self, parent)
96 self.setObjectName(name) 96 self.setObjectName(name)
97 self.setAttribute(Qt.WA_DeleteOnClose) 97 self.setAttribute(Qt.WA_DeleteOnClose)
98 self.setWindowTitle(self.trUtf8("eric4 Web Browser")) 98 self.setWindowTitle(self.trUtf8("eric5 Web Browser"))
99 99
100 self.fromEric = fromEric 100 self.fromEric = fromEric
101 self.initShortcutsOnly = initShortcutsOnly 101 self.initShortcutsOnly = initShortcutsOnly
102 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) 102 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
103 103
107 if self.initShortcutsOnly: 107 if self.initShortcutsOnly:
108 self.__initActions() 108 self.__initActions()
109 else: 109 else:
110 self.__helpEngine = \ 110 self.__helpEngine = \
111 QHelpEngine(os.path.join(Utilities.getConfigDir(), 111 QHelpEngine(os.path.join(Utilities.getConfigDir(),
112 "browser", "eric4help.qhc"), self) 112 "browser", "eric5help.qhc"), self)
113 self.connect(self.__helpEngine, SIGNAL("warning(const QString&)"), 113 self.connect(self.__helpEngine, SIGNAL("warning(const QString&)"),
114 self.__warning) 114 self.__warning)
115 self.__helpInstaller = None 115 self.__helpInstaller = None
116 116
117 # Attributes for WebKit based browser 117 # Attributes for WebKit based browser
2269 @return reference to the help engine (QHelpEngine) 2269 @return reference to the help engine (QHelpEngine)
2270 """ 2270 """
2271 if cls._helpEngine is None: 2271 if cls._helpEngine is None:
2272 cls._helpEngine = \ 2272 cls._helpEngine = \
2273 QHelpEngine(os.path.join(Utilities.getConfigDir(), 2273 QHelpEngine(os.path.join(Utilities.getConfigDir(),
2274 "browser", "eric4help.qhc")) 2274 "browser", "eric5help.qhc"))
2275 return cls._helpEngine 2275 return cls._helpEngine
2276 2276
2277 @classmethod 2277 @classmethod
2278 def networkAccessManager(cls): 2278 def networkAccessManager(cls):
2279 """ 2279 """
2526 Private slot to show installation errors. 2526 Private slot to show installation errors.
2527 2527
2528 @param message message to be shown (QString) 2528 @param message message to be shown (QString)
2529 """ 2529 """
2530 QMessageBox.warning(self, 2530 QMessageBox.warning(self,
2531 self.trUtf8("eric4 Web Browser"), 2531 self.trUtf8("eric5 Web Browser"),
2532 message) 2532 message)
2533 2533
2534 def __docsInstalled(self, installed): 2534 def __docsInstalled(self, installed):
2535 """ 2535 """
2536 Private slot handling the end of documentation installation. 2536 Private slot handling the end of documentation installation.

eric ide

mercurial