Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e2753c4

Browse files
committed
Add ability to remove all domains
1 parent 02bc654 commit e2753c4

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

‎Client/core/CSettings.cpp‎

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,11 @@ void CSettings::CreateGUI()
982982

983983
m_pButtonBrowserBlacklistRemove = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove domain")));
984984
m_pButtonBrowserBlacklistRemove->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + m_pGridBrowserBlacklist->GetSize().fY + 5.0f));
985-
m_pButtonBrowserBlacklistRemove->SetSize(CVector2D(140.0f, 22.0f));
985+
m_pButtonBrowserBlacklistRemove->SetSize(CVector2D(145.0f, 22.0f));
986+
987+
m_pButtonBrowserBlacklistRemoveAll = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove all")));
988+
m_pButtonBrowserBlacklistRemoveAll->SetPosition(CVector2D(vecTemp.fX + 155.0f, vecTemp.fY + m_pGridBrowserBlacklist->GetSize().fY + 5.0f));
989+
m_pButtonBrowserBlacklistRemoveAll->SetSize(CVector2D(145.0f, 22.0f));
986990

987991
m_pLabelBrowserCustomBlacklist->GetPosition(vecTemp); // Reset vecTemp
988992

@@ -1017,7 +1021,11 @@ void CSettings::CreateGUI()
10171021

10181022
m_pButtonBrowserWhitelistRemove = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove domain")));
10191023
m_pButtonBrowserWhitelistRemove->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + m_pGridBrowserWhitelist->GetSize().fY + 5.0f));
1020-
m_pButtonBrowserWhitelistRemove->SetSize(CVector2D(140.0f, 22.0f));
1024+
m_pButtonBrowserWhitelistRemove->SetSize(CVector2D(145.0f, 22.0f));
1025+
1026+
m_pButtonBrowserWhitelistRemoveAll = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pTabBrowser, _("Remove all")));
1027+
m_pButtonBrowserWhitelistRemoveAll->SetPosition(CVector2D(vecTemp.fX + 155.0f, vecTemp.fY + m_pGridBrowserWhitelist->GetSize().fY + 5.0f));
1028+
m_pButtonBrowserWhitelistRemoveAll->SetSize(CVector2D(145.0f, 22.0f));
10211029

10221030
/**
10231031
* Advanced tab
@@ -1317,10 +1325,12 @@ void CSettings::CreateGUI()
13171325
m_pCheckBoxShowUnsafeResolutions->SetClickHandler(GUI_CALLBACK(&CSettings::ShowUnsafeResolutionsClick, this));
13181326
m_pButtonBrowserBlacklistAdd->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistAdd, this));
13191327
m_pButtonBrowserBlacklistRemove->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistRemove, this));
1328+
m_pButtonBrowserBlacklistRemoveAll->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistRemoveAll, this));
13201329
m_pEditBrowserBlacklistAdd->SetActivateHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistDomainAddFocused, this));
13211330
m_pEditBrowserBlacklistAdd->SetDeactivateHandler(GUI_CALLBACK(&CSettings::OnBrowserBlacklistDomainAddDefocused, this));
13221331
m_pButtonBrowserWhitelistAdd->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistAdd, this));
13231332
m_pButtonBrowserWhitelistRemove->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistRemove, this));
1333+
m_pButtonBrowserWhitelistRemoveAll->SetClickHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistRemoveAll, this));
13241334
m_pEditBrowserWhitelistAdd->SetActivateHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistDomainAddFocused, this));
13251335
m_pEditBrowserWhitelistAdd->SetDeactivateHandler(GUI_CALLBACK(&CSettings::OnBrowserWhitelistDomainAddDefocused, this));
13261336
m_pProcessAffinityCheckbox->SetClickHandler(GUI_CALLBACK(&CSettings::OnAffinityClick, this));
@@ -4870,6 +4880,16 @@ bool CSettings::OnBrowserBlacklistRemove(CGUIElement* pElement)
48704880
return true;
48714881
}
48724882

4883+
bool CSettings::OnBrowserBlacklistRemoveAll(CGUIElement* pElement)
4884+
{
4885+
if (m_pGridBrowserBlacklist->GetRowCount() > 0)
4886+
{
4887+
m_pGridBrowserBlacklist->Clear();
4888+
m_bBrowserListsChanged = true;
4889+
}
4890+
return true;
4891+
}
4892+
48734893
bool CSettings::OnBrowserBlacklistDomainAddFocused(CGUIElement* pElement)
48744894
{
48754895
m_pLabelBrowserBlacklistAdd->SetVisible(false);
@@ -4919,6 +4939,17 @@ bool CSettings::OnBrowserWhitelistRemove(CGUIElement* pElement)
49194939
return true;
49204940
}
49214941

4942+
bool CSettings::OnBrowserWhitelistRemoveAll(CGUIElement* pElement)
4943+
{
4944+
if (m_pGridBrowserWhitelist->GetRowCount() > 0)
4945+
{
4946+
m_pGridBrowserWhitelist->Clear();
4947+
m_bBrowserListsChanged = true;
4948+
}
4949+
4950+
return true;
4951+
}
4952+
49224953
bool CSettings::OnBrowserWhitelistDomainAddFocused(CGUIElement* pElement)
49234954
{
49244955
m_pLabelBrowserWhitelistAdd->SetVisible(false);

‎Client/core/CSettings.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,14 @@ class CSettings
338338
CGUIButton* m_pButtonBrowserBlacklistAdd;
339339
CGUIGridList* m_pGridBrowserBlacklist;
340340
CGUIButton* m_pButtonBrowserBlacklistRemove;
341+
CGUIButton* m_pButtonBrowserBlacklistRemoveAll;
341342
CGUILabel* m_pLabelBrowserCustomWhitelist;
342343
CGUIEdit* m_pEditBrowserWhitelistAdd;
343344
CGUILabel* m_pLabelBrowserWhitelistAdd;
344345
CGUIButton* m_pButtonBrowserWhitelistAdd;
345346
CGUIGridList* m_pGridBrowserWhitelist;
346347
CGUIButton* m_pButtonBrowserWhitelistRemove;
348+
CGUIButton* m_pButtonBrowserWhitelistRemoveAll;
347349
CGUICheckBox* m_pCheckBoxBrowserGPUEnabled;
348350
bool m_bBrowserListsChanged;
349351
bool m_bBrowserListsLoadEnabled;
@@ -383,10 +385,12 @@ class CSettings
383385
bool OnVerticalAimSensitivityChanged(CGUIElement* pElement);
384386
bool OnBrowserBlacklistAdd(CGUIElement* pElement);
385387
bool OnBrowserBlacklistRemove(CGUIElement* pElement);
388+
bool OnBrowserBlacklistRemoveAll(CGUIElement* pElement);
386389
bool OnBrowserBlacklistDomainAddFocused(CGUIElement* pElement);
387390
bool OnBrowserBlacklistDomainAddDefocused(CGUIElement* pElement);
388391
bool OnBrowserWhitelistAdd(CGUIElement* pElement);
389392
bool OnBrowserWhitelistRemove(CGUIElement* pElement);
393+
bool OnBrowserWhitelistRemoveAll(CGUIElement* pElement);
390394
bool OnBrowserWhitelistDomainAddFocused(CGUIElement* pElement);
391395
bool OnBrowserWhitelistDomainAddDefocused(CGUIElement* pElement);
392396

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /