From kde-core-devel Mon Dec 27 18:29:29 1999 From: Rik Hemsley Date: Mon, 27 Dec 1999 18:29:29 +0000 To: kde-core-devel Subject: KProgress::setFormat() X-MARC-Message: https://marc.info/?l=kde-core-devel&m=94632478606333 On IRC the other day, Mr. Desert Angel (or Dessert Angle ?) sent me a patch for KProgress that allows changing the way the text is displayed. Previously, KProgress would only show "n%", where n == current percentage complete. This allows the user to do KProgress::setFormat("%1 %2 %3"), where: %1 is replaced by the current percentage complete. %2 is replaced by the current value. %3 is replaced by the maximum value. This means you can have something like: "Copied %2 of %3 files (%1% complete)" -> "Copied 16 of 32 files (50% complete)" Of course, you're not likely to want a string as long as that, but at least you now have the capability. For example, within Empath I can now do: progressMeter->setFormat("%2 of %3"); This will be very useful when downloading messages from a pop3 server. Is it ok to commit this ? Notes: * Two methods are added: void setFormat(const QString &) QString format() const * The default format is "%1%" Cheers, Rik