File tree 3 files changed +33
-2
lines changed
3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ ENDIF(NOT WIN32)
110
110
111
111
SET (GRASS_PLUGIN_RCCS qgsgrass_plugin.qrc)
112
112
113
+ SET (GRASS_BROWSER_SRCS qgis.g.browser.cpp)
113
114
114
115
########################################################
115
116
# Build
@@ -153,6 +154,12 @@ TARGET_LINK_LIBRARIES(grassplugin
153
154
${OPENPTY_LIBRARY}
154
155
)
155
156
157
+ ADD_EXECUTABLE (qgis.g.browser ${GRASS_BROWSER_SRCS} )
158
+
159
+ TARGET_LINK_LIBRARIES (qgis.g.browser
160
+ ${QT_QTGUI_LIBRARY}
161
+ ${QT_QTCORE_LIBRARY}
162
+ )
156
163
157
164
########################################################
158
165
# Install
@@ -165,3 +172,8 @@ INSTALL(TARGETS grassplugin
165
172
FILE (GLOB GMLS *.gml)
166
173
INSTALL (FILES ${GMLS} images/world.png
167
174
DESTINATION ${QGIS_DATA_DIR} /grass)
175
+
176
+ INSTALL (TARGETS qgis.g.browser
177
+ RUNTIME DESTINATION ${QGIS_DATA_DIR} /grass/bin
178
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
179
+ )
Original file line number Diff line number Diff line change
1
+ #include < stdlib.h>
2
+ #include < stdio.h>
3
+ #include < unistd.h>
4
+ #include < QUrl>
5
+ #include < QDesktopServices>
6
+
7
+ // Open a URL by default browser
8
+ int main (int argc, char **argv)
9
+ {
10
+ if ( argc < 2 )
11
+ {
12
+ fprintf ( stderr, " URL argument missing\n " );
13
+ exit (1 );
14
+ }
15
+ QDesktopServices::openUrl ( QUrl ( argv[1 ] ) );
16
+ sleep (1 ); // not nice but if it exits immediately the page sometimes does not open
17
+ exit ( 0 );
18
+ }
Original file line number Diff line number Diff line change @@ -1273,13 +1273,14 @@ void QgsGrassModule::run()
1273
1273
commandHtml.replace ( " >" , " >" );
1274
1274
mOutputTextBrowser ->append ( " <B>" + commandHtml + " </B>" );
1275
1275
1276
+ QStringList environment = QProcess::systemEnvironment ();
1277
+ environment.append ( " GRASS_HTML_BROWSER=" + QgsApplication::pkgDataPath () + " /grass/bin/qgis.g.browser" );
1278
+
1276
1279
// Warning: it is not useful to write requested region to WIND file and
1277
1280
// reset then to original beacuse it is reset before
1278
1281
// the region is read by a module even if waitForStarted() is used
1279
1282
// -> necessary to pass region as environment variable
1280
1283
// but the feature is available in GRASS 6.1 only since 23.3.2006
1281
-
1282
- QStringList environment = QProcess::systemEnvironment ();
1283
1284
if ( resetRegion )
1284
1285
{
1285
1286
QString reg = QgsGrass::regionString ( &tempWindow );
You can’t perform that action at this time.
0 commit comments