Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginClass.cpp

Issue 11276031: FRP wrappers. "Update" menu item. (Closed)
Patch Set: GetAppLocale is now retrieved directly from the browser. Get documentation link change. Manual Upda… Created Aug. 5, 2013, 8:03 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 // Display menu 1250 // Display menu
1251 nMenuFlags |= TPM_NONOTIFY | TPM_RETURNCMD | TPM_LEFTBUTTON; 1251 nMenuFlags |= TPM_NONOTIFY | TPM_RETURNCMD | TPM_LEFTBUTTON;
1252 1252
1253 int nCommand = ::TrackPopupMenu(hMenu, nMenuFlags, pt.x, pt.y, 0, hMenuWnd, 0) ; 1253 int nCommand = ::TrackPopupMenu(hMenu, nMenuFlags, pt.x, pt.y, 0, hMenuWnd, 0) ;
1254 1254
1255 ::DestroyMenu(hMenu); 1255 ::DestroyMenu(hMenu);
1256 ::DestroyWindow(hMenuWnd); 1256 ::DestroyWindow(hMenuWnd);
1257 1257
1258 switch (nCommand) 1258 switch (nCommand)
1259 { 1259 {
1260 case ID_MENU_UPDATE:
1261 {
1262 CPluginClient* client = CPluginClient::GetInstance();
1263 client->CheckForUpdates();
1264 }
1265 break;
1260 case ID_MENU_DISABLE: 1266 case ID_MENU_DISABLE:
1261 { 1267 {
1262 CPluginSettings* settings = CPluginSettings::GetInstance(); 1268 CPluginSettings* settings = CPluginSettings::GetInstance();
1263 1269
1264 settings->TogglePluginEnabled(); 1270 settings->TogglePluginEnabled();
1265 1271
1266 // Enable / disable mime filter 1272 // Enable / disable mime filter
1267 s_criticalSectionLocal.Lock(); 1273 s_criticalSectionLocal.Lock();
1268 { 1274 {
1269 if (settings->GetPluginEnabled()) 1275 if (settings->GetPluginEnabled())
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 1386
1381 ::SetMenuItemInfoW(hMenu, ID_MENU_DISABLE_ON_SITE, FALSE, &fmii); 1387 ::SetMenuItemInfoW(hMenu, ID_MENU_DISABLE_ON_SITE, FALSE, &fmii);
1382 } 1388 }
1383 #else 1389 #else
1384 { 1390 {
1385 ::DeleteMenu(hMenu, ID_MENU_DISABLE_ON_SITE, FALSE); 1391 ::DeleteMenu(hMenu, ID_MENU_DISABLE_ON_SITE, FALSE);
1386 } 1392 }
1387 #endif // SUPPORT_WHITELIST 1393 #endif // SUPPORT_WHITELIST
1388 1394
1389 // Plugin update 1395 // Plugin update
1390 ctext = dictionary->Lookup("menu", "update"); 1396 ctext = dictionary->Lookup("menu", "menu-update");
Wladimir Palant 2013/08/13 09:19:51 What's the point of prefixing everything in the "m
1391 fmii.fMask = MIIM_STATE | MIIM_STRING; 1397 fmii.fMask = MIIM_STATE | MIIM_STRING;
1392 fmii.fState = client ? MFS_ENABLED : MFS_DISABLED; 1398 fmii.fState = client ? MFS_ENABLED : MFS_DISABLED;
1393 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str()); 1399 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str());
1394 fmii.cch = ctext.size(); 1400 fmii.cch = ctext.size();
1395 ::SetMenuItemInfoW(hMenu, ID_PLUGIN_UPDATE, FALSE, &fmii); 1401 ::SetMenuItemInfoW(hMenu, ID_MENU_UPDATE, FALSE, &fmii);
1396 1402
1397 1403
1398 // Plugin enable 1404 // Plugin enable
1399 ctext = dictionary->Lookup("menu", "menu-disable"); 1405 ctext = dictionary->Lookup("menu", "menu-disable");
1400 if (settings->GetPluginEnabled()) 1406 if (settings->GetPluginEnabled())
1401 { 1407 {
1402 fmii.fState = MFS_UNCHECKED | MFS_ENABLED; 1408 fmii.fState = MFS_UNCHECKED | MFS_ENABLED;
1403 } 1409 }
1404 else 1410 else
1405 { 1411 {
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1903 } 1909 }
1904 } 1910 }
1905 } 1911 }
1906 1912
1907 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1913 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1908 } 1914 }
1909 1915
1910 return hTabWnd; 1916 return hTabWnd;
1911 1917
1912 } 1918 }
OLDNEW

Powered by Google App Engine
This is Rietveld