Skip to content

Commit

Permalink
Add a "Defaults" button to the "Options (System)" dialog. (#2405)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmprm77 authored Aug 11, 2024
1 parent 75d0d05 commit 99d2607
Show file tree
Hide file tree
Showing 41 changed files with 154 additions and 130 deletions.
1 change: 1 addition & 0 deletions Src/Merge.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,7 @@ BEGIN
CONTROL "C&ustom folder:",IDC_STATIC,"Button",BS_AUTORADIOBUTTON,17,114,253,10
EDITTEXT IDC_TMPFOLDER_NAME,27,126,191,14,ES_AUTOHSCROLL | WS_GROUP
PUSHBUTTON "Br&owse...",IDC_TMPFOLDER_BROWSE,224,126,50,14
PUSHBUTTON "Defaults", IDC_COMPARE_DEFAULTS, 191, 228, 88, 14
END

IDD_GENERATE_PATCH DIALOGEX 0, 0, 340, 190
Expand Down
22 changes: 22 additions & 0 deletions Src/PropRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include "OptionsDef.h"
#include "OptionsMgr.h"
#include "OptionsPanel.h"
#include "Constants.h"
#include "Environment.h"
#include "paths.h"

#ifdef _DEBUG
#define new DEBUG_NEW
Expand All @@ -37,6 +40,7 @@ void PropRegistry::DoDataExchange(CDataExchange* pDX)

BEGIN_MESSAGE_MAP(PropRegistry, OptionsPanel)
//{{AFX_MSG_MAP(PropRegistry)
ON_BN_CLICKED(IDC_COMPARE_DEFAULTS, OnDefaults)
ON_BN_CLICKED(IDC_EXT_EDITOR_BROWSE, OnBrowseEditor)
ON_BN_CLICKED(IDC_FILTER_USER_BROWSE, OnBrowseFilterPath)
ON_BN_CLICKED(IDC_TMPFOLDER_BROWSE, OnBrowseTmpFolder)
Expand Down Expand Up @@ -89,6 +93,24 @@ BOOL PropRegistry::OnInitDialog()
return TRUE;
}

/**
* @brief Sets options to defaults
* @remarks We must specify the default value of OPT_FILTER_USERPATH explicitly because it is not set for faster startup.
* (Refer to Options::Init().)
*/
void PropRegistry::OnDefaults()
{
m_strEditorPath = GetOptionsMgr()->GetDefault<String>(OPT_EXT_EDITOR_CMD);
m_bUseRecycleBin = GetOptionsMgr()->GetDefault<bool>(OPT_USE_RECYCLE_BIN);
m_strUserFilterPath = GetOptionsMgr()->GetDefault<String>(OPT_FILTER_USERPATH);
if (m_strUserFilterPath.empty())
m_strUserFilterPath = paths::ConcatPath(env::GetMyDocuments(), DefaultRelativeFilterPath);
m_tempFolderType = GetOptionsMgr()->GetDefault<bool>(OPT_USE_SYSTEM_TEMP_PATH) ? 0 : 1;
m_tempFolder = GetOptionsMgr()->GetDefault<String>(OPT_CUSTOM_TEMP_PATH);

UpdateData(FALSE);
}

