EDA/ERS: More flexible progress reporting for use with SQL queries
authorJerome St-Louis <jerome@ecere.com>
Thu, 2 Aug 2012 14:36:56 +0000 (10:36 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 2 Aug 2012 14:36:56 +0000 (10:36 -0400)
eda/libeda/locale/EDA.pot
eda/libeda/src/ers.ec

index 57c7df5..cb87bac 100644 (file)
@@ -14,7 +14,7 @@ msgstr ""
 msgid "(Click to add a new %s...)"
 msgstr "(Click to add a new %s...)"
 
-#: ./src/ers.ec:517
+#: ./src/ers.ec:535
 msgid "All files"
 msgstr "All files"
 
@@ -24,7 +24,7 @@ msgstr "All files"
 msgid "Arial"
 msgstr "Arial"
 
-#: ./src/ers.ec:514
+#: ./src/ers.ec:532
 msgid "Comma Separated Values Spreadsheet (*.csv)"
 msgstr "Comma Separated Values Spreadsheet (*.csv)"
 
@@ -48,7 +48,7 @@ msgstr "Entry"
 msgid "Error reading field"
 msgstr "Error reading field"
 
-#: ./src/ers.ec:570
+#: ./src/ers.ec:588
 msgid "Export as Spreadsheet (CSV)"
 msgstr "Export as Spreadsheet (CSV)"
 
index 4d42772..abab700 100644 (file)
@@ -117,6 +117,19 @@ public void ERSProgressAdvanceLevelCheck()
    }
 }
 
+public void ERSProgressAdvance()
+{
+   if(!ersNumRows) ersNumRows++;
+   ersNumRows++;
+   ersNumRows = Min(ersNumRows, pleaseWait.progress.range);
+   pleaseWait.progress.progress = ersNumRows;
+   if(ersNumRows == pleaseWait.progress.range || !(ersNumRows%100))
+   {
+      ((GuiApplication)__thisModule.application).ProcessInput(true);
+      pleaseWait.UpdateDisplay();
+   }
+}
+
 public class ReportRenderNormal : ReportRender
 {
 public:
@@ -136,7 +149,8 @@ public:
       {
          pleaseWait.master = destination.master;
          pleaseWait.Create();
-         pleaseWait.progress.range = report.groupings[0].row.tbl.rowsCount;
+
+         pleaseWait.progress.range = report.groupings[0].rowsCount ? report.groupings[0].rowsCount : report.groupings[0].row.rowsCount;
          pleaseWait.progress.progress = 0;
          ((GuiApplication)__thisModule.application).ProcessInput(true);
          pleaseWait.UpdateDisplay();
@@ -655,6 +669,7 @@ public:
 
    bool activeOnly;
    Field activeField;
+   uint rowsCount;
 
    subclass(Detail) header;
    subclass(Detail) continuation;