| |
215 |
215 |
{ |
| |
216 |
216 |
try |
| |
217 |
217 |
{ |
| |
218 |
218 |
unsigned long long ullSize = 0, ullTotal = 0; |
| |
219 |
219 |
|
| |
220 |
220 |
m_fsLocal.GetDynamicFreeSpace(spMenuItem->GetDestinationPathInfo().GetDefaultDestinationPath(), ullSize, ullTotal); |
| |
221 |
221 |
|
| |
222 |
222 |
wstrItemName += std::wstring(L" ("); |
| |
223 |
223 |
wstrItemName += spFormatter->GetSizeString(ullSize).c_str(); |
| |
224 |
224 |
wstrItemName += L")"; |
| |
225 |
225 |
spMenuItem->SetLocalName(wstrItemName.c_str()); |
| |
226 |
226 |
} |
| |
227 |
227 |
catch(const std::exception&) |
| |
228 |
228 |
{ |
| |
229 |
229 |
} |
| |
230 |
230 |
} |
| |
231 |
231 |
else |
| |
232 |
232 |
spMenuItem->SetLocalName(wstrItemName.c_str()); |
| |
233 |
233 |
} |
| |
234 |
234 |
|
| |
235 |
|
return wstrItemName; |
| |
|
235 |
|
| |
|
236 |
return spMenuItem->GetLocalName().c_str(); |
| |
236 |
237 |
} |
| |
237 |
238 |
|
| |
238 |
239 |
void TContextMenuHandler::Clear() |
| |
239 |
240 |
{ |
| |
240 |
241 |
m_mapMenuItems.clear(); |
| |
241 |
242 |
for(HMENU hMenu : m_vHandlesToFree) |
| |
242 |
243 |
{ |
| |
243 |
244 |
DestroyMenu(hMenu); |
| |
244 |
245 |
} |
| |
245 |
246 |
m_vHandlesToFree.clear(); |
| |
246 |
247 |
m_uiFirstMenuID = 0; |
| |
247 |
248 |
m_uiNextMenuID = 0; |
| |
248 |
249 |
m_bEnableOwnerDrawnPaths = false; |
| |
249 |
250 |
} |
| |
250 |
251 |
|
| |
251 |
252 |
TShellMenuItemPtr TContextMenuHandler::GetCommandByMenuItemOffset(UINT uiOffset) |
| |
252 |
253 |
{ |
| |
253 |
254 |
return GetCommandByItemID(m_uiFirstMenuID + uiOffset); |
| |
254 |
255 |
} |
| |
255 |
256 |
|