From 0871f8bb3d5ff1f19ebab5b660ccfe13ec959f43 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 21 Mar 2021 14:06:39 +0000 Subject: library: added busy indicator git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9768 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/library/librarywidget.cpp | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/plugins/General/library/librarywidget.cpp') diff --git a/src/plugins/General/library/librarywidget.cpp b/src/plugins/General/library/librarywidget.cpp index d31ac585a..790ed410d 100644 --- a/src/plugins/General/library/librarywidget.cpp +++ b/src/plugins/General/library/librarywidget.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "librarymodel.h" #include "ui_librarywidget.h" @@ -74,6 +75,33 @@ void LibraryWidget::refresh() m_model->refresh(); } +void LibraryWidget::setBusyMode(bool enabled) +{ + if(m_busyIndicator) + { + delete m_busyIndicator; + m_busyIndicator = nullptr; + } + + if(enabled) + { + m_busyIndicator = new QLabel(tr("Scanning of directories..."), this); + m_busyIndicator->setFrameShape(QFrame::Box); + m_busyIndicator->resize(m_busyIndicator->sizeHint()); + m_busyIndicator->move(width() / 2 - m_busyIndicator->width() / 2 , height() / 2 - m_busyIndicator->height() / 2); + m_busyIndicator->setAutoFillBackground(true); + m_busyIndicator->show(); + + m_ui->treeView->setEnabled(false); + m_ui->filterLineEdit->setEnabled(false); + } + else + { + m_ui->treeView->setEnabled(true); + m_ui->filterLineEdit->setEnabled(true); + } +} + void LibraryWidget::closeEvent(QCloseEvent *) { if(isWindow()) -- cgit v1.2.3-13-gbd6f