MCPcopy Create free account
hub / github.com/TortoiseGit/TortoiseGit / GetMenuTextFromResource

Method GetMenuTextFromResource

src/TortoiseShell/ContextMenu.cpp:1851–1887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1849}
1850
1851LPCWSTR 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
1889bool CShellExt::IsIllegalFolder(const std::wstring& folder)
1890{

Callers

nothing calls this directly

Calls 3

GetTGitMenuInfoFunction · 0.85
to_underlyingFunction · 0.85
GetMenuLayoutMethod · 0.80

Tested by

no test coverage detected