Skip to content

Commit 0a9bf95

Browse files
committedSep 16, 2015
[GRASS] removed old editing
1 parent 49401d5 commit 0a9bf95

26 files changed

+2
-4863
lines changed
 

‎src/plugins/grass/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ ENDIF (WIN32)
2222
SET (GRASS_PLUGIN_SRCS
2323
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassplugin.cpp
2424
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassselect.cpp
25-
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassedit.cpp
26-
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassedittools.cpp
2725
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrasstools.cpp
2826
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmapcalc.cpp
2927
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmodule.cpp
3028
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmoduleinput.cpp
3129
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmoduleoptions.cpp
3230
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmoduleparam.cpp
3331
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassnewmapset.cpp
34-
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassattributes.cpp
3532
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassregion.cpp
3633
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassutils.cpp
3734
)
@@ -40,30 +37,25 @@ SET (GRASS_PLUGIN_SRCS
4037
SET (GRASS_PLUGIN_UIS
4138
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrasstoolsbase.ui
4239
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassselectbase.ui
43-
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrasseditbase.ui
4440
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmapcalcbase.ui
4541
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmodulebase.ui
4642
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassnewmapsetbase.ui
47-
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassattributesbase.ui
4843
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassregionbase.ui
4944
${CMAKE_CURRENT_SOURCE_DIR}/../../ui/qgsprojectionselectorbase.ui
5045
)
5146

5247
SET (GRASS_PLUGIN_MOC_HDRS
5348
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassplugin.h
5449
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassselect.h
55-
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassedit.h
5650
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrasstools.h
5751
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmapcalc.h
5852
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmodule.h
5953
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmoduleinput.h
6054
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmoduleoptions.h
6155
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassmoduleparam.h
6256
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassnewmapset.h
63-
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassattributes.h
6457
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassregion.h
6558
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassutils.h
66-
${CMAKE_CURRENT_SOURCE_DIR}/qgsgrassedittools.h
6759
)
6860

6961
IF(NOT WIN32)

‎src/plugins/grass/qgsgrass_plugin.qrc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,18 @@
22
<qresource prefix="/images/themes/default/grass">
33
<file alias="closebutton.png">themes/default/closebutton.png</file>
44
<file alias="darkclosebutton.png">themes/default/darkclosebutton.png</file>
5-
<file alias="grass_add_vertex.png">themes/default/grass_add_vertex.png</file>
65
<file alias="grass_clear_input.png">themes/default/grass_clear_input.png</file>
7-
<file alias="grass_close_edit.png">themes/default/grass_close_edit.png</file>
86
<file alias="grass_close_mapset.png">themes/default/grass_close_mapset.png</file>
9-
<file alias="grass_delete_line.png">themes/default/grass_delete_line.png</file>
10-
<file alias="grass_delete_vertex.png">themes/default/grass_delete_vertex.png</file>
11-
<file alias="grass_edit_attributes.png">themes/default/grass_edit_attributes.png</file>
12-
<file alias="grass_edit.png">themes/default/grass_edit.png</file>
137
<file alias="grass_module_error.png">themes/default/grass_module_error.png</file>
148
<file alias="grass_module_warning.png">themes/default/grass_module_warning.png</file>
15-
<file alias="grass_move_line.png">themes/default/grass_move_line.png</file>
16-
<file alias="grass_move_vertex.png">themes/default/grass_move_vertex.png</file>
17-
<file alias="grass_new_boundary.png">themes/default/grass_new_boundary.png</file>
18-
<file alias="grass_new_centroid.png">themes/default/grass_new_centroid.png</file>
19-
<file alias="grass_new_line.png">themes/default/grass_new_line.png</file>
209
<file alias="grass_new_mapset.png">themes/default/grass_new_mapset.png</file>
21-
<file alias="grass_new_point.png">themes/default/grass_new_point.png</file>
2210
<file alias="grass_new_vector_layer.png">themes/default/grass_new_vector_layer.png</file>
2311
<file alias="grass_open_mapset.png">themes/default/grass_open_mapset.png</file>
2412
<file alias="grass_options_region.png">themes/default/grass_options_region.png</file>
2513
<file alias="grass_region_edit.png">themes/default/grass_region_edit.png</file>
2614
<file alias="grass_region.png">themes/default/grass_region.png</file>
2715
<file alias="grass_set_region.png">themes/default/grass_set_region.png</file>
2816
<file alias="grass_shell.png">themes/default/grass_shell.png</file>
29-
<file alias="grass_split_line.png">themes/default/grass_split_line.png</file>
3017
<file alias="grass_tools.png">themes/default/grass_tools.png</file>
3118
<file alias="mapcalc_add_connection.png">themes/default/mapcalc_add_connection.png</file>
3219
<file alias="mapcalc_add_constant.png">themes/default/mapcalc_add_constant.png</file>

‎src/plugins/grass/qgsgrassattributes.cpp

Lines changed: 0 additions & 371 deletions
This file was deleted.

‎src/plugins/grass/qgsgrassattributes.h

Lines changed: 0 additions & 125 deletions
This file was deleted.

‎src/plugins/grass/qgsgrassattributesbase.ui

Lines changed: 0 additions & 253 deletions
This file was deleted.

‎src/plugins/grass/qgsgrassedit.cpp

Lines changed: 0 additions & 1944 deletions
This file was deleted.

‎src/plugins/grass/qgsgrassedit.h

Lines changed: 0 additions & 465 deletions
This file was deleted.

‎src/plugins/grass/qgsgrasseditbase.ui

Lines changed: 0 additions & 448 deletions
This file was deleted.

‎src/plugins/grass/qgsgrassedittools.cpp

Lines changed: 0 additions & 931 deletions
This file was deleted.

‎src/plugins/grass/qgsgrassedittools.h

Lines changed: 0 additions & 177 deletions
This file was deleted.

‎src/plugins/grass/qgsgrassplugin.cpp

Lines changed: 1 addition & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "qgsgrass.h"
2020

2121
//the gui subclass
22-
#include "qgsgrassedit.h"
2322
#include "qgsgrassnewmapset.h"
2423
#include "qgsgrassregion.h"
2524
#include "qgsgrassselect.h"
@@ -72,12 +71,10 @@ QgsGrassPlugin::QgsGrassPlugin( QgisInterface * theQgisInterFace )
7271
, mRegionBand( 0 )
7372
, mTools( 0 )
7473
, mNewMapset( 0 )
75-
, mEdit( 0 )
7674
, mOpenMapsetAction( 0 )
7775
, mNewMapsetAction( 0 )
7876
, mCloseMapsetAction( 0 )
7977
, mOpenToolsAction( 0 )
80-
, mEditAction( 0 )
8178
, mNewVectorAction( 0 )
8279
{
8380
}
@@ -89,10 +86,6 @@ QgsGrassPlugin::~QgsGrassPlugin()
8986
// -> do not call mTools here
9087
//if ( mTools )
9188
// mTools->closeTools();
92-
if ( mEdit )
93-
{
94-
mEdit->closeEdit();
95-
}
9689
disconnect( QgsGrass::instance(), SIGNAL( mapsetChanged() ), this, SLOT( mapsetChanged() ) );
9790
QgsGrass::instance()->closeMapsetWarn();
9891
}
@@ -174,15 +167,11 @@ void QgsGrassPlugin::initGui()
174167
mRegionAction->setWhatsThis( tr( "Displays the current GRASS region as a rectangle on the map canvas" ) );
175168
mRegionAction->setCheckable( true );
176169

