aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-28 09:19:33 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-28 09:19:33 (GMT)
commit8e96ffb74b98b08ac35dcd1c861421c65a55cbe6 (patch)
tree6c2da67d383d126892708ced362b569af9178db4 /src/Screen.cc
parent0f6b73f36abb1fd31893ef16413f010e78ed84ab (diff)
downloadfluxbox-8e96ffb74b98b08ac35dcd1c861421c65a55cbe6.zip
fluxbox-8e96ffb74b98b08ac35dcd1c861421c65a55cbe6.tar.bz2
moved DelayedCmd from Screen.cc to FbTk/Timer.cc, added it to the keys file
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index a09f4d1..2d214eb 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -196,28 +196,6 @@ private:
196 FbWinFrame::TabPlacement m_place; 196 FbWinFrame::TabPlacement m_place;
197}; 197};
198 198
199// this might be useful elsewhere, but I'll leave it here for now
200class DelayedCmd: public FbTk::Command {
201public:
202 DelayedCmd(FbTk::RefCount<FbTk::Command> &cmd) {
203 timeval to;
204 to.tv_sec = 0;
205 to.tv_usec = 500000; // 1/2 second
206 m_timer.setTimeout(to);
207 m_timer.setCommand(cmd);
208 m_timer.fireOnce(true);
209 }
210 void execute() {
211 // if it's already started, restart it; otherwise, just start it
212 // we want this to execute 1/2 second after the last click
213 if (m_timer.isTiming())
214 m_timer.stop();
215 m_timer.start();
216 }
217private:
218 FbTk::Timer m_timer;
219};
220
221} // end anonymous namespace 199} // end anonymous namespace
222 200
223 201
@@ -1724,7 +1702,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1724 // in order to save system resources, don't save or reconfigure alpha 1702 // in order to save system resources, don't save or reconfigure alpha
1725 // settings until after the user is done changing them 1703 // settings until after the user is done changing them
1726 FbTk::RefCount<FbTk::Command> delayed_save_and_reconf( 1704 FbTk::RefCount<FbTk::Command> delayed_save_and_reconf(
1727 new ::DelayedCmd(save_and_reconfigure)); 1705 new FbTk::DelayedCmd(save_and_reconfigure));
1728 1706
1729 FbTk::MenuItem *focused_alpha_item = 1707 FbTk::MenuItem *focused_alpha_item =
1730 new FbTk::IntMenuItem(_FB_XTEXT(Configmenu, FocusedAlpha, 1708 new FbTk::IntMenuItem(_FB_XTEXT(Configmenu, FocusedAlpha,