Helpviewer/GreaseMonkey/GreaseMonkeyAddScriptDialog.py

changeset 2403
e3d7a861547c
parent 2302
f29e9405c851
child 2525
8b507a9a2d40
child 3002
6ffc581f00f1
--- a/Helpviewer/GreaseMonkey/GreaseMonkeyAddScriptDialog.py	Sun Feb 10 15:26:21 2013 +0100
+++ b/Helpviewer/GreaseMonkey/GreaseMonkeyAddScriptDialog.py	Sun Feb 10 18:31:31 2013 +0100
@@ -17,11 +17,6 @@
 
 from .Ui_GreaseMonkeyAddScriptDialog import Ui_GreaseMonkeyAddScriptDialog
 
-from QScintilla.MiniEditor import MiniEditor
-
-from Helpviewer import HelpUtilities
-import Helpviewer.HelpWindow
-
 import UI.PixmapCache
 
 
@@ -70,9 +65,12 @@
         """
         Private slot to show an editor window with the source code.
         """
+        from Helpviewer import HelpUtilities
+        
         tmpFileName = HelpUtilities.ensureUniqueFilename(
             os.path.join(QDir.tempPath(), "tmp-userscript.js"))
         if QFile.copy(self.__script.fileName(), tmpFileName):
+            from QScintilla.MiniEditor import MiniEditor
             editor = MiniEditor(tmpFileName, "JavaScript", self)
             editor.show()
     
@@ -88,6 +86,7 @@
             msg = self.trUtf8("<p>Cannot install script.</p>")
             success = False
         
+        import Helpviewer.HelpWindow
         if success and Helpviewer.HelpWindow.HelpWindow.notificationsEnabled():
             Helpviewer.HelpWindow.HelpWindow.showNotification(
                 UI.PixmapCache.getPixmap("greaseMonkey48.png"),

eric ide

mercurial