177-
mEditAction = new QAction( QIcon(), tr( "Edit Grass Vector layer" ), this );
178-
mEditAction->setObjectName( "mEditAction" );
179-
mEditAction->setWhatsThis( tr( "Edit the currently selected GRASS vector layer." ) );
180170
mNewVectorAction = new QAction( QIcon(), tr( "Create New Grass Vector" ), this );
181171
mNewVectorAction->setObjectName( "mNewVectorAction" );
182172

183173
// Connect the action
184174
connect( mOpenToolsAction, SIGNAL( triggered() ), this, SLOT( openTools() ) );
185-
connect( mEditAction, SIGNAL( triggered() ), this, SLOT( edit() ) );
186175
connect( mNewVectorAction, SIGNAL( triggered() ), this, SLOT( newVector() ) );
187176
connect( mRegionAction, SIGNAL( toggled( bool ) ), this, SLOT( switchRegion( bool ) ) );
188177
connect( mOpenMapsetAction, SIGNAL( triggered() ), this, SLOT( openMapset() ) );
@@ -194,7 +183,6 @@ void QgsGrassPlugin::initGui()
194183
qGisInterface->addPluginToMenu( tr( "&GRASS" ), mNewMapsetAction );
195184
qGisInterface->addPluginToMenu( tr( "&GRASS" ), mCloseMapsetAction );
196185
qGisInterface->addPluginToMenu( tr( "&GRASS" ), mNewVectorAction );
197-
qGisInterface->addPluginToMenu( tr( "&GRASS" ), mEditAction );
198186
qGisInterface->addPluginToMenu( tr( "&GRASS" ), mOpenToolsAction );
199187
qGisInterface->addPluginToMenu( tr( "&GRASS" ), mRegionAction );
200188

