Mercurial > hg > svgui
comparison widgets/PropertyStack.cpp @ 732:558c71a802d4 tonioni
Pull out ShowLayerCommand into its own file
author | Chris Cannam |
---|---|
date | Wed, 05 Mar 2014 13:04:09 +0000 |
parents | 596414d20ef0 |
children | b6dc57688c72 |
comparison
equal
deleted
inserted
replaced
731:f831ca41d4a5 | 732:558c71a802d4 |
---|---|
21 #include "layer/LayerFactory.h" | 21 #include "layer/LayerFactory.h" |
22 #include "widgets/NotifyingTabBar.h" | 22 #include "widgets/NotifyingTabBar.h" |
23 #include "widgets/IconLoader.h" | 23 #include "widgets/IconLoader.h" |
24 #include "base/Command.h" | 24 #include "base/Command.h" |
25 #include "widgets/CommandHistory.h" | 25 #include "widgets/CommandHistory.h" |
26 #include "layer/ShowLayerCommand.h" | |
26 | 27 |
27 #include <QIcon> | 28 #include <QIcon> |
28 #include <QTabWidget> | 29 #include <QTabWidget> |
29 | 30 |
30 #include <iostream> | 31 #include <iostream> |
219 { | 220 { |
220 if (sender() != m_client) return; | 221 if (sender() != m_client) return; |
221 repopulate(); | 222 repopulate(); |
222 } | 223 } |
223 | 224 |
224 class ShowLayerCommand : public QObject, public Command | |
225 { | |
226 public: | |
227 ShowLayerCommand(View *view, Layer *layer, bool show, QString name) : | |
228 m_view(view), m_layer(layer), m_show(show), m_name(name) { } | |
229 void execute() { | |
230 m_layer->showLayer(m_view, m_show); | |
231 } | |
232 void unexecute() { | |
233 m_layer->showLayer(m_view, !m_show); | |
234 } | |
235 QString getName() const { | |
236 return m_name; | |
237 } | |
238 protected: | |
239 View *m_view; | |
240 Layer *m_layer; | |
241 bool m_show; | |
242 QString m_name; | |
243 }; | |
244 | |
245 void | 225 void |
246 PropertyStack::showLayer(bool show) | 226 PropertyStack::showLayer(bool show) |
247 { | 227 { |
248 QObject *obj = sender(); | 228 QObject *obj = sender(); |
249 | 229 |