diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-01-22 03:29:40 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-04 03:33:22 -0500 |
| commit | 412165fcfbbd27d679a7400ebdef75ff3a9d6aa7 (patch) | |
| tree | 2237075dd6d2023b9a180c2295133d759d36de64 /src/envshell.cpp | |
| parent | 2a0e78e3cf0c1106a1fb7e470148f6e0b093b2b1 (diff) | |
show file counts when there are discrepancies
Diffstat (limited to 'src/envshell.cpp')
| -rw-r--r-- | src/envshell.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/envshell.cpp b/src/envshell.cpp index e01bb804..33ec0624 100644 --- a/src/envshell.cpp +++ b/src/envshell.cpp @@ -185,6 +185,11 @@ void ShellMenu::addFile(QFileInfo fi) m_files.emplace_back(std::move(fi)); } +int ShellMenu::fileCount() const +{ + return static_cast<int>(m_files.size()); +} + void ShellMenu::exec(const QPoint& pos) { HMENU menu = getMenu(); @@ -529,6 +534,11 @@ ShellMenuCollection::ShellMenuCollection(QMainWindow* mw) { } +void ShellMenuCollection::addDetails(QString s) +{ + m_details.emplace_back(std::move(s)); +} + void ShellMenuCollection::add(QString name, ShellMenu m) { m_menus.push_back({name, std::move(m)}); @@ -547,6 +557,28 @@ void ShellMenuCollection::exec(const QPoint& pos) return; } + if (!m_details.empty()) { + for (auto&& d : m_details) { + const auto s = d.toStdWString(); + const auto r = AppendMenuW(menu, MF_STRING|MF_DISABLED, 0, s.c_str()); + + if (!r) { + const auto e = GetLastError(); + log::error( + "AppendMenuW failed for details '{}', {}", + d, formatSystemMessage(e)); + } + } + + const auto r = AppendMenuW(menu, MF_SEPARATOR, 0, nullptr); + if (!r) { + const auto e = GetLastError(); + log::error( + "AppendMenuW failed for separator, {}", + formatSystemMessage(e)); + } + } + for (auto&& m : m_menus) { auto hmenu = m.menu.getMenu(); if (!hmenu) { |
