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

Delta Between Two Patch Sets: src/plugin/PluginSettings.cpp

Issue 11292028: Status bar menu added (Closed)
Left Patch Set: Created July 29, 2013, 5:25 a.m.
Right Patch Set: Comments addressed Created Aug. 5, 2013, 1:13 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/PluginClass.cpp ('k') | src/plugin/PluginTabBase.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include <Wbemidl.h> 3 #include <Wbemidl.h>
4 #include <time.h> 4 #include <time.h>
5 #include "PluginSettings.h" 5 #include "PluginSettings.h"
6 #include "PluginClient.h" 6 #include "PluginClient.h"
7 #include "PluginSystem.h" 7 #include "PluginSystem.h"
8 #ifdef SUPPORT_FILTER 8 #ifdef SUPPORT_FILTER
9 #include "PluginFilter.h" 9 #include "PluginFilter.h"
10 #endif 10 #endif
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 s_criticalSectionLocal.Lock(); 209 s_criticalSectionLocal.Lock();
210 { 210 {
211 m_isPluginEnabledTab = false; 211 m_isPluginEnabledTab = false;
212 //TODO: Set plugin disabled in AdblockPlusEngine 212 //TODO: Set plugin disabled in AdblockPlusEngine
213 } 213 }
214 s_criticalSectionLocal.Unlock(); 214 s_criticalSectionLocal.Unlock();
215 } 215 }
216 } 216 }
217 void CPluginSettings::SetPluginEnabled() 217 void CPluginSettings::SetPluginEnabled()
218 { 218 {
219 CPluginSettingsTabLock lock; 219 CPluginClient::GetInstance()->SetPref(L"enabled", true);
220 if (lock.IsLocked())
221 {
222 s_criticalSectionLocal.Lock();
223 {
224 m_isPluginEnabledTab = true;
225 //TODO: Set plugin enabled in AdblockPlusEngine
226 }
227 s_criticalSectionLocal.Unlock();
228 }
229 } 220 }
230 bool CPluginSettings::GetPluginEnabled() const 221 bool CPluginSettings::GetPluginEnabled() const
231 { 222 {
232 //TODO: Query AdblockPlusEngine 223 return CPluginClient::GetInstance()->GetPref(L"enabled", true);
233 return m_isPluginEnabledTab;
234 } 224 }
235 225
236 226
237 void CPluginSettings::AddError(const CString& error, const CString& errorCode) 227 void CPluginSettings::AddError(const CString& error, const CString& errorCode)
238 { 228 {
239 DEBUG_SETTINGS(L"SettingsTab::AddError error:" + error + " code:" + errorCode) 229 DEBUG_SETTINGS(L"SettingsTab::AddError error:" + error + " code:" + errorCode)
240 } 230 }
241 231
242 232
243 // ============================================================================ 233 // ============================================================================
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 std::vector<SubscriptionDescription> subscriptions = CPluginClient::GetInstanc e()->GetListedSubscriptions(); 350 std::vector<SubscriptionDescription> subscriptions = CPluginClient::GetInstanc e()->GetListedSubscriptions();
361 if (subscriptions.size() > 0) 351 if (subscriptions.size() > 0)
362 return CString(subscriptions.front().url.c_str()); 352 return CString(subscriptions.front().url.c_str());
363 else 353 else
364 return CString(L""); 354 return CString(L"");
365 } 355 }
366 356
367 357
368 358
369 #endif // SUPPORT_WHITELIST 359 #endif // SUPPORT_WHITELIST
LEFTRIGHT

Powered by Google App Engine
This is Rietveld