OLD | NEW |
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include "PluginClass.h" | 3 #include "PluginClass.h" |
4 #include "PluginSettings.h" | 4 #include "PluginSettings.h" |
5 #include "PluginSystem.h" | 5 #include "PluginSystem.h" |
6 #ifdef SUPPORT_FILTER | 6 #ifdef SUPPORT_FILTER |
7 #include "PluginFilter.h" | 7 #include "PluginFilter.h" |
8 #endif | 8 #endif |
9 #include "PluginMimeFilterClient.h" | 9 #include "PluginMimeFilterClient.h" |
10 #include "PluginClient.h" | 10 #include "PluginClient.h" |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 // Display menu | 1253 // Display menu |
1254 nMenuFlags |= TPM_NONOTIFY | TPM_RETURNCMD | TPM_LEFTBUTTON; | 1254 nMenuFlags |= TPM_NONOTIFY | TPM_RETURNCMD | TPM_LEFTBUTTON; |
1255 | 1255 |
1256 int nCommand = ::TrackPopupMenu(hMenu, nMenuFlags, pt.x, pt.y, 0, hMenuWnd, 0)
; | 1256 int nCommand = ::TrackPopupMenu(hMenu, nMenuFlags, pt.x, pt.y, 0, hMenuWnd, 0)
; |
1257 | 1257 |
1258 ::DestroyMenu(hMenu); | 1258 ::DestroyMenu(hMenu); |
1259 ::DestroyWindow(hMenuWnd); | 1259 ::DestroyWindow(hMenuWnd); |
1260 | 1260 |
1261 switch (nCommand) | 1261 switch (nCommand) |
1262 { | 1262 { |
| 1263 case ID_PLUGIN_UPDATE: |
| 1264 { |
| 1265 CPluginClient* client = CPluginClient::GetInstance(); |
| 1266 client->CheckForUpdates(); |
| 1267 } |
| 1268 break; |
1263 case ID_PLUGIN_ENABLE: | 1269 case ID_PLUGIN_ENABLE: |
1264 { | 1270 { |
1265 CPluginSettings* settings = CPluginSettings::GetInstance(); | 1271 CPluginSettings* settings = CPluginSettings::GetInstance(); |
1266 | 1272 |
1267 settings->TogglePluginEnabled(); | 1273 settings->TogglePluginEnabled(); |
1268 | 1274 |
1269 // Enable / disable mime filter | 1275 // Enable / disable mime filter |
1270 s_criticalSectionLocal.Lock(); | 1276 s_criticalSectionLocal.Lock(); |
1271 { | 1277 { |
1272 if (settings->GetPluginEnabled()) | 1278 if (settings->GetPluginEnabled()) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 fmii.cch = ctext.size(); | 1387 fmii.cch = ctext.size(); |
1382 | 1388 |
1383 ::SetMenuItemInfoW(hMenu, ID_WHITELISTDOMAIN, FALSE, &fmii); | 1389 ::SetMenuItemInfoW(hMenu, ID_WHITELISTDOMAIN, FALSE, &fmii); |
1384 } | 1390 } |
1385 #else | 1391 #else |
1386 { | 1392 { |
1387 ::DeleteMenu(hMenu, ID_WHITELISTDOMAIN, FALSE); | 1393 ::DeleteMenu(hMenu, ID_WHITELISTDOMAIN, FALSE); |
1388 } | 1394 } |
1389 #endif // SUPPORT_WHITELIST | 1395 #endif // SUPPORT_WHITELIST |
1390 | 1396 |
| 1397 // Plugin update |
| 1398 ctext = dictionary->Lookup("menu", "update"); |
| 1399 fmii.fMask = MIIM_STATE | MIIM_STRING; |
| 1400 fmii.fState = client ? MFS_ENABLED : MFS_DISABLED; |
| 1401 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str()); |
| 1402 fmii.cch = ctext.size(); |
| 1403 ::SetMenuItemInfoW(hMenu, ID_PLUGIN_UPDATE, FALSE, &fmii); |
| 1404 |
| 1405 |
1391 // Plugin enable | 1406 // Plugin enable |
1392 if (settings->GetPluginEnabled()) | 1407 if (settings->GetPluginEnabled()) |
1393 { | 1408 { |
1394 ctext = dictionary->Lookup("menu", "disable"); | 1409 ctext = dictionary->Lookup("menu", "disable"); |
1395 } | 1410 } |
1396 else | 1411 else |
1397 { | 1412 { |
1398 ctext = dictionary->Lookup("menu", "enable"); | 1413 ctext = dictionary->Lookup("menu", "enable"); |
1399 } | 1414 } |
1400 fmii.fMask = MIIM_STATE | MIIM_STRING; | 1415 fmii.fMask = MIIM_STATE | MIIM_STRING; |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1896 } | 1911 } |
1897 } | 1912 } |
1898 } | 1913 } |
1899 | 1914 |
1900 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); | 1915 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); |
1901 } | 1916 } |
1902 | 1917 |
1903 return hTabWnd; | 1918 return hTabWnd; |
1904 | 1919 |
1905 } | 1920 } |
OLD | NEW |