summaryrefslogtreecommitdiff
path: root/ui/main_dlg.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:11:33 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:11:33 +0200
commit6fcfe73ca751f068978ce201094b17cf2dfe4d20 (patch)
treee7d85e8f9057430b480cd0e2f5ccb43c9d2ef8f8 /ui/main_dlg.cpp
parent3.15 (diff)
downloadFreeFileSync-6fcfe73ca751f068978ce201094b17cf2dfe4d20.tar.gz
FreeFileSync-6fcfe73ca751f068978ce201094b17cf2dfe4d20.tar.bz2
FreeFileSync-6fcfe73ca751f068978ce201094b17cf2dfe4d20.zip
3.16
Diffstat (limited to 'ui/main_dlg.cpp')
-rw-r--r--ui/main_dlg.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/ui/main_dlg.cpp b/ui/main_dlg.cpp
index d394b9fe..8eae6fb1 100644
--- a/ui/main_dlg.cpp
+++ b/ui/main_dlg.cpp
@@ -903,9 +903,8 @@ std::set<size_t> MainDialog::getSelectedRows() const
class ManualDeletionHandler : private wxEvtHandler, public DeleteFilesHandler
{
public:
- ManualDeletionHandler(MainDialog* main, size_t totalObjToDel) :
+ ManualDeletionHandler(MainDialog* main) :
mainDlg(main),
- totalObjToDelete(totalObjToDel),
abortRequested(false),
ignoreErrors(false),
deletionCount(0)
@@ -955,15 +954,14 @@ public:
return DeleteFilesHandler::IGNORE_ERROR; //dummy return value
}
- virtual void deletionSuccessful(size_t deletedItems) //called for each file/folder that has been deleted
+ virtual void notifyDeletion(const Zstring& currentObject) //called for each file/folder that has been deleted
{
- deletionCount += deletedItems;
+ ++deletionCount;
if (updateUiIsAllowed()) //test if specific time span between ui updates is over
{
- wxString statusMessage = _("%x / %y objects deleted successfully");
+ wxString statusMessage = _("%x objects deleted successfully");
statusMessage.Replace(wxT("%x"), ffs3::numberToStringSep(deletionCount), false);
- statusMessage.Replace(wxT("%y"), ffs3::numberToStringSep(totalObjToDelete), false);
if (mainDlg->m_staticTextStatusMiddle->GetLabel() != statusMessage)
{
@@ -995,8 +993,6 @@ private:
MainDialog* const mainDlg;
- const size_t totalObjToDelete;
-
bool abortRequested;
bool ignoreErrors;
size_t deletionCount;
@@ -1019,14 +1015,12 @@ void MainDialog::deleteSelectedFiles()
gridDataView->getAllFileRef(viewSelectionRight, compRefRight);
- int totalDeleteCount = 0;
wxWindow* oldFocus = wxWindow::FindFocus();
if (ffs3::showDeleteDialog(compRefLeft,
compRefRight,
globalSettings->gui.deleteOnBothSides,
- globalSettings->gui.useRecyclerForManualDeletion,
- totalDeleteCount) == DefaultReturnCode::BUTTON_OKAY)
+ globalSettings->gui.useRecyclerForManualDeletion) == DefaultReturnCode::BUTTON_OKAY)
{
if (globalSettings->gui.useRecyclerForManualDeletion && !ffs3::recycleBinExists())
{
@@ -1037,7 +1031,7 @@ void MainDialog::deleteSelectedFiles()
try
{
//handle errors when deleting files/folders
- ManualDeletionHandler statusHandler(this, totalDeleteCount);
+ ManualDeletionHandler statusHandler(this);
ffs3::deleteFromGridAndHD(gridDataView->getDataTentative(),
compRefLeft,
bgstack15