|
From: Tapio V. <aa...@us...> - 2011-02-23 16:35:22
|
Author: Tapio Vierros <tap...@gm...>
Date: Wed Feb 23 17:51:19 2011 +0200
BusyDialog tweaks.
---
busydialog.hh | 4 ++--
editorapp.cc | 2 +-
notegraphwidget.cc | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/busydialog.hh b/busydialog.hh
index 60ff038..6d2d5c1 100644
--- a/busydialog.hh
+++ b/busydialog.hh
@@ -8,7 +8,7 @@
class BusyDialog: public QDialog {
public:
- BusyDialog(QWidget *parent = NULL, int eventsInterval = 30): QDialog(parent), timer(), interval(eventsInterval), count() {
+ BusyDialog(QWidget *parent = NULL, int eventsInterval = 10): QDialog(parent), timer(), interval(eventsInterval), count() {
QProgressBar *progress = new QProgressBar(this);
progress->setRange(0,0);
setWindowTitle(tr("Working..."));
@@ -18,7 +18,7 @@ public:
timer.start();
}
void operator()() {
- if (count == 0) // Let's not process events all the time
+ if (count == 0 && isVisible()) // Let's not process events all the time
QApplication::processEvents();
count = (count + 1) % interval;
// Only show the dialog after certainamount of time
diff --git a/editorapp.cc b/editorapp.cc
index 3490bcb..f513b4e 100644
--- a/editorapp.cc
+++ b/editorapp.cc
@@ -182,7 +182,7 @@ void EditorApp::statusBarMessage(const QString& message)
void EditorApp::doOpStack()
{
- BusyDialog busy(this);
+ BusyDialog busy(this, 20);
noteGraph->clearNotes();
QString newMusic = "";
// Re-apply all operations in the stack
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index 0c8e03d..96f584c 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -58,7 +58,7 @@ NoteGraphWidget::NoteGraphWidget(QWidget *parent)
void NoteGraphWidget::setLyrics(QString lyrics)
{
- BusyDialog busy(this, 5);
+ BusyDialog busy(this, 2);
QTextStream ts(&lyrics, QIODevice::ReadOnly);
doOperation(Operation("CLEAR"));
|