diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
commit | 9f2f65a698c4cc71373a7fe9d73a0889e0d3487b (patch) | |
tree | 4ad67db771d73ea3c48f80a1244037fc9754edd2 /src/ClockTool.cc | |
parent | 1f01d84c080d607a91eb417efcaf5e500b5f1d7e (diff) | |
download | fluxbox_pavel-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.zip fluxbox_pavel-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.tar.bz2 |
make FbTk::Command a template class, split parsing information out of ObjectRegistry
Diffstat (limited to 'src/ClockTool.cc')
-rw-r--r-- | src/ClockTool.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ClockTool.cc b/src/ClockTool.cc index adc6adc..ae78266 100644 --- a/src/ClockTool.cc +++ b/src/ClockTool.cc | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include "ToolTheme.hh" | 25 | #include "ToolTheme.hh" |
26 | #include "Screen.hh" | 26 | #include "Screen.hh" |
27 | #include "FbTk/ObjectRegistry.hh" | 27 | #include "FbTk/CommandParser.hh" |
28 | #include "CommandDialog.hh" | 28 | #include "CommandDialog.hh" |
29 | #include "fluxbox.hh" | 29 | #include "fluxbox.hh" |
30 | 30 | ||
@@ -116,7 +116,7 @@ private: | |||
116 | ClockTool &m_tool; | 116 | ClockTool &m_tool; |
117 | }; | 117 | }; |
118 | 118 | ||
119 | class EditClockFormatCmd: public FbTk::Command { | 119 | class EditClockFormatCmd: public FbTk::Command<void> { |
120 | public: | 120 | public: |
121 | void execute() { | 121 | void execute() { |
122 | BScreen *screen = Fluxbox::instance()->mouseScreen(); | 122 | BScreen *screen = Fluxbox::instance()->mouseScreen(); |
@@ -126,7 +126,7 @@ public: | |||
126 | 126 | ||
127 | CommandDialog *dialog = new CommandDialog(*screen, "Edit Clock Format", | 127 | CommandDialog *dialog = new CommandDialog(*screen, "Edit Clock Format", |
128 | "SetResourceValue " + resourcename + " "); | 128 | "SetResourceValue " + resourcename + " "); |
129 | FbTk::RefCount<FbTk::Command> cmd(FbTk::ObjectRegistry<FbTk::Command>::instance().parse("reconfigure")); | 129 | FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse("reconfigure")); |
130 | dialog->setPostCommand(cmd); | 130 | dialog->setPostCommand(cmd); |
131 | dialog->setText(screen->resourceManager().resourceValue(resourcename)); | 131 | dialog->setText(screen->resourceManager().resourceValue(resourcename)); |
132 | dialog->show(); | 132 | dialog->show(); |
@@ -160,7 +160,7 @@ ClockTool::ClockTool(const FbTk::FbWindow &parent, | |||
160 | // if nothing has changed, it wont update the graphics | 160 | // if nothing has changed, it wont update the graphics |
161 | m_timer.setInterval(1); | 161 | m_timer.setInterval(1); |
162 | // m_timer.setTimeout(delay); // don't need to set timeout on interval timer | 162 | // m_timer.setTimeout(delay); // don't need to set timeout on interval timer |
163 | FbTk::RefCount<FbTk::Command> update_graphic(new FbTk::SimpleCommand<ClockTool>(*this, | 163 | FbTk::RefCount<FbTk::Command<void> > update_graphic(new FbTk::SimpleCommand<ClockTool>(*this, |
164 | &ClockTool::updateTime)); | 164 | &ClockTool::updateTime)); |
165 | m_timer.setCommand(update_graphic); | 165 | m_timer.setCommand(update_graphic); |
166 | m_timer.start(); | 166 | m_timer.start(); |
@@ -168,11 +168,11 @@ ClockTool::ClockTool(const FbTk::FbWindow &parent, | |||
168 | m_button.setGC(m_theme->textGC()); | 168 | m_button.setGC(m_theme->textGC()); |
169 | 169 | ||
170 | // setup menu | 170 | // setup menu |
171 | FbTk::RefCount<FbTk::Command> saverc(FbTk::ObjectRegistry<FbTk::Command>::instance().parse("saverc")); | 171 | FbTk::RefCount<FbTk::Command<void> > saverc(FbTk::CommandParser<void>::instance().parse("saverc")); |
172 | FbTk::MenuItem *item = new ClockMenuItem(*this); | 172 | FbTk::MenuItem *item = new ClockMenuItem(*this); |
173 | item->setCommand(saverc); | 173 | item->setCommand(saverc); |
174 | menu.insert(item); | 174 | menu.insert(item); |
175 | FbTk::RefCount<FbTk::Command> editformat_cmd(new EditClockFormatCmd()); | 175 | FbTk::RefCount<FbTk::Command<void> > editformat_cmd(new EditClockFormatCmd()); |
176 | menu.insert(_FB_XTEXT(Toolbar, ClockEditFormat, "Edit Clock Format", "edit Clock Format") , editformat_cmd); | 176 | menu.insert(_FB_XTEXT(Toolbar, ClockEditFormat, "Edit Clock Format", "edit Clock Format") , editformat_cmd); |
177 | 177 | ||
178 | 178 | ||