Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into commandbar
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Aug 13, 2024
2 parents 67fc535 + 711a3b8 commit 9b05201
Show file tree
Hide file tree
Showing 45 changed files with 175 additions and 135 deletions.
16 changes: 16 additions & 0 deletions Src/PropBackups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void PropBackups::DoDataExchange(CDataExchange* pDX)


BEGIN_MESSAGE_MAP(PropBackups, OptionsPanel)
ON_BN_CLICKED(IDC_COMPARE_DEFAULTS, OnDefaults)
ON_BN_CLICKED(IDC_BACKUP_BROWSE, OnBnClickedBackupBrowse)
END_MESSAGE_MAP()

Expand Down Expand Up @@ -77,6 +78,21 @@ void PropBackups::WriteOptions()
GetOptionsMgr()->SaveOption(OPT_BACKUP_ADD_TIME, m_bAppendTime);
}

/**
* @brief Sets options to defaults.
*/
void PropBackups::OnDefaults()
{
m_bCreateForFolderCmp = GetOptionsMgr()->GetDefault<bool>(OPT_BACKUP_FOLDERCMP);
m_bCreateForFileCmp = GetOptionsMgr()->GetDefault<bool>(OPT_BACKUP_FILECMP);
m_nBackupFolder = GetOptionsMgr()->GetDefault<unsigned>(OPT_BACKUP_LOCATION);
m_sGlobalFolder = GetOptionsMgr()->GetDefault<String>(OPT_BACKUP_GLOBALFOLDER);
m_bAppendBak = GetOptionsMgr()->GetDefault<bool>(OPT_BACKUP_ADD_BAK);
m_bAppendTime = GetOptionsMgr()->GetDefault<bool>(OPT_BACKUP_ADD_TIME);

UpdateData(FALSE);
}

/**
* @brief Called when user selects Browse-button.
*/
Expand Down
1 change: 1 addition & 0 deletions Src/PropBackups.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class PropBackups : public OptionsPanel

protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
afx_msg void OnDefaults();
afx_msg void OnBnClickedBackupBrowse();

DECLARE_MESSAGE_MAP()
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
2 changes: 1 addition & 1 deletion Translations/WinMerge/CreateMasterPotFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (oFSO.GetFileName(WScript.FullName).toLowerCase() === "cscript.exe") {
}
var bInsertLineNumbers = false;
if (WScript.Arguments.Named.Exists("InsertLineNumbers")) {
bInsertLineNumbers = CBool(WScript.Arguments.Named("InsertLineNumbers"));
bInsertLineNumbers = (WScript.Arguments.Named("InsertLineNumbers").toLowerCase() === "true");
}

Main();
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 <[email protected]>\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
Loading

0 comments on commit 9b05201

Please sign in to comment.