@@ -208,7 +196,6 @@ void QgsGrassPlugin::initGui()
208196
mToolBarPointer->addAction( mCloseMapsetAction );
209197
mToolBarPointer->addSeparator();
210198
mToolBarPointer->addAction( mNewVectorAction );
211-
mToolBarPointer->addAction( mEditAction );
212199
mToolBarPointer->addAction( mOpenToolsAction );
213200
mToolBarPointer->addAction( mRegionAction );
214201

@@ -220,10 +207,6 @@ void QgsGrassPlugin::initGui()
220207
// Connect display region
221208
connect( mCanvas, SIGNAL( renderComplete( QPainter * ) ), this, SLOT( postRender( QPainter * ) ) );
222209

223-
setEditAction();
224-
connect( qGisInterface, SIGNAL( currentLayerChanged( QgsMapLayer * ) ),
225-
this, SLOT( setEditAction() ) );
226-
227210
connect( QgsGrass::instance(), SIGNAL( mapsetChanged() ), SLOT( mapsetChanged() ) );
228211
connect( QgsGrass::instance(), SIGNAL( regionChanged() ), SLOT( displayRegion() ) );
229212
connect( QgsGrass::instance(), SIGNAL( regionPenChanged() ), SLOT( displayRegion() ) );
@@ -293,83 +276,8 @@ void QgsGrassPlugin::openTools()
293276
mTools->show();
294277
}
295278

296-
297-
// Start vector editing
298-
void QgsGrassPlugin::edit()
299-
{
300-
if ( QgsGrassEdit::isRunning() )
301-
{
302-
QMessageBox::warning( 0, tr( "Warning" ), tr( "GRASS Edit is already running." ) );
303-
return;
304-
}
305-
306-
mEditAction->setEnabled( false );
307-
mEdit = new QgsGrassEdit( qGisInterface, qGisInterface->activeLayer(), false,
308-
qGisInterface->mainWindow(), Qt::Dialog );
309-
310-
if ( mEdit->isValid() )
311-
{
312-
mEdit->show();
313-
mCanvas->refresh();
314-
connect( mEdit, SIGNAL( finished() ), this, SLOT( setEditAction() ) );
315-
connect( mEdit, SIGNAL( finished() ), this, SLOT( cleanUp() ) );
316-
connect( mEdit, SIGNAL( destroyed() ), this, SLOT( editClosed() ) );
317-
connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( closeEdit( QString ) ) );
318-
}
319-
else
320-
{
321-
delete mEdit;
322-
mEdit = NULL;
323-
mEditAction->setEnabled( true );
324-
}
325-
}
326-
327-
void QgsGrassPlugin::setEditAction()
328-
{
329-
// QgsDebugMsg("entered.");
330-
331-
QgsMapLayer *layer = ( QgsMapLayer * ) qGisInterface->activeLayer();
332-
333-
if ( QgsGrassEdit::isEditable( layer ) )
334-
{
335-
mEditAction->setEnabled( true );
336-
}
337-
else
338-
{
339-
mEditAction->setEnabled( false );
340-
}
341-
}
342-
343-
void QgsGrassPlugin::closeEdit( QString layerId )
344-
{
345-
if ( mEdit->layer()->id() == layerId )
346-
{
347-
mEdit->closeEdit();
348-
}
349-
}
350-
351-
void QgsGrassPlugin::editClosed()
352-
{
353-
if ( mEdit == sender() )
354-
mEdit = 0;
355-
}
356-
357-
void QgsGrassPlugin::cleanUp()
358-
{
359-
disconnect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( closeEdit( QString ) ) );
360-
}
361-
362279
void QgsGrassPlugin::newVector()
363280
{
364-
// QgsDebugMsg("entered.");
365-
366-
367-
if ( QgsGrassEdit::isRunning() )
368-
{
369-
QMessageBox::warning( 0, tr( "Warning" ), tr( "GRASS Edit is already running." ) );
370-
return;
371-
}
372-
373281
bool ok;
374282
QString name;
375283

@@ -424,26 +332,7 @@ void QgsGrassPlugin::newVector()
424332
return;
425333
}
426334