/// Open file browse dialog to locate editor
void PropRegistry::OnBrowseEditor()
{
Expand Down
1 change: 1 addition & 0 deletions Src/PropRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class PropRegistry : public OptionsPanel
protected:
// Generated message map functions
//{{AFX_MSG(PropRegistry)
afx_msg void OnDefaults();
afx_msg void OnBrowseEditor();
afx_msg void OnBrowseFilterPath();
afx_msg void OnBrowseTmpFolder();
Expand Down
6 changes: 3 additions & 3 deletions Translations/WinMerge/Arabic.po
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,9 @@ msgstr "م&جلد مخصص:"
msgid "Br&owse..."
msgstr "&بحث..."

msgid "Defaults"
msgstr "الإعدادات الافتراضية"

msgid "Patch Generator"
msgstr "أداة توليد التصحيح"

Expand Down Expand Up @@ -1518,9 +1521,6 @@ msgstr "دمج سطر الأوامر"
msgid "Open to e&xternal editor"
msgstr "فتح في المحرر الخارجي"

msgid "Defaults"
msgstr "الإعدادات الافتراضية"

msgid "Display Columns"
msgstr "عرض الأعمدة"

Expand Down
8 changes: 4 additions & 4 deletions Translations/WinMerge/Basque.po
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,10 @@ msgstr "&Egile agiritegia:"
msgid "Br&owse..."
msgstr "Bilat&u"

#, c-format
msgid "Defaults"
msgstr "Berezkoak"

#, c-format
msgid "Patch Generator"
msgstr "Eranskin Sortzailea"
Expand Down Expand Up @@ -1838,10 +1842,6 @@ msgstr "Ko&mando lerroa barne"
msgid "Open to e&xternal editor"
msgstr "Ireki kan&poko editatzailean"

#, c-format
msgid "Defaults"
msgstr "Berezkoak"

#, c-format
msgid "Display Columns"
msgstr "Erakutsi Zutabeak"
Expand Down
6 changes: 3 additions & 3 deletions Translations/WinMerge/Brazilian.po
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,9 @@ msgstr "P&asta personalizada:"
msgid "Br&owse..."
msgstr "Pr&ocurar..."

msgid "Defaults"
msgstr "Padrões"

msgid "Patch Generator"
msgstr "Gerador de Patches"

Expand Down Expand Up @@ -1515,9 +1518,6 @@ msgstr "Inclu&ir a linha de comando"
msgid "Open to e&xternal editor"
msgstr "Abrir no e&ditor externo"

msgid "Defaults"
msgstr "Padrões"

msgid "Display Columns"
msgstr "Exibir Colunas"

Expand Down
6 changes: 3 additions & 3 deletions Translations/WinMerge/Bulgarian.po
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,9 @@ msgstr "Друга &папка:"
msgid "Br&owse..."
msgstr "&Разглеждане…"

msgid "Defaults"
msgstr "По подразбиране"

msgid "Patch Generator"
msgstr "Създаване на кръпки"

Expand Down Expand Up @@ -1512,9 +1515,6 @@ msgstr "Включително командния &ред"
msgid "Open to e&xternal editor"
msgstr "Отваряне с външе&н редактор"

msgid "Defaults"
msgstr "По подразбиране"

msgid "Display Columns"
msgstr "Видими колони"

Expand Down
8 changes: 4 additions & 4 deletions Translations/WinMerge/Catalan.po
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,10 @@ msgstr "Directori personalitzat:"
msgid "Br&owse..."
msgstr "N&avega..."

#, c-format
msgid "Defaults"
msgstr "Predeterminats"

#, c-format
msgid "Patch Generator"
msgstr "Generador de pedaços"
Expand Down Expand Up @@ -1836,10 +1840,6 @@ msgstr "Inc&lou-hi la línia d'ordres"
msgid "Open to e&xternal editor"
msgstr "Obre-ho en un &editor extern"

#, c-format
msgid "Defaults"
msgstr "Predeterminats"

#, c-format
msgid "Display Columns"
msgstr "Visualització de columnes"
Expand Down
6 changes: 3 additions & 3 deletions Translations/WinMerge/ChineseSimplified.po
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,9 @@ msgstr "自定义文件夹(&U):"
msgid "Br&owse..."
msgstr "浏览(&O)..."

msgid "Defaults"
msgstr "默认"

msgid "Patch Generator"
msgstr "补丁生成器"

Expand Down Expand Up @@ -1521,9 +1524,6 @@ msgstr "包含命令行(&D)"
msgid "Open to e&xternal editor"
msgstr "用外部编辑器打开(&X)"

msgid "Defaults"
msgstr "默认"

msgid "Display Columns"
msgstr "选择显示的列"

Expand Down
8 changes: 4 additions & 4 deletions Translations/WinMerge/ChineseTraditional.po
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,10 @@ msgstr "自訂資料夾 (&U):"
msgid "Br&owse..."
msgstr "瀏覽 (&O)..."

#, c-format
msgid "Defaults"
msgstr "預設值"

#, c-format
msgid "Patch Generator"
msgstr "補綴產生器"
Expand Down Expand Up @@ -1845,10 +1849,6 @@ msgstr "附加 diff 命令於檔首 (&P)"
msgid "Open to e&xternal editor"
msgstr "開啟外部編輯器 (&X)"

#, c-format
msgid "Defaults"
msgstr "預設值"

#, c-format
msgid "Display Columns"
msgstr "顯示欄位"
Expand Down
6 changes: 3 additions & 3 deletions Translations/WinMerge/Corsican.po
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,9 @@ msgstr "Cartulare &persunalizatu :"
msgid "Br&owse..."
msgstr "Na&vigà…"

msgid "Defaults"
msgstr "Predefinizioni"

msgid "Patch Generator"
msgstr "Generatore di currezzioni"

Expand Down Expand Up @@ -1517,9 +1520,6 @@ msgstr "Inclu&de a linea di cumanda"
msgid "Open to e&xternal editor"
msgstr "Apre cù l’&editore esternu"

msgid "Defaults"
msgstr "Predefinizioni"

msgid "Display Columns"
msgstr "Affissera di e culonne"

Expand Down
8 changes: 4 additions & 4 deletions Translations/WinMerge/Croatian.po
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,10 @@ msgstr "Ko&risnikova mapa"
msgid "Br&owse..."
msgstr "&Odabir..."

#, c-format
msgid "Defaults"
msgstr "Predpodešeno"

#, c-format
msgid "Patch Generator"
msgstr "Pohrana razlika (Patch)"
Expand Down Expand Up @@ -1835,10 +1839,6 @@ msgstr "&Uključi naredbeni redak"
msgid "Open to e&xternal editor"
msgstr "Otvori u vanjskom pregledniku."

#, c-format
msgid "Defaults"
msgstr "Predpodešeno"

#, c-format
msgid "Display Columns"
msgstr "Prikaži kolone"
Expand Down
8 changes: 4 additions & 4 deletions Translations/WinMerge/Czech.po
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,10 @@ msgstr "&Vlastní složka:"
msgid "Br&owse..."
msgstr "Procházet..."

#, c-format
msgid "Defaults"
msgstr "&Původní"

#, c-format
msgid "Patch Generator"
msgstr "Vytvoření opravného souboru"
Expand Down Expand Up @@ -1835,10 +1839,6 @@ msgstr "Vložit pří&kazový řádek"
msgid "Open to e&xternal editor"
msgstr "Otevřít v &externím editoru"

#, c-format
msgid "Defaults"
msgstr "&Původní"

#, c-format
msgid "Display Columns"
msgstr "Zobrazit sloupce"
Expand Down
8 changes: 4 additions & 4 deletions Translations/WinMerge/Danish.po
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,10 @@ msgstr "V&algt mappe:"
msgid "Br&owse..."
msgstr "G&ennemse..."

#, c-format
msgid "Defaults"
msgstr "Standard"

#, c-format
msgid "Patch Generator"
msgstr "Patch Generator"
Expand Down Expand Up @@ -1836,10 +1840,6 @@ msgstr "Inkluder &kommandolinjen"
msgid "Open to e&xternal editor"
msgstr "Åben i ekstern e&ditor"

#, c-format
msgid "Defaults"
msgstr "Standard"

#, c-format
msgid "Display Columns"
msgstr "Vis søjler"
Expand Down
6 changes: 3 additions & 3 deletions Translations/WinMerge/Dutch.po
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,9 @@ msgstr "Aangepaste map:"
msgid "Br&owse..."
msgstr "Bladeren..."

msgid "Defaults"
msgstr "Standaardwaarden"

msgid "Patch Generator"
msgstr "Patch-generator"

Expand Down Expand Up @@ -1515,9 +1518,6 @@ msgstr "Inclusief opdrachtregel"
msgid "Open to e&xternal editor"
msgstr "Openen met externe editor"

msgid "Defaults"
msgstr "Standaardwaarden"

msgid "Display Columns"
msgstr "Kolommen weergeven"

Expand Down
8 changes: 4 additions & 4 deletions Translations/WinMerge/English.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WinMerge\n"
"Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n"
"POT-Creation-Date: 2024-07-23 21:46+0000\n"
"POT-Creation-Date: 2024-08-10 20:44+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: English <winmerge-translate@lists.sourceforge.net>\n"
Expand Down Expand Up @@ -1470,6 +1470,9 @@ msgstr ""
msgid "Br&owse..."
msgstr ""

msgid "Defaults"
msgstr ""

msgid "Patch Generator"
msgstr ""

Expand Down Expand Up @@ -1509,9 +1512,6 @@ msgstr ""
msgid "Open to e&xternal editor"
msgstr ""

msgid "Defaults"
msgstr ""

msgid "Display Columns"
msgstr ""

Expand Down
6 changes: 3 additions & 3 deletions Translations/WinMerge/Finnish.po
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,9 @@ msgstr "Mukautettu kansio:"
msgid "Br&owse..."
msgstr "Selaa..."

msgid "Defaults"
msgstr "Oletukset"

msgid "Patch Generator"
msgstr "Korjausgeneraattori"

Expand Down Expand Up @@ -1519,9 +1522,6 @@ msgstr "Sisällytä komentorivi"
msgid "Open to e&xternal editor"
msgstr "Avaa ulkoiseen editoriin"

msgid "Defaults"
msgstr "Oletukset"

msgid "Display Columns"
msgstr "Näytä sarakkeet"

Expand Down
8 changes: 4 additions & 4 deletions Translations/WinMerge/French.po
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,10 @@ msgstr "Dossier personnalisé :"
msgid "Br&owse..."
msgstr "P&arcourir..."

#, c-format
msgid "Defaults"
msgstr "Par défaut"

#, c-format
msgid "Patch Generator"
msgstr "Générateur de retouche"
Expand Down Expand Up @@ -1843,10 +1847,6 @@ msgstr "Inclure la ligne de co&mmande"
msgid "Open to e&xternal editor"
msgstr "Ouvrir avec l'éditeur e&xterne"

#, c-format
msgid "Defaults"
msgstr "Par défaut"

#, c-format
msgid "Display Columns"
msgstr "Affichage des colonnes"
Expand Down
Loading

0 comments on commit 99d2607

Please sign in to comment.