Skip to content
Merged
35 changes: 35 additions & 0 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,12 @@ void CSettings::CreateGUI()
m_pGridBrowserBlacklist->AddColumn(_("Domain"), 0.9f);

m_pButtonBrowserBlacklistRemove = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove domain")));
m_pButtonBrowserBlacklistRemove->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + m_pGridBrowserBlacklist->GetSize().fY + 5.0f));
m_pButtonBrowserBlacklistRemove->SetSize(CVector2D(145.0f, 22.0f));

m_pButtonBrowserBlacklistRemoveAll = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove all")));
m_pButtonBrowserBlacklistRemoveAll->SetPosition(CVector2D(vecTemp.fX + 155.0f, vecTemp.fY + m_pGridBrowserBlacklist->GetSize().fY + 5.0f));
m_pButtonBrowserBlacklistRemoveAll->SetSize(CVector2D(145.0f, 22.0f));
m_pButtonBrowserBlacklistRemove->SetSize(blacklistRemoveSize);
m_pButtonBrowserBlacklistRemove->SetPosition(CVector2D(blacklistGridPos.fX, blacklistGridPos.fY + m_pGridBrowserBlacklist->GetSize().fY + browserButtonSpacing));

Expand Down Expand Up @@ -1632,6 +1638,12 @@ void CSettings::CreateGUI()
m_pGridBrowserWhitelist->AddColumn(_("Domain"), 0.9f);

m_pButtonBrowserWhitelistRemove = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove domain")));
m_pButtonBrowserWhitelistRemove->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + m_pGridBrowserWhitelist->GetSize().fY + 5.0f));
m_pButtonBrowserWhitelistRemove->SetSize(CVector2D(145.0f, 22.0f));

m_pButtonBrowserWhitelistRemoveAll = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove all")));
m_pButtonBrowserWhitelistRemoveAll->SetPosition(CVector2D(vecTemp.fX + 155.0f, vecTemp.fY + m_pGridBrowserWhitelist->GetSize().fY + 5.0f));
m_pButtonBrowserWhitelistRemoveAll->SetSize(CVector2D(145.0f, 22.0f));
m_pButtonBrowserWhitelistRemove->SetSize(whitelistRemoveSize);
m_pButtonBrowserWhitelistRemove->SetPosition(CVector2D(whitelistGridPos.fX, whitelistGridPos.fY + m_pGridBrowserWhitelist->GetSize().fY + browserButtonSpacing));

Expand Down Expand Up @@ -1957,10 +1969,12 @@ void CSettings::CreateGUI()
m_pCheckBoxShowUnsafeResolutions->SetClickHandler(GUI_CALLBACK(&CSettings::ShowUnsafeResolutionsClick, this));
m_pButtonBrowserBlacklistAdd->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistAdd, this));
m_pButtonBrowserBlacklistRemove->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistRemove, this));
m_pButtonBrowserBlacklistRemoveAll->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistRemoveAll, this));
m_pEditBrowserBlacklistAdd->SetActivateHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistDomainAddFocused, this));
m_pEditBrowserBlacklistAdd->SetDeactivateHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistDomainAddDefocused, this));
m_pButtonBrowserWhitelistAdd->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistAdd, this));
m_pButtonBrowserWhitelistRemove->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistRemove, this));
m_pButtonBrowserWhitelistRemoveAll->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistRemoveAll, this));
m_pEditBrowserWhitelistAdd->SetActivateHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistDomainAddFocused, this));
m_pEditBrowserWhitelistAdd->SetDeactivateHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistDomainAddDefocused, this));
m_pProcessAffinityCheckbox->SetClickHandler(GUI_CALLBACK(&CSettings::OnAffinityClick, this));
Expand Down Expand Up @@ -5851,6 +5865,16 @@ bool CSettings::OnBrowserBlacklistRemove(CGUIElement* pElement)
return true;
}

bool CSettings::OnBrowserBlacklistRemoveAll(CGUIElement* pElement)
{
if (m_pGridBrowserBlacklist->GetRowCount() > 0)
{
m_pGridBrowserBlacklist->Clear();
m_bBrowserListsChanged = true;
}
return true;
}

bool CSettings::OnBrowserBlacklistDomainAddFocused(CGUIElement* pElement)
{
m_pLabelBrowserBlacklistAdd->SetVisible(false);
Expand Down Expand Up @@ -5900,6 +5924,17 @@ bool CSettings::OnBrowserWhitelistRemove(CGUIElement* pElement)
return true;
}

bool CSettings::OnBrowserWhitelistRemoveAll(CGUIElement* pElement)
{
if (m_pGridBrowserWhitelist->GetRowCount() > 0)
{
m_pGridBrowserWhitelist->Clear();
m_bBrowserListsChanged = true;
}

return true;
}

bool CSettings::OnBrowserWhitelistDomainAddFocused(CGUIElement* pElement)
{
m_pLabelBrowserWhitelistAdd->SetVisible(false);
Expand Down
4 changes: 4 additions & 0 deletions Client/core/CSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,14 @@ class CSettings
CGUIButton* m_pButtonBrowserBlacklistAdd;
CGUIGridList* m_pGridBrowserBlacklist;
CGUIButton* m_pButtonBrowserBlacklistRemove;
CGUIButton* m_pButtonBrowserBlacklistRemoveAll;
CGUILabel* m_pLabelBrowserCustomWhitelist;
CGUIEdit* m_pEditBrowserWhitelistAdd;
CGUILabel* m_pLabelBrowserWhitelistAdd;
CGUIButton* m_pButtonBrowserWhitelistAdd;
CGUIGridList* m_pGridBrowserWhitelist;
CGUIButton* m_pButtonBrowserWhitelistRemove;
CGUIButton* m_pButtonBrowserWhitelistRemoveAll;
CGUICheckBox* m_pCheckBoxBrowserGPUEnabled;
bool m_bBrowserListsChanged;
bool m_bBrowserListsLoadEnabled;
Expand Down Expand Up @@ -420,10 +422,12 @@ class CSettings
bool OnVerticalAimSensitivityChanged(CGUIElement* pElement);
bool OnBrowserBlacklistAdd(CGUIElement* pElement);
bool OnBrowserBlacklistRemove(CGUIElement* pElement);
bool OnBrowserBlacklistRemoveAll(CGUIElement* pElement);
bool OnBrowserBlacklistDomainAddFocused(CGUIElement* pElement);
bool OnBrowserBlacklistDomainAddDefocused(CGUIElement* pElement);
bool OnBrowserWhitelistAdd(CGUIElement* pElement);
bool OnBrowserWhitelistRemove(CGUIElement* pElement);
bool OnBrowserWhitelistRemoveAll(CGUIElement* pElement);
bool OnBrowserWhitelistDomainAddFocused(CGUIElement* pElement);
bool OnBrowserWhitelistDomainAddDefocused(CGUIElement* pElement);

Expand Down