diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2021-03-21 14:06:39 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2021-03-21 14:06:39 +0000 |
| commit | 0871f8bb3d5ff1f19ebab5b660ccfe13ec959f43 (patch) | |
| tree | aa4961f12b2330331c0d4a43abbf08fe83e47c60 /src/plugins/General/library/librarywidget.cpp | |
| parent | ba6d5b13e4cd306a1c4517780fba496d669dd596 (diff) | |
| download | qmmp-0871f8bb3d5ff1f19ebab5b660ccfe13ec959f43.tar.gz qmmp-0871f8bb3d5ff1f19ebab5b660ccfe13ec959f43.tar.bz2 qmmp-0871f8bb3d5ff1f19ebab5b660ccfe13ec959f43.zip | |
library: added busy indicator
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9768 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/library/librarywidget.cpp')
| -rw-r--r-- | src/plugins/General/library/librarywidget.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
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 <QMenu> #include <QContextMenuEvent> #include <QIcon> +#include <QLabel> #include <qmmp/qmmp.h> #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()) |
