| 1849 | } |
| 1850 | |
| 1851 | LPCWSTR CShellExt::GetMenuTextFromResource(TGitShellCommand id) |
| 1852 | { |
| 1853 | wchar_t textbuf[255] = { 0 }; |
| 1854 | LPCWSTR resource = nullptr; |
| 1855 | auto layout = g_ShellCache.GetMenuLayout(); |
| 1856 | space = 6; |
| 1857 | |
| 1858 | for (auto& menuItem : GetTGitMenuInfo()) |
| 1859 | { |
| 1860 | if (menuItem.command != id) |
| 1861 | continue; |
| 1862 | |
| 1863 | MAKESTRING(menuItem.menuTextID); |
| 1864 | resource = MAKEINTRESOURCE(menuItem.iconID); |
| 1865 | switch (id) |
| 1866 | { |
| 1867 | case TGitShellCommand::SubMenuMultiple: |
| 1868 | case TGitShellCommand::SubMenuLink: |
| 1869 | case TGitShellCommand::SubMenuFolder: |
| 1870 | case TGitShellCommand::SubMenuFile: |
| 1871 | case TGitShellCommand::SubMenu: |
| 1872 | space = 0; |
| 1873 | break; |
| 1874 | default: |
| 1875 | space = to_underlying(layout & menuItem.menuID) ? 0 : 6; |
| 1876 | if (to_underlying(layout & menuItem.menuID)) |
| 1877 | { |
| 1878 | wcscpy_s(textbuf, L"Git "); |
| 1879 | wcscat_s(textbuf, stringtablebuffer); |
| 1880 | wcscpy_s(stringtablebuffer, textbuf); |
| 1881 | } |
| 1882 | break; |
| 1883 | } |
| 1884 | return resource; |
| 1885 | } |
| 1886 | return nullptr; |
| 1887 | } |
| 1888 | |
| 1889 | bool CShellExt::IsIllegalFolder(const std::wstring& folder) |
| 1890 | { |
nothing calls this directly
no test coverage detected