Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,11 @@ void CSettings::CreateGUI()

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(140.0f, 22.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_pLabelBrowserCustomBlacklist->GetPosition(vecTemp); // Reset vecTemp

Expand Down Expand Up @@ -1027,7 +1031,11 @@ void CSettings::CreateGUI()

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(140.0f, 22.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));

/**
* Advanced tab
Expand Down Expand Up @@ -1328,10 +1336,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 @@ -4938,6 +4948,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 @@ -4987,6 +5007,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 @@ -339,12 +339,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 @@ -384,10 +386,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