[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5825] Count down remaining delay on progress dialog
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5825] Count down remaining delay on progress dialog |
Date: |
Sun, 10 Nov 2013 20:58:15 +0000 |
Revision: 5825
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5825
Author: chicares
Date: 2013-11-10 20:58:14 +0000 (Sun, 10 Nov 2013)
Log Message:
-----------
Count down remaining delay on progress dialog
Modified Paths:
--------------
lmi/trunk/progress_meter_wx.cpp
Modified: lmi/trunk/progress_meter_wx.cpp
===================================================================
--- lmi/trunk/progress_meter_wx.cpp 2013-11-10 14:01:31 UTC (rev 5824)
+++ lmi/trunk/progress_meter_wx.cpp 2013-11-10 20:58:14 UTC (rev 5825)
@@ -33,6 +33,7 @@
#include <wx/progdlg.h>
#include <wx/utils.h> // wxMilliSleep()
+#include <ios> // std::fixed,
std::ios_base::precision()
#include <sstream>
namespace
@@ -107,12 +108,25 @@
{
}
+/// Sleep for the number of seconds given in the argument.
+///
+/// Sleep only for a tenth of a second at a time, to ensure that the
+/// application remains responsive--see:
+/// http://lists.nongnu.org/archive/html/lmi/2013-11/msg00006.html
+/// Count down the remaining delay to reassure end users that activity
+/// is taking place.
+
void concrete_progress_meter::do_dawdle(int seconds)
{
- for(int i = 0; i < 10 * seconds; ++i)
+ std::ostringstream oss;
+ oss.precision(1);
+ oss << std::fixed;
+ for(int i = 10 * seconds; 0 < i; --i)
{
wxMilliSleep(100);
- progress_dialog_.Update(count());
+ oss.str("");
+ oss << "Waiting " << 0.1 * i << " seconds for printer";
+ progress_dialog_.Update(count(), oss.str());
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5825] Count down remaining delay on progress dialog,
Greg Chicares <=