@@ -122,6 +122,38 @@ QgsGrassEdit::QgsGrassEdit ( QgisApp *qgisApp, QgisIface *iface,
122
122
// TODO dynamic_cast ?
123
123
mProvider = (QgsGrassProvider *) vector->getDataProvider ();
124
124
125
+ init ();
126
+
127
+ }
128
+
129
+ QgsGrassEdit::QgsGrassEdit ( QgisApp *qgisApp, QgisIface *iface,
130
+ QgsGrassProvider *provider,
131
+ QWidget * parent, Qt::WFlags f )
132
+ :QMainWindow(parent, 0 , f), QgsGrassEditBase ()
133
+ {
134
+ #ifdef QGISDEBUG
135
+ std::cerr << " QgsGrassEdit()" << std::endl;
136
+ #endif
137
+
138
+ setupUi (this );
139
+
140
+ mRunning = true ;
141
+ mValid = false ;
142
+ mTool = QgsGrassEdit::NONE;
143
+ mSuspend = false ;
144
+ mQgisApp = qgisApp;
145
+ mIface = iface;
146
+ mNewMap = true ;
147
+
148
+ mCanvas = mIface ->getMapCanvas ();
149
+
150
+ mProvider = provider;
151
+
152
+ init ();
153
+ }
154
+
155
+ void QgsGrassEdit::init ()
156
+ {
125
157
QString myIconPath = QgsApplication::themePath () + " /grass/" ;
126
158
127
159
QActionGroup *ag = new QActionGroup ( this );
@@ -221,38 +253,6 @@ QgsGrassEdit::QgsGrassEdit ( QgisApp *qgisApp, QgisIface *iface,
221
253
tb->addAction ( mCloseEditAction );
222
254
connect ( mCloseEditAction , SIGNAL (triggered ()), this , SLOT (closeEdit ()) );
223
255
224
- init ();
225
-
226
- mNewPointAction ->setOn (true );
227
- startTool (QgsGrassEdit::NEW_POINT);
228
- }
229
-
230
- QgsGrassEdit::QgsGrassEdit ( QgisApp *qgisApp, QgisIface *iface,
231
- QgsGrassProvider *provider,
232
- QWidget * parent, Qt::WFlags f )
233
- :QMainWindow(parent, 0 , f), QgsGrassEditBase ()
234
- {
235
- #ifdef QGISDEBUG
236
- std::cerr << " QgsGrassEdit()" << std::endl;
237
- #endif
238
-
239
- mRunning = true ;
240
- mValid = false ;
241
- mTool = QgsGrassEdit::NONE;
242
- mSuspend = false ;
243
- mQgisApp = qgisApp;
244
- mIface = iface;
245
- mNewMap = true ;
246
-
247
- mCanvas = mIface ->getMapCanvas ();
248
-
249
- mProvider = provider;
250
-
251
- init ();
252
- }
253
-
254
- void QgsGrassEdit::init ()
255
- {
256
256
if ( !(mProvider ->isGrassEditable ()) ) {
257
257
QMessageBox::warning ( 0 , " Warning" , " You are not owner of the mapset, "
258
258
" cannot open the vector for editing." );
@@ -453,6 +453,8 @@ void QgsGrassEdit::init()
453
453
454
454
// TODO: how to get keyboard events from canvas (shortcuts)
455
455
456
+ mNewPointAction ->setOn (true ); // Start NEW_POINT tool
457
+
456
458
restorePosition ();
457
459
458
460
mValid = true ;
0 commit comments