69 |
69 |
70 @param url URL to download script from |
70 @param url URL to download script from |
71 @type QUrl |
71 @type QUrl |
72 """ |
72 """ |
73 QMetaObject.invokeMethod( |
73 QMetaObject.invokeMethod( |
74 self, "doDownloadScript", Qt.QueuedConnection, |
74 self, "doDownloadScript", Qt.ConnectionType.QueuedConnection, |
75 Q_ARG(QUrl, url)) |
75 Q_ARG(QUrl, url)) |
76 |
76 |
77 @pyqtSlot(QUrl) |
77 @pyqtSlot(QUrl) |
78 def doDownloadScript(self, url): |
78 def doDownloadScript(self, url): |
79 """ |
79 """ |
112 if not self.containsScript(script.fullName()): |
112 if not self.containsScript(script.fullName()): |
113 from .GreaseMonkeyAddScriptDialog import ( |
113 from .GreaseMonkeyAddScriptDialog import ( |
114 GreaseMonkeyAddScriptDialog |
114 GreaseMonkeyAddScriptDialog |
115 ) |
115 ) |
116 dlg = GreaseMonkeyAddScriptDialog(self, script) |
116 dlg = GreaseMonkeyAddScriptDialog(self, script) |
117 deleteScript = dlg.exec() != QDialog.Accepted |
117 deleteScript = dlg.exec() != QDialog.DialogCode.Accepted |
118 else: |
118 else: |
119 E5MessageBox.information( |
119 E5MessageBox.information( |
120 None, |
120 None, |
121 QCoreApplication.translate( |
121 QCoreApplication.translate( |
122 "GreaseMonkeyManager", |
122 "GreaseMonkeyManager", |
164 |
164 |
165 script = "" |
165 script = "" |
166 |
166 |
167 settings = QSettings( |
167 settings = QSettings( |
168 os.path.join(self.requireScriptsDirectory(), "requires.ini"), |
168 os.path.join(self.requireScriptsDirectory(), "requires.ini"), |
169 QSettings.IniFormat) |
169 QSettings.Format.IniFormat) |
170 settings.beginGroup("Files") |
170 settings.beginGroup("Files") |
171 for url in urlList: |
171 for url in urlList: |
172 if settings.contains(url): |
172 if settings.contains(url): |
173 fileName = settings.value(url) |
173 fileName = settings.value(url) |
174 if not QFileInfo(fileName).isAbsolute(): |
174 if not QFileInfo(fileName).isAbsolute(): |
312 |
312 |
313 self.__disabledScripts = Preferences.getWebBrowser( |
313 self.__disabledScripts = Preferences.getWebBrowser( |
314 "GreaseMonkeyDisabledScripts") |
314 "GreaseMonkeyDisabledScripts") |
315 |
315 |
316 from .GreaseMonkeyScript import GreaseMonkeyScript |
316 from .GreaseMonkeyScript import GreaseMonkeyScript |
317 for fileName in scriptsDir.entryList(["*.js"], QDir.Files): |
317 for fileName in scriptsDir.entryList(["*.js"], QDir.Filter.Files): |
318 absolutePath = scriptsDir.absoluteFilePath(fileName) |
318 absolutePath = scriptsDir.absoluteFilePath(fileName) |
319 script = GreaseMonkeyScript(self, absolutePath) |
319 script = GreaseMonkeyScript(self, absolutePath) |
320 |
320 |
321 if not script.isValid(): |
321 if not script.isValid(): |
322 del script |
322 del script |