427-
QgsGrassEdit *ed = new QgsGrassEdit( qGisInterface, layer, true,
428-
qGisInterface->mainWindow(), Qt::Dialog );
429-
430-
if ( ed->isValid() )
431-
{
432-
ed->show();
433-
mCanvas->refresh();
434-
}
435-
else
436-
{
437-
QMessageBox::warning( 0, tr( "Warning" ), tr( "Cannot start editing." ) );
438-
delete ed;
439-
}
440-
#if 0
441-
if ( !( mProvider->startEdit() ) )
442-
{
443-
QMessageBox::warning( 0, tr( "Warning" ), tr( "Cannot open vector for update." ) );
444-
return;
445-
}
446-
#endif
335+
// TODO: start editing?
447336
}
448337

449338
void QgsGrassPlugin::postRender( QPainter *painter )
@@ -616,15 +505,13 @@ void QgsGrassPlugin::unload()
616505
qGisInterface->removePluginMenu( tr( "&GRASS" ), mCloseMapsetAction );
617506
qGisInterface->removePluginMenu( tr( "&GRASS" ), mOpenToolsAction );
618507
qGisInterface->removePluginMenu( tr( "&GRASS" ), mRegionAction );
619-
qGisInterface->removePluginMenu( tr( "&GRASS" ), mEditAction );
620508
qGisInterface->removePluginMenu( tr( "&GRASS" ), mNewVectorAction );
621509

622510
delete mOpenMapsetAction;
623511
delete mNewMapsetAction;
624512
delete mCloseMapsetAction;
625513
delete mOpenToolsAction;
626514
delete mRegionAction;
627-
delete mEditAction;
628515
delete mNewVectorAction;
629516

630517
delete mToolBarPointer;
@@ -657,7 +544,6 @@ void QgsGrassPlugin::setCurrentTheme( QString theThemeName )
657544

658545
mRegionAction->setIcon( getThemeIcon( "grass_region.png" ) );
659546

660-
mEditAction->setIcon( getThemeIcon( "grass_edit.png" ) );
661547
mNewVectorAction->setIcon( getThemeIcon( "grass_new_vector_layer.png" ) );
662548
}
663549
}

‎src/plugins/grass/qgsgrassplugin.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
class QgsGrassTools;
2424
class QgsGrassNewMapset;
2525
class QgsGrassRegion;
26-
class QgsGrassEdit;
2726

2827
class QgsMapCanvas;
2928
class QgsRubberBand;
@@ -79,8 +78,6 @@ class QgsGrassPlugin : public QObject, public QgisPlugin
7978
public slots:
8079
//! init the gui
8180
virtual void initGui() override;
82-
//! Start vector editing
83-
void edit();
8481
//! unload the plugin
8582
void unload() override;
8683
//! show the help document
@@ -109,16 +106,9 @@ class QgsGrassPlugin : public QObject, public QgisPlugin
109106
void projectRead();
110107
//! New project
111108
void newProject();
112-
//! Set edit action
113-
void setEditAction();
114-
//! Close the edit if layer is removed
115-
void closeEdit( QString layerId );
116-
//! Cleanup the Grass Edit
117-
void cleanUp();
118109
//! update plugin icons when the app tells us its theme is changed
119110
void setCurrentTheme( QString theThemeName );
120111
void setTransform();
121-
void editClosed();
122112
private:
123113
//! Pointer to our toolbar
124114
QToolBar *mToolBarPointer;
@@ -136,7 +126,6 @@ class QgsGrassPlugin : public QObject, public QgisPlugin
136126
QgsGrassTools *mTools;
137127
//! Pointer to QgsGrassNewMapset
138128
QgsGrassNewMapset *mNewMapset;
139-
QgsGrassEdit *mEdit;
140129

141130
QgsCoordinateReferenceSystem mCrs;
142131
QgsCoordinateTransform mCoordinateTransform;
@@ -146,7 +135,6 @@ class QgsGrassPlugin : public QObject, public QgisPlugin
146135
QAction *mNewMapsetAction;
147136
QAction *mCloseMapsetAction;
148137
QAction *mOpenToolsAction;
149-
QAction *mEditAction;
150138
QAction *mNewVectorAction;
151139
};
152140

‎src/plugins/grass/qgsgrasstools.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class QgsGrassToolsTreeFilterProxyModel;
3535
* \brief Interface to GRASS modules.
3636
*
3737
*/
38-
class QgsGrassTools: public QDockWidget, private Ui::QgsGrassToolsBase
38+
class QgsGrassTools: public QDockWidget, public Ui::QgsGrassToolsBase
3939
{
4040
Q_OBJECT
4141

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1.12 KB
Binary file not shown.
Binary file not shown.
-769 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-805 Bytes
Binary file not shown.
-787 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.