24 pyqtSignal, |
24 pyqtSignal, |
25 pyqtSlot, |
25 pyqtSlot, |
26 ) |
26 ) |
27 from PyQt6.QtWidgets import QDialog |
27 from PyQt6.QtWidgets import QDialog |
28 |
28 |
29 from eric7 import Globals, Preferences |
29 from eric7 import EricUtilities, Preferences |
30 from eric7.EricWidgets import EricMessageBox |
30 from eric7.EricWidgets import EricMessageBox |
31 from eric7.WebBrowser.JavaScript.ExternalJsObject import ExternalJsObject |
31 from eric7.WebBrowser.JavaScript.ExternalJsObject import ExternalJsObject |
32 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow |
32 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow |
33 |
33 |
34 from .GreaseMonkeyJsObject import GreaseMonkeyJsObject |
34 from .GreaseMonkeyJsObject import GreaseMonkeyJsObject |
154 Public method to get the path of the scripts directory. |
154 Public method to get the path of the scripts directory. |
155 |
155 |
156 @return path of the scripts directory |
156 @return path of the scripts directory |
157 @rtype str |
157 @rtype str |
158 """ |
158 """ |
159 return os.path.join(Globals.getConfigDir(), "web_browser", "greasemonkey") |
159 return os.path.join(EricUtilities.getConfigDir(), "web_browser", "greasemonkey") |
160 |
160 |
161 def requireScriptsDirectory(self): |
161 def requireScriptsDirectory(self): |
162 """ |
162 """ |
163 Public method to get the path of the scripts directory. |
163 Public method to get the path of the scripts directory. |
164 |
164 |
358 collection = WebBrowserWindow.webProfile().scripts() |
358 collection = WebBrowserWindow.webProfile().scripts() |
359 collection.insert(script.webScript()) |
359 collection.insert(script.webScript()) |
360 |
360 |
361 self.__jsObject.setSettingsFile( |
361 self.__jsObject.setSettingsFile( |
362 os.path.join( |
362 os.path.join( |
363 Globals.getConfigDir(), "web_browser", "greasemonkey_values.ini" |
363 EricUtilities.getConfigDir(), "web_browser", "greasemonkey_values.ini" |
364 ) |
364 ) |
365 ) |
365 ) |
366 ExternalJsObject.registerExtraObject("GreaseMonkey", self.__jsObject) |
366 ExternalJsObject.registerExtraObject("GreaseMonkey", self.__jsObject) |
367 |
367 |
368 def __scriptChanged(self, script): |
368 def __scriptChanged(self, script): |