Skip to content

Commit

Permalink
add command line to create screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Oct 4, 2018
1 parent ffdf617 commit 2e1274e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ void usage( const QString &appName )
<< QStringLiteral( "\t[--dxf-scale-denom scale]\tscale for dxf output\n" )
<< QStringLiteral( "\t[--dxf-encoding encoding]\tencoding to use for dxf output\n" )
<< QStringLiteral( "\t[--dxf-map-theme maptheme]\tmap theme to use for dxf output\n" )
<< QStringLiteral( "\t[--take-screenshots output_path]\ttake screen shots for the user documentation\n" )
<< QStringLiteral( "\t[--profile name]\tload a named profile from the users profiles folder.\n" )
<< QStringLiteral( "\t[--profiles-path path]\tpath to store user profile folders. Will create profiles inside a {path}\\profiles folder \n" )
<< QStringLiteral( "\t[--version-migration]\tforce the settings migration from older version if found\n" )
Expand Down Expand Up @@ -529,6 +530,9 @@ int main( int argc, char *argv[] )
QString dxfMapTheme;
QgsRectangle dxfExtent;

bool takeScreenShots = false;
QString screenShotsPath;

// This behavior will set initial extent of map canvas, but only if
// there are no command line arguments. This gives a usable map
// extent when qgis starts with no layers loaded. When layers are
Expand Down Expand Up @@ -745,6 +749,11 @@ int main( int argc, char *argv[] )
{
dxfMapTheme = args[++i];
}
else if ( arg == QLatin1String( "--take-screenshots" ) )
{
takeScreenShots = true;
screenShotsPath = args[++i];
}
#ifdef HAVE_OPENCL
else if ( arg == QLatin1String( "--openclprogramfolder" ) )
{
Expand Down Expand Up @@ -1457,6 +1466,11 @@ int main( int argc, char *argv[] )

#endif

if ( takeScreenShots )
{
qgis->takeAppScreenShots( screenShotsPath );
}

/////////////////////////////////////////////////////////////////////
// Continue on to interactive gui...
/////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 2e1274e

Please sign in to comment.