Skip to content

Commit 0fec164

Browse files
committedOct 4, 2018
give root name + restore all screenshots
1 parent 3fc3206 commit 0fec164

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
 

‎src/app/qgsappscreenshots.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ void QgsAppScreenShots::saveScreenshot( const QString &name, QWidget *widget, Gr
6363
}
6464
if ( !widget || mode != GrabWidget )
6565
{
66-
pix = scr->grabWindow( 0, x, y, w, h );
66+
WId wid = widget ? widget->winId() : 0;
67+
pix = scr->grabWindow( wid, x, y, w, h );
6768
}
6869

6970
const QString &fileName = mSaveDirectory + "/" + name + ".png";
@@ -94,6 +95,7 @@ void QgsAppScreenShots::moveWidgetTo( QWidget *widget, Qt::Corner corner, Refere
9495
case Qt::BottomRightCorner:
9596
case Qt::TopRightCorner:
9697
case Qt::TopLeftCorner:
98+
// TODO
9799
return;
98100
}
99101
}
@@ -118,10 +120,13 @@ void QgsAppScreenShots::takeScreenshots( Categories categories )
118120
takeVectorLayerProperties();
119121
}
120122

123+
124+
// ----------------------
121125
// !!!!! SCREENSHOTS !!!!
122126

123127
void QgsAppScreenShots::takeVectorLayerProperties()
124128
{
129+
QString rootName = QLatin1String( "vectorlayerproperties_" );
125130
QgsVectorLayerProperties *dlg = new QgsVectorLayerProperties( mVectorLayer, QgisApp::instance() );
126131
dlg->show();
127132
// ----------------
@@ -133,7 +138,7 @@ void QgsAppScreenShots::takeVectorLayerProperties()
133138
QCoreApplication::processEvents();
134139
QString name = dlg->mOptionsListWidget->item( row )[0].text().toLower();
135140
name.replace( " ", "_" );
136-
//saveScreenshot( name, dlg );
141+
saveScreenshot( rootName + name, dlg );
137142
}
138143
// ------------------
139144
// style menu clicked
@@ -143,7 +148,7 @@ void QgsAppScreenShots::takeVectorLayerProperties()
143148
QCoreApplication::processEvents();
144149
dlg->mBtnStyle->click();
145150
QCoreApplication::processEvents();
146-
saveScreenshot( "style", dlg );
151+
saveScreenshot( rootName + "style_menu", dlg );
147152
QCoreApplication::processEvents();
148153
dlg->mBtnStyle->menu()->hide();
149154
QCoreApplication::processEvents();

0 commit comments

Comments
 (0)
Please sign in to comment.