Skip to content

Commit 2e1274e

Browse files
committed
add command line to create screenshots
1 parent ffdf617 commit 2e1274e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/app/main.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ void usage( const QString &appName )
142142
<< QStringLiteral( "\t[--dxf-scale-denom scale]\tscale for dxf output\n" )
143143
<< QStringLiteral( "\t[--dxf-encoding encoding]\tencoding to use for dxf output\n" )
144144
<< QStringLiteral( "\t[--dxf-map-theme maptheme]\tmap theme to use for dxf output\n" )
145+
<< QStringLiteral( "\t[--take-screenshots output_path]\ttake screen shots for the user documentation\n" )
145146
<< QStringLiteral( "\t[--profile name]\tload a named profile from the users profiles folder.\n" )
146147
<< QStringLiteral( "\t[--profiles-path path]\tpath to store user profile folders. Will create profiles inside a {path}\\profiles folder \n" )
147148
<< QStringLiteral( "\t[--version-migration]\tforce the settings migration from older version if found\n" )
@@ -529,6 +530,9 @@ int main( int argc, char *argv[] )
529530
QString dxfMapTheme;
530531
QgsRectangle dxfExtent;
531532

533+
bool takeScreenShots = false;
534+
QString screenShotsPath;
535+
532536
// This behavior will set initial extent of map canvas, but only if
533537
// there are no command line arguments. This gives a usable map
534538
// extent when qgis starts with no layers loaded. When layers are
@@ -745,6 +749,11 @@ int main( int argc, char *argv[] )
745749
{
746750
dxfMapTheme = args[++i];
747751
}
752+
else if ( arg == QLatin1String( "--take-screenshots" ) )
753+
{
754+
takeScreenShots = true;
755+
screenShotsPath = args[++i];
756+
}
748757
#ifdef HAVE_OPENCL
749758
else if ( arg == QLatin1String( "--openclprogramfolder" ) )
750759
{
@@ -1457,6 +1466,11 @@ int main( int argc, char *argv[] )
14571466

14581467
#endif
14591468

1469+
if ( takeScreenShots )
1470+
{
1471+
qgis->takeAppScreenShots( screenShotsPath );
1472+
}
1473+
14601474
/////////////////////////////////////////////////////////////////////
14611475
// Continue on to interactive gui...
14621476
/////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)