Ticket #79: lcd3.patch

File lcd3.patch, 1.7 KB (added by myth@…, 15 years ago)

patch for LCD progress bars

  • 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
     
    14251425    progress = new QProgressBar(totalSteps, vbox);
    14261426    progress->setBackgroundOrigin(ParentOrigin);
    14271427    progress->setProgress(0);
    1428 
     1428   
     1429    totalsteps = totalSteps;
    14291430    steps = totalSteps / 1000;
    14301431    if (steps == 0)
    14311432        steps = 1;
     
    14631464
    14641465void MythProgressDialog::setProgress(int curprogress)
    14651466{
    1466     float fProgress = (float)curprogress / (steps * 1000.0);
    1467     if (class LCD * lcddev = LCD::Get())
    1468         lcddev->setGenericProgress(fProgress);
    14691467    progress->setProgress(curprogress);
    1470     if (curprogress % steps == 0)
     1468    if (curprogress % steps == 0) {
    14711469        qApp->processEvents();
     1470        if (class LCD * lcddev = LCD::Get()) {
     1471            float fProgress = (float)curprogress / totalsteps;
     1472            lcddev->setGenericProgress(fProgress);
     1473        }
     1474    }
    14721475}
    14731476
    14741477void MythProgressDialog::keyPressEvent(QKeyEvent *e)
  • 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
     
    232232
    233233  private:
    234234    QProgressBar *progress;
     235    int totalsteps;
    235236    int steps;
    236237
    237238    QPtrList<class LCDTextItem> * textItems;