diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:58:10 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:58:10 +0200 |
commit | fefe20351d0720683990b666584b6879c90bd37d (patch) | |
tree | 8ab90520ae2123ac84293b0f9cec006317e5fc01 /ui/gridView.h | |
parent | 1.18 (diff) | |
download | FreeFileSync-fefe20351d0720683990b666584b6879c90bd37d.tar.gz FreeFileSync-fefe20351d0720683990b666584b6879c90bd37d.tar.bz2 FreeFileSync-fefe20351d0720683990b666584b6879c90bd37d.zip |
1.19
Diffstat (limited to 'ui/gridView.h')
-rw-r--r-- | ui/gridView.h | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/ui/gridView.h b/ui/gridView.h index b4101da7..2a4d4e29 100644 --- a/ui/gridView.h +++ b/ui/gridView.h @@ -10,15 +10,16 @@ namespace FreeFileSync class GridView { public: - GridView(FolderComparison& results) : folderCmp(results) {} + GridView(FolderComparison& results); const FileCompareLine& operator[] (unsigned row) const; + FileCompareLine& operator[] (unsigned row); //unsigned getResultsIndex(const unsigned viewIndex); //convert index on GridView to index on FolderComparison - unsigned int elementsOnView() const; + unsigned int elementsOnView() const; //only the currently visible elements - unsigned int elementsTotal() const; + bool refGridIsEmpty() const; //convert view references to FolderCompRef void viewRefToFolderRef(const std::set<int>& viewRef, FolderCompRef& output); @@ -27,29 +28,47 @@ namespace FreeFileSync struct StatusInfo { + StatusInfo(); + bool existsLeftOnly; bool existsRightOnly; bool existsLeftNewer; bool existsRightNewer; bool existsDifferent; bool existsEqual; + bool existsConflict; + + bool existsSyncDirLeft; + bool existsSyncDirRight; + bool existsSyncDirNone; unsigned int filesOnLeftView; unsigned int foldersOnLeftView; unsigned int filesOnRightView; unsigned int foldersOnRightView; + unsigned int objectsTotal; + wxULongLong filesizeLeftView; wxULongLong filesizeRightView; }; - StatusInfo update(const bool includeLeftOnly, - const bool includeRightOnly, - const bool includeLeftNewer, - const bool includeRightNewer, - const bool includeDifferent, - const bool includeEqual, - const bool hideFiltered); + StatusInfo update(const bool hideFiltered, const bool syncPreviewActive); + + //UI View Filter settings + //compare result + bool leftOnlyFilesActive; + bool rightOnlyFilesActive; + bool leftNewerFilesActive; + bool rightNewerFilesActive; + bool differentFilesActive; + bool equalFilesActive; + bool conflictFilesActive; + //sync preview + bool syncDirLeftActive; + bool syncDirRightActive; + bool syncDirNoneActive; + //sorting... enum SortType @@ -65,6 +84,9 @@ namespace FreeFileSync void sortView(const SortType type, const bool onLeft, const bool ascending); private: + template <bool syncPreviewActive> + StatusInfo update_sub(const bool hideFiltered); + struct RefIndex { unsigned int folderIndex; @@ -87,6 +109,13 @@ namespace FreeFileSync return folderCmp[folderInd].fileCmp[rowInd]; } + inline + FileCompareLine& GridView::operator[] (unsigned row) + { + //code re-use of const method: see Meyers Effective C++ + return const_cast<FileCompareLine&>(static_cast<const GridView&>(*this).operator[](row)); + } + inline unsigned int GridView::elementsOnView() const |