qgssnappingdialog2.diff
python/core/qgsmaplayerregistry.sip (Arbeitskopie) | ||
---|---|---|
73 | 73 | |
74 | 74 |
signals: |
75 | 75 | |
76 |
/** emitted when a layer is removed from the registry
|
|
76 |
/** emitted when a layer will be removed from the registry
|
|
77 | 77 | |
78 | 78 |
connected to main map canvas and overview map canvas remove() |
79 | 79 |
*/ |
80 | 80 |
void layerWillBeRemoved(QString theLayerId); |
81 | 81 | |
82 |
/** emitted when a layer was removed from the registry |
|
83 | ||
84 |
connected to main map canvas and overview map canvas remove() |
|
85 |
*/ |
|
86 |
void layerWasRemoved( ); |
|
87 | ||
82 | 88 |
/** emitted when a layer is added to the registry |
83 | 89 | |
84 | 90 |
connected to main map canvas and overview map canvas addLayer() |
src/app/qgssnappingdialog.cpp (Arbeitskopie) | ||
---|---|---|
27 | 27 |
#include <QComboBox> |
28 | 28 |
#include <QLineEdit> |
29 | 29 |
#include <QDockWidget> |
30 |
#include <QPushButton> |
|
30 | 31 | |
31 | 32 | |
32 | 33 |
class QgsSnappingDock : public QDockWidget |
... | ... | |
63 | 64 |
else |
64 | 65 |
{ |
65 | 66 |
connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( apply() ) ); |
67 |
connect( mButtonBox->button(QDialogButtonBox::Apply), SIGNAL( clicked() ), this, SLOT( apply() ) ); |
|
66 | 68 |
} |
67 | 69 |
connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWasAdded( QgsMapLayer * ) ), this, SLOT( update() ) ); |
68 |
connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( update() ) );
|
|
70 |
connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWasRemoved( ) ), this, SLOT( update() ) );
|
|
69 | 71 | |
70 | 72 |
update(); |
71 | 73 | |
... | ... | |
133 | 135 | |
134 | 136 |
mLayerTreeWidget->clear(); |
135 | 137 | |
136 |
for ( int i = 0; i < mMapCanvas->layerCount(); ++i ) |
|
138 |
QMap< QString, QgsMapLayer *> mapLayers = QgsMapLayerRegistry::instance()->mapLayers(); |
|
139 |
QMap< QString, QgsMapLayer *>::iterator it; |
|
140 |
for ( it = mapLayers.begin(); it != mapLayers.end() ; ++it ) |
|
137 | 141 |
{ |
138 |
QgsVectorLayer *currentVectorLayer = qobject_cast<QgsVectorLayer *>( mMapCanvas->layer( i ) );
|
|
142 |
QgsVectorLayer *currentVectorLayer = qobject_cast<QgsVectorLayer *>( it.value() );
|
|
139 | 143 |
if ( !currentVectorLayer ) |
140 | 144 |
continue; |
141 | 145 |
src/app/qgsprojectproperties.h (Arbeitskopie) | ||
---|---|---|
21 | 21 |
#include "ui_qgsprojectpropertiesbase.h" |
22 | 22 |
#include "qgis.h" |
23 | 23 |
#include "qgisgui.h" |
24 |
#include "qgssnappingdialog.h" |
|
24 |
//#include "qgssnappingdialog.h"
|
|
25 | 25 |
#include "qgscontexthelp.h" |
26 | 26 | |
27 | 27 |
class QgsMapCanvas; |
src/core/qgsmaplayerregistry.cpp (Arbeitskopie) | ||
---|---|---|
97 | 97 |
emit layerWillBeRemoved( theLayerId ); |
98 | 98 |
delete mMapLayers[theLayerId]; |
99 | 99 |
mMapLayers.remove( theLayerId ); |
100 |
if ( theEmitSignal ) |
|
101 |
emit layerWasRemoved( ); |
|
100 | 102 |
} |
101 | 103 | |
102 | 104 |
void QgsMapLayerRegistry::removeAllMapLayers() |
... | ... | |
111 | 113 |
{ |
112 | 114 |
emit layerWillBeRemoved( it.key() ); |
113 | 115 |
delete it.value(); // delete the map layer |
116 |
emit layerWasRemoved( ); |
|
114 | 117 |
} |
115 | 118 |
mMapLayers.clear(); |
116 | 119 |
src/core/qgsmaplayerregistry.h (Arbeitskopie) | ||
---|---|---|
96 | 96 | |
97 | 97 |
signals: |
98 | 98 | |
99 |
/** emitted when a layer is removed from the registry
|
|
99 |
/** emitted when a layer will be removed from the registry
|
|
100 | 100 |
connected to main map canvas and overview map canvas remove() |
101 | 101 |
*/ |
102 | 102 |
void layerWillBeRemoved( QString theLayerId ); |
103 | 103 | |
104 |
/** emitted when a layer was removed from the registry |
|
105 |
connected to main map canvas and overview map canvas remove() |
|
106 |
*/ |
|
107 |
void layerWasRemoved( ); |
|
108 | ||
104 | 109 |
/** emitted when a layer is added to the registry |
105 | 110 |
connected to main map canvas and overview map canvas addLayer() |
106 | 111 |
*/ |
src/ui/qgssnappingdialogbase.ui (Arbeitskopie) | ||
---|---|---|
30 | 30 |
</property> |
31 | 31 |
<column> |
32 | 32 |
<property name="text"> |
33 |
<string> </string>
|
|
33 |
<string/>
|
|
34 | 34 |
</property> |
35 | 35 |
</column> |
36 | 36 |
<column> |
... | ... | |
61 | 61 |
<enum>Qt::Horizontal</enum> |
62 | 62 |
</property> |
63 | 63 |
<property name="standardButtons"> |
64 |
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
|
64 |
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
65 | 65 |
</property> |
66 | 66 |
</widget> |
67 | 67 |
</item> |