Mercurial > hg > svgui
comparison widgets/PropertyStack.cpp @ 397:2c59b0cd176b
* Update translations, and add change counter to name of bundle command
author | Chris Cannam |
---|---|
date | Thu, 12 Jun 2008 10:47:11 +0000 |
parents | 0bcb449d15f4 |
children | 2e8194a30f40 |
comparison
equal
deleted
inserted
replaced
396:2669267fb7ea | 397:2c59b0cd176b |
---|---|
201 } | 201 } |
202 | 202 |
203 class ShowLayerCommand : public QObject, public Command | 203 class ShowLayerCommand : public QObject, public Command |
204 { | 204 { |
205 public: | 205 public: |
206 ShowLayerCommand(View *view, Layer *layer, bool show) : | 206 ShowLayerCommand(View *view, Layer *layer, bool show, QString name) : |
207 m_view(view), m_layer(layer), m_show(show) { } | 207 m_view(view), m_layer(layer), m_show(show), m_name(name) { } |
208 void execute() { | 208 void execute() { |
209 m_layer->showLayer(m_view, m_show); | 209 m_layer->showLayer(m_view, m_show); |
210 } | 210 } |
211 void unexecute() { | 211 void unexecute() { |
212 m_layer->showLayer(m_view, !m_show); | 212 m_layer->showLayer(m_view, !m_show); |
213 } | 213 } |
214 QString getName() const { | 214 QString getName() const { |
215 return tr("Change Layer Visibility"); | 215 return m_name; |
216 } | 216 } |
217 protected: | 217 protected: |
218 View *m_view; | 218 View *m_view; |
219 Layer *m_layer; | 219 Layer *m_layer; |
220 bool m_show; | 220 bool m_show; |
221 QString m_name; | |
221 }; | 222 }; |
222 | 223 |
223 void | 224 void |
224 PropertyStack::showLayer(bool show) | 225 PropertyStack::showLayer(bool show) |
225 { | 226 { |
228 for (unsigned int i = 0; i < m_boxes.size(); ++i) { | 229 for (unsigned int i = 0; i < m_boxes.size(); ++i) { |
229 if (obj == m_boxes[i]) { | 230 if (obj == m_boxes[i]) { |
230 Layer *layer = dynamic_cast<Layer *>(m_boxes[i]->getContainer()); | 231 Layer *layer = dynamic_cast<Layer *>(m_boxes[i]->getContainer()); |
231 if (layer) { | 232 if (layer) { |
232 CommandHistory::getInstance()->addCommand | 233 CommandHistory::getInstance()->addCommand |
233 (new ShowLayerCommand(m_client, layer, show)); | 234 (new ShowLayerCommand(m_client, layer, show, |
235 tr("Change Layer Visibility"))); | |
234 return; | 236 return; |
235 } | 237 } |
236 } | 238 } |
237 } | 239 } |
238 } | 240 } |