On Wed, 2005-05-04 at 02:28 -0400, Isaac Richards wrote:

> > How about if I change the patch so the LCD also only gets updated if
> > "curprogress % steps == 0", but then keep the tsteps so the LCD updates
> > correctly ?
> Sure.

Here you go;

1) whenever the progress dialog does a processEvents, also update LCD.
2) removed a printf I had accidentally left in UIManagedTreeType

eskil
---
Index: libs/libmyth/mythdialogs.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/mythdialogs.cpp,v
retrieving revision 1.111
diff -u -r1.111 mythdialogs.cpp
--- libs/libmyth/mythdialogs.cpp	3 May 2005 17:42:45 -0000	1.111
+++ libs/libmyth/mythdialogs.cpp	5 May 2005 05:33:01 -0000
@@ -1425,7 +1425,8 @@
     progress = new QProgressBar(totalSteps, vbox);
     progress->setBackgroundOrigin(ParentOrigin);
     progress->setProgress(0);
-
+    
+    totalsteps = totalSteps;
     steps = totalSteps / 1000;
     if (steps == 0)
         steps = 1;
@@ -1463,12 +1464,14 @@
 
 void MythProgressDialog::setProgress(int curprogress)
 {
-    float fProgress = (float)curprogress / (steps * 1000.0);
-    if (class LCD * lcddev = LCD::Get())
-        lcddev->setGenericProgress(fProgress);
     progress->setProgress(curprogress);
-    if (curprogress % steps == 0)
+    if (curprogress % steps == 0) {
         qApp->processEvents();
+        if (class LCD * lcddev = LCD::Get()) {
+            float fProgress = (float)curprogress / totalsteps;
+            lcddev->setGenericProgress(fProgress);
+        }
+    }
 }
 
 void MythProgressDialog::keyPressEvent(QKeyEvent *e)
Index: libs/libmyth/mythdialogs.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/mythdialogs.h,v
retrieving revision 1.47
diff -u -r1.47 mythdialogs.h
--- libs/libmyth/mythdialogs.h	29 Dec 2004 21:00:45 -0000	1.47
+++ libs/libmyth/mythdialogs.h	5 May 2005 05:33:01 -0000
@@ -232,6 +232,7 @@
 
   private:
     QProgressBar *progress;
+    int totalsteps;
     int steps;
 
     QPtrList<class LCDTextItem> * textItems;
Index: libs/libmyth/uitypes.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/uitypes.cpp,v
retrieving revision 1.99
diff -u -r1.99 uitypes.cpp
--- libs/libmyth/uitypes.cpp	3 May 2005 07:10:16 -0000	1.99
+++ libs/libmyth/uitypes.cpp	5 May 2005 05:33:02 -0000
@@ -2689,7 +2689,6 @@
             title += (current_node->childCount () > 0) ? " >> " : "  ";
             if (!menuItems.isEmpty())
             {
-                printf ("managedtree::draw\n");
                 lcddev->switchToMenu(&menuItems, title);
             }
         }
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to