1
+ import os , sys
2
+ import inspect
3
+ import subprocess
4
+
1
5
from PyQt4 .QtCore import *
2
6
from PyQt4 .QtGui import *
7
+
3
8
from qgis .core import *
4
- import os , sys
5
- import inspect
9
+
6
10
from sextante .core .Sextante import Sextante
7
- from sextante .gui .SextanteToolbox import SextanteToolbox
8
11
from sextante .core .QGisLayers import QGisLayers
9
- from sextante .gui .HistoryDialog import HistoryDialog
10
12
from sextante .core .SextanteUtils import SextanteUtils
13
+
14
+ from sextante .gui .SextanteToolbox import SextanteToolbox
15
+ from sextante .gui .HistoryDialog import HistoryDialog
11
16
from sextante .gui .ConfigDialog import ConfigDialog
12
- from sextante .modeler .ModelerDialog import ModelerDialog
13
17
from sextante .gui .ResultsDialog import ResultsDialog
18
+
19
+ from sextante .modeler .ModelerDialog import ModelerDialog
20
+
14
21
from sextante .about .AboutDialog import AboutDialog
15
- import subprocess
16
22
17
23
cmd_folder = os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ]
18
24
if cmd_folder not in sys .path :
@@ -32,47 +38,54 @@ def initGui(self):
32
38
Sextante .addAlgListListener (self .toolbox )
33
39
34
40
self .menu = QMenu (self .iface .mainWindow ())
35
- self .menu .setTitle (" Analysis" )
41
+ self .menu .setTitle (QCoreApplication . translate ( "SEXTANTE" , " Analysis") )
36
42
37
43
icon = QIcon (os .path .dirname (__file__ ) + "/images/toolbox.png" )
38
44
self .toolboxAction = QAction (icon , \
39
- "&SEXTANTE Toolbox" , self .iface .mainWindow ())
45
+ QCoreApplication .translate ("SEXTANTE" , "&SEXTANTE Toolbox" ),
46
+ self .iface .mainWindow ())
40
47
QObject .connect (self .toolboxAction , SIGNAL ("triggered()" ), self .openToolbox )
41
48
self .menu .addAction (self .toolboxAction )
42
49
43
50
icon = QIcon (os .path .dirname (__file__ ) + "/images/model.png" )
44
51
self .modelerAction = QAction (icon , \
45
- "&SEXTANTE Modeler" , self .iface .mainWindow ())
52
+ QCoreApplication .translate ("SEXTANTE" , "&SEXTANTE Modeler" ),
53
+ self .iface .mainWindow ())
46
54
QObject .connect (self .modelerAction , SIGNAL ("triggered()" ), self .openModeler )
47
55
self .menu .addAction (self .modelerAction )
48
56
49
57
icon = QIcon (os .path .dirname (__file__ ) + "/images/history.gif" )
50
58
self .historyAction = QAction (icon , \
51
- "&SEXTANTE History and log" , self .iface .mainWindow ())
59
+ QCoreApplication .translate ("SEXTANTE" , "&SEXTANTE History and log" ),
60
+ self .iface .mainWindow ())
52
61
QObject .connect (self .historyAction , SIGNAL ("triggered()" ), self .openHistory )
53
62
self .menu .addAction (self .historyAction )
54
63
55
64
icon = QIcon (os .path .dirname (__file__ ) + "/images/config.png" )
56
65
self .configAction = QAction (icon , \
57
- "&SEXTANTE options and configuration" , self .iface .mainWindow ())
66
+ QCoreApplication .translate ("SEXTANTE" , "&SEXTANTE options and configuration" ),
67
+ self .iface .mainWindow ())
58
68
QObject .connect (self .configAction , SIGNAL ("triggered()" ), self .openConfig )
59
69
self .menu .addAction (self .configAction )
60
70
61
71
icon = QIcon (os .path .dirname (__file__ ) + "/images/results.png" )
62
72
self .resultsAction = QAction (icon , \
63
- "&SEXTANTE results viewer" , self .iface .mainWindow ())
73
+ QCoreApplication .translate ("SEXTANTE" , "&SEXTANTE results viewer" ),
74
+ self .iface .mainWindow ())
64
75
QObject .connect (self .resultsAction , SIGNAL ("triggered()" ), self .openResults )
65
76
self .menu .addAction (self .resultsAction )
66
77
67
78
icon = QIcon (os .path .dirname (__file__ ) + "/images/help.png" )
68
79
self .helpAction = QAction (icon , \
69
- "&SEXTANTE help" , self .iface .mainWindow ())
80
+ QCoreApplication .translate ("SEXTANTE" , "&SEXTANTE help" ),
81
+ self .iface .mainWindow ())
70
82
QObject .connect (self .helpAction , SIGNAL ("triggered()" ), self .openHelp )
71
83
self .menu .addAction (self .helpAction )
72
84
73
85
icon = QIcon (os .path .dirname (__file__ ) + "/images/info.png" )
74
86
self .aboutAction = QAction (icon , \
75
- "&About SEXTANTE" , self .iface .mainWindow ())
87
+ QCoreApplication .translate ("SEXTANTE" , "&About SEXTANTE" ),
88
+ self .iface .mainWindow ())
76
89
QObject .connect (self .aboutAction , SIGNAL ("triggered()" ), self .openAbout )
77
90
self .menu .addAction (self .aboutAction )
78
91
@@ -92,7 +105,6 @@ def unload(self):
92
105
#leave files that could not be deleted
93
106
pass
94
107
95
-
96
108
def openToolbox (self ):
97
109
self .toolbox .setVisible (True )
98
110
@@ -115,7 +127,7 @@ def openConfig(self):
115
127
dlg .exec_ ()
116
128
117
129
def openAbout (self ):
118
- dlg = AboutDialog ()
130
+ dlg = AboutDialog (self )
119
131
dlg .exec_ ()
120
132
121
133
def openHelp (self ):
@@ -126,5 +138,3 @@ def openHelp(self):
126
138
subprocess .Popen (('open' , filename ))
127
139
else :
128
140
subprocess .call (('xdg-open' , filename ))
129
-
130
-
0 commit comments