diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 0f8b278f0..d32bbadf8 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -497,7 +497,7 @@ void Notepad_plus::command(int id) url = TEXT("https://www.google.com/search?q=$(CURRENT_WORD)"); } } - else if (nppGui._searchEngineChoice == nppGui.se_duckDuckGo) + else if (nppGui._searchEngineChoice == nppGui.se_duckDuckGo || nppGui._searchEngineChoice == nppGui.se_bing) { url = TEXT("https://duckduckgo.com/?q=$(CURRENT_WORD)"); } @@ -505,10 +505,6 @@ void Notepad_plus::command(int id) { url = TEXT("https://www.google.com/search?q=$(CURRENT_WORD)"); } - else if (nppGui._searchEngineChoice == nppGui.se_bing) - { - url = TEXT("https://www.bing.com/search?q=$(CURRENT_WORD)"); - } else if (nppGui._searchEngineChoice == nppGui.se_yahoo) { url = TEXT("https://search.yahoo.com/search?q=$(CURRENT_WORD)"); diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 4cbb85c11..2fe704b8d 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -432,14 +432,13 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Search Engine (for command ""Search on Internet"")",IDC_SEARCHENGINES_GB_STATIC,74,24,297,145,BS_CENTER - CONTROL "DuckDuckGo",IDC_SEARCHENGINE_DUCKDUCKGO_RADIO,"Button",BS_AUTORADIOBUTTON,105,37,180,10 - CONTROL "Google",IDC_SEARCHENGINE_GOOGLE_RADIO,"Button",BS_AUTORADIOBUTTON,105,52,180,10 - CONTROL "Bing",IDC_SEARCHENGINE_BING_RADIO,"Button",BS_AUTORADIOBUTTON,105,67,180,10 - CONTROL "Yahoo!",IDC_SEARCHENGINE_YAHOO_RADIO,"Button",BS_AUTORADIOBUTTON,105,82,180,10 - CONTROL "Stack Overflow",IDC_SEARCHENGINE_STACKOVERFLOW_RADIO,"Button",BS_AUTORADIOBUTTON,105,97,180,10 - CONTROL "Set your search engine here:",IDC_SEARCHENGINE_CUSTOM_RADIO, "Button",BS_AUTORADIOBUTTON,105,112,180,10 - EDITTEXT IDC_SEARCHENGINE_EDIT,114,128,179,14,ES_AUTOHSCROLL - LTEXT "Example: https://www.google.com/search?q=$(CURRENT_WORD)",IDD_SEARCHENGINE_NOTE_STATIC,114,143,245,20 + CONTROL "DuckDuckGo",IDC_SEARCHENGINE_DUCKDUCKGO_RADIO,"Button",BS_AUTORADIOBUTTON,105,43,180,10 + CONTROL "Google",IDC_SEARCHENGINE_GOOGLE_RADIO,"Button",BS_AUTORADIOBUTTON,105,58,180,10 + CONTROL "Yahoo!",IDC_SEARCHENGINE_YAHOO_RADIO,"Button",BS_AUTORADIOBUTTON,105,73,180,10 + CONTROL "Stack Overflow",IDC_SEARCHENGINE_STACKOVERFLOW_RADIO,"Button",BS_AUTORADIOBUTTON,105,88,180,10 + CONTROL "Set your search engine here:",IDC_SEARCHENGINE_CUSTOM_RADIO,"Button",BS_AUTORADIOBUTTON,105,103,180,10 + EDITTEXT IDC_SEARCHENGINE_EDIT,114,119,179,14,ES_AUTOHSCROLL + LTEXT "Example: https://www.google.com/search?q=$(CURRENT_WORD)",IDD_SEARCHENGINE_NOTE_STATIC,114,134,245,20 END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index d35ff3408..dbaf3941c 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -3688,10 +3688,12 @@ INT_PTR CALLBACK SearchEngineSubDlg::run_dlgProc(UINT message, WPARAM wParam, LP nppGUI._searchEngineChoice = nppGUI.se_google; } } + if (nppGUI._searchEngineChoice == nppGUI.se_bing) + nppGUI._searchEngineChoice = nppGUI.se_duckDuckGo; + ::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_CUSTOM_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_custom ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_DUCKDUCKGO_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_duckDuckGo ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_GOOGLE_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_google ? BST_CHECKED : BST_UNCHECKED, 0); - ::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_BING_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_bing ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_YAHOO_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_yahoo ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_STACKOVERFLOW_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_stackoverflow ? BST_CHECKED : BST_UNCHECKED, 0); @@ -3718,13 +3720,6 @@ INT_PTR CALLBACK SearchEngineSubDlg::run_dlgProc(UINT message, WPARAM wParam, LP } break; - case IDC_SEARCHENGINE_BING_RADIO: - { - nppGUI._searchEngineChoice = nppGUI.se_bing; - ::EnableWindow(::GetDlgItem(_hSelf, IDC_SEARCHENGINE_EDIT), false); - } - break; - case IDC_SEARCHENGINE_YAHOO_RADIO: { nppGUI._searchEngineChoice = nppGUI.se_yahoo; diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index d965765d8..d6833421c 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -152,7 +152,7 @@ #define IDC_SEARCHENGINES_GB_STATIC (IDD_PREFERENCE_SUB_SEARCHENGINE + 1) #define IDC_SEARCHENGINE_DUCKDUCKGO_RADIO (IDD_PREFERENCE_SUB_SEARCHENGINE + 2) #define IDC_SEARCHENGINE_GOOGLE_RADIO (IDD_PREFERENCE_SUB_SEARCHENGINE + 3) - #define IDC_SEARCHENGINE_BING_RADIO (IDD_PREFERENCE_SUB_SEARCHENGINE + 4) + //#define IDC_SEARCHENGINE_BING_RADIO (IDD_PREFERENCE_SUB_SEARCHENGINE + 4) #define IDC_SEARCHENGINE_YAHOO_RADIO (IDD_PREFERENCE_SUB_SEARCHENGINE + 5) #define IDC_SEARCHENGINE_CUSTOM_RADIO (IDD_PREFERENCE_SUB_SEARCHENGINE + 6) #define IDC_SEARCHENGINE_EDIT (IDD_PREFERENCE_SUB_SEARCHENGINE + 7)