diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index bd5b81686..f837e595d 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -45,6 +45,7 @@ int _directoryUpdater (void* cat) { #endif FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb) : selectedDirectoryId(1), listener(NULL), fslistener(NULL), hasValidCurrentEFS(false), filterPanel(NULL), coarsePanel(cp), toolBar(tb) { + inTabMode=false; // construct and initialize thumbnail browsers fileBrowser = new FileBrowser(); @@ -219,8 +220,8 @@ void FileCatalog::closeDir () { } #endif - // ignore old requests - ++selectedDirectoryId; + // ignore old requests + ++selectedDirectoryId; // terminate thumbnail preview loading previewLoader->removeAllJobs (); @@ -285,22 +286,29 @@ void FileCatalog::dirSelected (const Glib::ustring& dirname, const Glib::ustring } } -void FileCatalog::_refreshProgressBar () { +void FileCatalog::enableTabMode(bool enable) { + inTabMode = enable; - // check if progress bar is visible -/* Glib::ListHandle list = buttonBar2->get_children (); - Glib::ListHandle::iterator i = list.begin (); - for (; i!=list.end() && *i!=progressBar; i++); - if (i==list.end()) { - buttonBar2->pack_start (*progressBar, Gtk::PACK_SHRINK, 4); - buttonBar2->reorder_child (*progressBar, 2); + if (!inTabMode) progressBar->hide (); // just needed once + + fileBrowser->enableTabMode(inTabMode); + + redrawAll(); +} + +void FileCatalog::_refreshProgressBar () { + // In tab mode, no progress bar at all + // Also mention that this progress bar only measures the FIRST pass (quick thumbnails) + // The second, usually longer pass is done multithreaded down in the single entries and is NOT measured by this + if (!inTabMode) { + if (previewsToLoad>0) { + progressBar->set_fraction ((double)previewsLoaded / previewsToLoad); + progressBar->show (); + } else { + progressBar->set_fraction (1.0); + progressBar->hide (); + } } -*/ - progressBar->show (); - if (previewsToLoad>0) - progressBar->set_fraction ((double)previewsLoaded / previewsToLoad); - else - progressBar->set_fraction (1.0); } int refreshpb (void* data) { @@ -365,8 +373,8 @@ void FileCatalog::_previewsFinished () { redrawAll (); previewsToLoad = 0; previewsLoaded = 0; -// removeIfThere (buttonBar2, progressBar); progressBar->hide (); + if (filterPanel) { filterPanel->set_sensitive (true); if ( !hasValidCurrentEFS ){ diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 9e5e1962f..b9cdb9fc6 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -62,10 +62,8 @@ class FileCatalog : public Gtk::VBox, Glib::ustring selectedDirectory; int selectedDirectoryId; bool enabled; - - // Restore PreviewLoader if the new threadsafe is not that threadsafe ;-) - //PreviewLoader previewLoader; - //PreviewMultiLoader previewLoader; + bool inTabMode; // Tab mode has e.g. different progress bar handling + FileSelectionListener* listener; FileSelectionChangeListener* fslistener; ImageAreaToolListener* iatlistener; @@ -145,6 +143,7 @@ class FileCatalog : public Gtk::VBox, Glib::ustring lastSelectedDir () { return selectedDirectory; } void setEnabled (bool e); // if not enabled, it does not open image + void enableTabMode(bool enable); // sets progress bar void redrawAll (); void refreshAll (); diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 550015431..03fa4bfb3 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -343,8 +343,7 @@ void RTWindow::MoveFileBrowserToMain() FileCatalog *fCatalog = fpanel->fileCatalog; epanel->catalogPane->remove(*fCatalog); fpanel->ribbonPane->add(*fCatalog); - fCatalog->fileBrowser->enableTabMode(false); - fCatalog->redrawAll(); + fCatalog->enableTabMode(false); } } @@ -355,8 +354,7 @@ void RTWindow::MoveFileBrowserToEditor() FileCatalog *fCatalog = fpanel->fileCatalog; fpanel->ribbonPane->remove(*fCatalog); epanel->catalogPane->add(*fCatalog); - fCatalog->fileBrowser->enableTabMode(true); - fCatalog->redrawAll(); + fCatalog->enableTabMode(true); fCatalog->refreshHeight(); } }