From a907afdc7c19f8b5c80254ac7b2489cf9f8f2c97 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 10 Feb 2017 19:12:10 +0100 Subject: [PATCH] CMovieBrowser: visualize progress during load movies TODO: youtube load --- src/gui/moviebrowser/mb.cpp | 6 ++++-- src/gui/moviebrowser/mb.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 9e08c01c5..fb80bebd7 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2874,7 +2874,7 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) CFileList flist; if (readDir(dirname, &flist) == true) { - for (unsigned int i = 0; i < flist.size(); i++) + for (size_t i = 0; i < flist.size(); i++) { if (S_ISDIR(flist[i].Mode)) { if (m_settings.ts_only || !CFileBrowser::checkBD(flist[i])) { @@ -2885,6 +2885,7 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) } else { result |= addFile(flist[i], dirItNr); } + OnLoadFile(i, flist.size(), g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); } //result = true; } @@ -3123,7 +3124,8 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CHintBox loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_HEAD, g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_HEAD, 500, 150, &OnLoadFile); + loadBox.enableShadow(); loadBox.paint(); if (show_mode == MB_SHOW_YT) { diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 9dee3dbee..3f29afdea 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -362,6 +362,7 @@ class CMovieBrowser : public CMenuTarget void clearSelection(); bool supportedExtension(CFile &file); bool addFile(CFile &file, int dirItNr); + sigc::signal OnLoadFile; }; // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage.