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

Side by Side Diff: src/engine/main.cpp

Issue 11276031: FRP wrappers. "Update" menu item. (Closed)
Patch Set: Comments addressed Created Aug. 8, 2013, 2:18 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <AdblockPlus.h> 1 #include <AdblockPlus.h>
2 #include <functional> 2 #include <functional>
3 #include <vector> 3 #include <vector>
4 #include <Windows.h> 4 #include <Windows.h>
5 5
6 #include "../shared/AutoHandle.h" 6 #include "../shared/AutoHandle.h"
7 #include "../shared/Communication.h" 7 #include "../shared/Communication.h"
8 #include "../shared/Dictionary.h" 8 #include "../shared/Dictionary.h"
9 #include "../shared/Utils.h" 9 #include "../shared/Utils.h"
10 #include "../shared/Version.h" 10 #include "../shared/Version.h"
(...skipping 22 matching lines...) Expand all
33 for (int32_t i = 0; i < count; i++) 33 for (int32_t i = 0; i < count; i++)
34 { 34 {
35 AdblockPlus::SubscriptionPtr subscription = subscriptions[i]; 35 AdblockPlus::SubscriptionPtr subscription = subscriptions[i];
36 response << subscription->GetProperty("url")->AsString() 36 response << subscription->GetProperty("url")->AsString()
37 << subscription->GetProperty("title")->AsString() 37 << subscription->GetProperty("title")->AsString()
38 << subscription->GetProperty("specialization")->AsString() 38 << subscription->GetProperty("specialization")->AsString()
39 << subscription->IsListed(); 39 << subscription->IsListed();
40 } 40 }
41 } 41 }
42 42
43 bool updateAvailable; 43 bool updateAvailable = false;
44 void UpdateCallback(const std::string res) 44 void UpdateCallback(const std::string res)
45 { 45 {
46 if (updateAvailable) 46 if (updateAvailable)
47 return; 47 return;
48 Dictionary* dictionary = Dictionary::GetInstance(); 48 Dictionary* dictionary = Dictionary::GetInstance();
49 if (res.length() == 0) 49 if (res.length() == 0)
50 { 50 {
51 std::wstring upToDateText = dictionary->Lookup("updater", "update-already- up-to-date-text"); 51 std::wstring upToDateText = dictionary->Lookup("updater", "update-already- up-to-date-text");
52 std::wstring upToDateTitle = dictionary->Lookup("updater", "update-already -up-to-date-title"); 52 std::wstring upToDateTitle = dictionary->Lookup("updater", "update-already -up-to-date-title");
53 MessageBox(NULL, upToDateText.c_str(), upToDateTitle.c_str(), MB_OK); 53 MessageBox(NULL, upToDateText.c_str(), upToDateTitle.c_str(), MB_ICONINFOR MATION);
Wladimir Palant 2013/08/13 09:19:51 Not sure why but this change isn't present in the
54 } 54 }
55 else 55 else
56 { 56 {
57 std::wstring errorText = dictionary->Lookup("updater", "update-error-text" ); 57 std::wstring errorText = dictionary->Lookup("updater", "update-error-text" );
58 std::wstring errorTitle = dictionary->Lookup("updater", "update-error-titl e"); 58 std::wstring errorTitle = dictionary->Lookup("updater", "update-error-titl e");
59 ReplaceString(errorText, L"?1?", ToUtf16String(res)); 59 ReplaceString(errorText, L"?1?", ToUtf16String(res));
60 MessageBox(NULL, errorText.c_str(), errorTitle.c_str(), MB_OK); 60 MessageBox(NULL, errorText.c_str(), errorTitle.c_str(), MB_ICONEXCLAMATION );
Wladimir Palant 2013/08/13 09:19:51 Not sure why but this change isn't present in the
61 } 61 }
62 return;
Wladimir Palant 2013/08/13 09:19:51 This change isn't present in the current code.
63 } 62 }
64 63
65 64
66 CriticalSection firstRunLock; 65 CriticalSection firstRunLock;
67 bool firstRunActionExecuted = false; 66 bool firstRunActionExecuted = false;
68 Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request) 67 Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request)
69 { 68 {
70 Communication::OutputBuffer response; 69 Communication::OutputBuffer response;
71 70
72 Communication::ProcType procedure; 71 Communication::ProcType procedure;
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 } 376 }
378 catch (std::runtime_error e) 377 catch (std::runtime_error e)
379 { 378 {
380 DebugException(e); 379 DebugException(e);
381 return 1; 380 return 1;
382 } 381 }
383 } 382 }
384 383
385 return 0; 384 return 0;
386 } 385 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld