Skip to content

Commit

Permalink
Webpage Compare: Display "Comparing..." in the status bar during comp…
Browse files Browse the repository at this point in the history
…arison.
  • Loading branch information
sdottaka committed Dec 28, 2023
1 parent 88b55f2 commit 8bc70b1
Show file tree
Hide file tree
Showing 43 changed files with 160 additions and 25 deletions.
3 changes: 3 additions & 0 deletions Src/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3458,6 +3458,7 @@ void CMainFrame::UnwatchDocuments(IMergeDoc* pMergeDoc)

void CMainFrame::WaitAndDoMessageLoop(bool& completed, int ms)
{
long lIdleCount = 0;
while (!completed)
{
MSG msg;
Expand All @@ -3466,6 +3467,8 @@ void CMainFrame::WaitAndDoMessageLoop(bool& completed, int ms)
if (!AfxGetApp()->PumpMessage())
break;
}
if (!theApp.OnIdle(lIdleCount++))
lIdleCount = 0;
Sleep(ms);
}
}
Expand Down
5 changes: 5 additions & 0 deletions Src/Merge.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4240,6 +4240,11 @@ BEGIN
IDS_PREVIEWBAR_CLOSE "&Close"
END

STRINGTABLE
BEGIN
IDS_WEBPAGE_COMPARING "Comparing..."
END

#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////

Expand Down
54 changes: 33 additions & 21 deletions Src/WebPageDiffFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1169,31 +1169,43 @@ void CWebPageDiffFrame::OnUpdateStatusNum(CCmdUI* pCmdUI)
tchar_t sIdx[32] = { 0 };
tchar_t sCnt[32] = { 0 };
String s;
const int nDiffs = m_pWebDiffWindow->GetDiffCount();

// Files are identical - show text "Identical"
if (nDiffs <= 0)
s = theApp.LoadString(IDS_IDENTICAL);

// There are differences, but no selected diff
// - show amount of diffs
else if (m_pWebDiffWindow->GetCurrentDiffIndex() < 0)
auto compareState = m_pWebDiffWindow->GetCompareState();

if (compareState == IWebDiffWindow::NOT_COMPARED)
{
s = theApp.LoadString(nDiffs == 1 ? IDS_1_DIFF_FOUND : IDS_NO_DIFF_SEL_FMT);
_itot_s(nDiffs, sCnt, 10);
strutils::replace(s, _T("%1"), sCnt);
}

// There are differences and diff selected
// - show diff number and amount of diffs
else if (compareState == IWebDiffWindow::COMPARING)
{
s = theApp.LoadString(IDS_WEBPAGE_COMPARING);
}
else
{
s = theApp.LoadString(IDS_DIFF_NUMBER_STATUS_FMT);
const int signInd = m_pWebDiffWindow->GetCurrentDiffIndex();
_itot_s(signInd + 1, sIdx, 10);
strutils::replace(s, _T("%1"), sIdx);
_itot_s(nDiffs, sCnt, 10);
strutils::replace(s, _T("%2"), sCnt);
const int nDiffs = m_pWebDiffWindow->GetDiffCount();

// Files are identical - show text "Identical"
if (nDiffs <= 0)
s = theApp.LoadString(IDS_IDENTICAL);

// There are differences, but no selected diff
// - show amount of diffs
else if (m_pWebDiffWindow->GetCurrentDiffIndex() < 0)
{
s = theApp.LoadString(nDiffs == 1 ? IDS_1_DIFF_FOUND : IDS_NO_DIFF_SEL_FMT);
_itot_s(nDiffs, sCnt, 10);
strutils::replace(s, _T("%1"), sCnt);
}

// There are differences and diff selected
// - show diff number and amount of diffs
else
{
s = theApp.LoadString(IDS_DIFF_NUMBER_STATUS_FMT);
const int signInd = m_pWebDiffWindow->GetCurrentDiffIndex();
_itot_s(signInd + 1, sIdx, 10);
strutils::replace(s, _T("%1"), sIdx);
_itot_s(nDiffs, sCnt, 10);
strutils::replace(s, _T("%2"), sCnt);
}
}
pCmdUI->SetText(s.c_str());
}
Expand Down
2 changes: 1 addition & 1 deletion Src/WinWebDiffLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

struct WebDiffEvent
{
enum EVENT_TYPE { ZoomFactorChanged, NewWindowRequested, WindowCloseRequested, NavigationStarting, FrameNavigationStarting, HistoryChanged, SourceChanged, DocumentTitleChanged, NavigationCompleted, FrameNavigationCompleted, WebMessageReceived, FrameWebMessageReceived, TabChanged, HSCROLL, VSCROLL, CompareStateChanged };
enum EVENT_TYPE { ZoomFactorChanged, NewWindowRequested, WindowCloseRequested, NavigationStarting, FrameNavigationStarting, HistoryChanged, SourceChanged, DocumentTitleChanged, NavigationCompleted, FrameNavigationCompleted, WebMessageReceived, FrameWebMessageReceived, GoBacked, GoForwarded, TabChanged, HSCROLL, VSCROLL, CompareStateChanged };
EVENT_TYPE type;
int pane;
};
Expand Down
1 change: 1 addition & 0 deletions Src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,7 @@
#define IDS_PREVIEWBAR_ZOOMIN 44536
#define IDS_PREVIEWBAR_ZOOMOUT 44537
#define IDS_PREVIEWBAR_CLOSE 44538
#define IDS_WEBPAGE_COMPARING 44539


// Next default values for new objects
Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Arabic.po
Original file line number Diff line number Diff line change
Expand Up @@ -4056,6 +4056,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Basque.po
Original file line number Diff line number Diff line change
Expand Up @@ -4661,6 +4661,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Brazilian.po
Original file line number Diff line number Diff line change
Expand Up @@ -3738,6 +3738,9 @@ msgstr "Mais Zoom"
msgid "Zoom &Out"
msgstr "Menos Zoom"

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Embelezamento"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Bulgarian.po
Original file line number Diff line number Diff line change
Expand Up @@ -4117,6 +4117,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Catalan.po
Original file line number Diff line number Diff line change
Expand Up @@ -4820,6 +4820,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Embellir"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/ChineseSimplified.po
Original file line number Diff line number Diff line change
Expand Up @@ -4171,6 +4171,9 @@ msgstr "放大(&I)"
msgid "Zoom &Out"
msgstr "缩小(&O)"

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "格式美化"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/ChineseTraditional.po
Original file line number Diff line number Diff line change
Expand Up @@ -4820,6 +4820,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "美化"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Corsican.po
Original file line number Diff line number Diff line change
Expand Up @@ -4135,6 +4135,9 @@ msgstr "Ingrandamentu più &forte"
msgid "Zoom &Out"
msgstr "Ingrandamentu &menu forte"

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Imbellimentu"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Croatian.po
Original file line number Diff line number Diff line change
Expand Up @@ -4660,6 +4660,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Czech.po
Original file line number Diff line number Diff line change
Expand Up @@ -4593,6 +4593,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Danish.po
Original file line number Diff line number Diff line change
Expand Up @@ -4698,6 +4698,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Dutch.po
Original file line number Diff line number Diff line change
Expand Up @@ -4121,6 +4121,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Mooi maken"

Expand Down
5 changes: 4 additions & 1 deletion 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: 2023-11-19 21:53+0000\n"
"POT-Creation-Date: 2023-12-28 07:26+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: English <winmerge-translate@lists.sourceforge.net>\n"
Expand Down Expand Up @@ -3732,6 +3732,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Finnish.po
Original file line number Diff line number Diff line change
Expand Up @@ -4158,6 +4158,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Kaunistelu"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/French.po
Original file line number Diff line number Diff line change
Expand Up @@ -4850,6 +4850,9 @@ msgstr "Zoom a&vant"
msgid "Zoom &Out"
msgstr "Zoom a&rrière"

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Embellissement"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Galician.po
Original file line number Diff line number Diff line change
Expand Up @@ -4125,6 +4125,9 @@ msgstr "Aumentar &zoom"
msgid "Zoom &Out"
msgstr "Reducir z&oom"

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Melloras"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/German.po
Original file line number Diff line number Diff line change
Expand Up @@ -4456,6 +4456,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Verschönerung"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Greek.po
Original file line number Diff line number Diff line change
Expand Up @@ -4638,6 +4638,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Hungarian.po
Original file line number Diff line number Diff line change
Expand Up @@ -4799,6 +4799,9 @@ msgstr "&Nagyítás"
msgid "Zoom &Out"
msgstr "K&icsinyítés"

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Megjelenés optimalizálás"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Italian.po
Original file line number Diff line number Diff line change
Expand Up @@ -4097,6 +4097,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
7 changes: 5 additions & 2 deletions Translations/WinMerge/Japanese.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ msgstr ""
"Project-Id-Version: WinMerge\n"
"Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n"
"POT-Creation-Date: 2020-12-05 22:07+0000\n"
"PO-Revision-Date: 2023-11-19 22:04+0900\n"
"PO-Revision-Date: 2023-12-28 08:08+0900\n"
"Last-Translator: Takashi Sawanaka <sawanaka@d1.dion.ne.jp>\n"
"Language-Team: Japanese <winmerge-translate@lists.sourceforge.net>\n"
"Language: ja\n"
Expand All @@ -19,7 +19,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: ..\n"
"X-Generator: Poedit 3.4.1\n"
"X-Generator: Poedit 3.4.2\n"

#. LANGUAGE, SUBLANGUAGE
msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US"
Expand Down Expand Up @@ -4126,6 +4126,9 @@ msgstr "拡大(&I)"
msgid "Zoom &Out"
msgstr "縮小(&O)"

msgid "Comparing..."
msgstr "比較しています..."

msgid "Prettification"
msgstr "整形"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Korean.po
Original file line number Diff line number Diff line change
Expand Up @@ -4845,6 +4845,9 @@ msgstr "확대(&I)"
msgid "Zoom &Out"
msgstr "축소(&O)"

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "꾸미기"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Lithuanian.po
Original file line number Diff line number Diff line change
Expand Up @@ -3738,6 +3738,9 @@ msgstr "Did&inti"
msgid "Zoom &Out"
msgstr "Mažin&ti"

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Sutvarkymas"

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Norwegian.po
Original file line number Diff line number Diff line change
Expand Up @@ -4128,6 +4128,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Persian.po
Original file line number Diff line number Diff line change
Expand Up @@ -4707,6 +4707,9 @@ msgstr ""
msgid "Zoom &Out"
msgstr ""

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions Translations/WinMerge/Polish.po
Original file line number Diff line number Diff line change
Expand Up @@ -3739,6 +3739,9 @@ msgstr "Powiększ"
msgid "Zoom &Out"
msgstr "Pomniejsz"

msgid "Comparing..."
msgstr ""

msgid "Prettification"
msgstr "Upiększanie"

Expand Down

0 comments on commit 8bc70b1

Please sign in to comment.