summaryrefslogtreecommitdiff
path: root/ui/SmallDialogs.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 16:46:15 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 16:46:15 +0200
commitf0ae67919454f572f39541b11ddd74b4fda0d12e (patch)
tree5c9ea9601db75eb849e86fc30fe67810f3679bdc /ui/SmallDialogs.cpp
parent1.2 (diff)
downloadFreeFileSync-f0ae67919454f572f39541b11ddd74b4fda0d12e.tar.gz
FreeFileSync-f0ae67919454f572f39541b11ddd74b4fda0d12e.tar.bz2
FreeFileSync-f0ae67919454f572f39541b11ddd74b4fda0d12e.zip
1.3
Diffstat (limited to 'ui/SmallDialogs.cpp')
-rw-r--r--ui/SmallDialogs.cpp71
1 files changed, 59 insertions, 12 deletions
diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp
index f6d29864..cf21bc22 100644
--- a/ui/SmallDialogs.cpp
+++ b/ui/SmallDialogs.cpp
@@ -1,5 +1,5 @@
-#include "SmallDialogs.h"
-#include "..\library\globalFunctions.h"
+#include "smallDialogs.h"
+#include "../library/globalFunctions.h"
AboutDlg::AboutDlg(MainDialog* window) : AboutDlgGenerated(window)
{
@@ -12,6 +12,8 @@ AboutDlg::AboutDlg(MainDialog* window) : AboutDlgGenerated(window)
//build
wxString build = wxString(_("(Build: ")) + __TDATE__ + ")";
m_build->SetLabel(build);
+
+ m_button8->SetFocus();
}
AboutDlg::~AboutDlg() {}
@@ -28,7 +30,10 @@ void AboutDlg::OnOK(wxCommandEvent& event)
//########################################################################################
-HelpDlg::HelpDlg(MainDialog* window) : HelpDlgGenerated(window) {}
+HelpDlg::HelpDlg(MainDialog* window) : HelpDlgGenerated(window)
+{
+ m_button8->SetFocus();
+}
HelpDlg::~HelpDlg() {}
@@ -46,7 +51,9 @@ void HelpDlg::OnOK(wxCommandEvent& event)
//########################################################################################
-FilterDlg::FilterDlg(MainDialog* window) : FilterDlgGenerated(window), mainDialog(window)
+FilterDlg::FilterDlg(MainDialog* window) :
+ FilterDlgGenerated(window),
+ mainDialog(window)
{
m_bitmap8->SetBitmap(*GlobalResources::bitmapInclude);
@@ -58,11 +65,13 @@ FilterDlg::FilterDlg(MainDialog* window) : FilterDlgGenerated(window), mainDialo
FilterDlg::~FilterDlg() {}
+
void FilterDlg::OnClose(wxCloseEvent& event)
{
EndModal(0);
}
+
void FilterDlg::OnOK(wxCommandEvent& event)
{
//only if user presses ApplyFilter, he wants the changes to be committed
@@ -74,6 +83,12 @@ void FilterDlg::OnOK(wxCommandEvent& event)
}
+void FilterDlg::OnCancel(wxCommandEvent& event)
+{
+ EndModal(0);
+}
+
+
void FilterDlg::OnDefault(wxCommandEvent& event)
{
m_textCtrlInclude->SetValue("*");
@@ -84,6 +99,34 @@ void FilterDlg::OnDefault(wxCommandEvent& event)
}
//########################################################################################
+DeleteDialog::DeleteDialog(const wxString& headerText, const wxString& messageText, wxWindow* main) :
+ DeleteDialogGenerated(main)
+{
+ m_staticTextHeader->SetLabel(headerText);
+ m_textCtrlMessage->SetValue(messageText);
+
+ m_buttonOK->SetFocus();
+}
+
+DeleteDialog::~DeleteDialog() {}
+
+
+void DeleteDialog::OnOK(wxCommandEvent& event)
+{
+ EndModal(OkayButtonPressed);
+}
+
+void DeleteDialog::OnCancel(wxCommandEvent& event)
+{
+ EndModal(CancelButtonPressed);
+}
+
+void DeleteDialog::OnClose(wxCloseEvent& event)
+{
+ EndModal(CancelButtonPressed);
+}
+//########################################################################################
+
ErrorDlg::ErrorDlg(const wxString messageText, bool& suppressErrormessages) :
ErrorDlgGenerated(0),
@@ -91,6 +134,8 @@ ErrorDlg::ErrorDlg(const wxString messageText, bool& suppressErrormessages) :
{
m_bitmap10->SetBitmap(*GlobalResources::bitmapWarning);
m_textCtrl8->SetValue(messageText);
+
+ m_buttonContinue->SetFocus();
}
ErrorDlg::~ErrorDlg() {}
@@ -134,6 +179,8 @@ SyncStatus::SyncStatus(StatusUpdater* updater, double gaugeTotalElements, wxWind
resetGauge(gaugeTotalElements);
+ m_buttonAbort->SetFocus();
+
if (windowToDis) //disable (main) window while this status dialog is shown
windowToDis->Enable(false);
}
@@ -142,7 +189,10 @@ SyncStatus::SyncStatus(StatusUpdater* updater, double gaugeTotalElements, wxWind
SyncStatus::~SyncStatus()
{
if (windowToDis)
+ {
windowToDis->Enable(true);
+ windowToDis->Raise();
+ }
}
@@ -183,14 +233,10 @@ void SyncStatus::updateStatusDialogNow()
m_staticTextProcessedObj->SetLabel(GlobalFunctions::numberToWxString(numberOfProcessedObjects));
//remaining bytes left for copy
- m_staticTextBytesCurrent->SetLabel(FreeFileSync::formatFilesizeToShortString(mpz_class(currentElements)));
-
- static double totalElementsLast = -1;
- if (totalElementsLast != totalElements)
- {
- totalElementsLast = totalElements;
- m_staticTextBytesTotal->SetLabel(FreeFileSync::formatFilesizeToShortString(mpz_class(totalElements)));
- }
+ const wxString remainingBytes =
+ FreeFileSync::formatFilesizeToShortString(mpz_class(currentElements)) + "/" +
+ FreeFileSync::formatFilesizeToShortString(mpz_class(totalElements));
+ m_staticTextBytesCopied->SetLabel(remainingBytes);
//do the ui update
updateUI_Now();
@@ -204,6 +250,7 @@ void SyncStatus::processHasFinished(const wxString& finalStatusText) //essential
m_staticTextStatus->SetLabel(finalStatusText);
m_buttonAbort->Hide();
m_buttonOK->Show();
+ m_buttonOK->SetFocus();
updateStatusDialogNow(); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed
Layout(); //
bgstack15