From d90d9f0c401a21c85a525aaca0b97df8f7955db8 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Thu, 25 Dec 2014 22:54:14 +0100 Subject: Linux/MacOSX: Implement waiting dialog for lengthy operations in order to have a better user experience. --- src/Main/Forms/Forms.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) mode change 100644 => 100755 src/Main/Forms/Forms.cpp (limited to 'src/Main/Forms/Forms.cpp') diff --git a/src/Main/Forms/Forms.cpp b/src/Main/Forms/Forms.cpp old mode 100644 new mode 100755 index ad732534..1c536b31 --- a/src/Main/Forms/Forms.cpp +++ b/src/Main/Forms/Forms.cpp @@ -3349,3 +3349,38 @@ VolumeSizeWizardPageBase::~VolumeSizeWizardPageBase() VolumeSizePrefixChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( VolumeSizeWizardPageBase::OnVolumeSizePrefixSelected ), NULL, this ); } + +WaitDialogBase::WaitDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer160; + bSizer160 = new wxBoxSizer( wxVERTICAL ); + + WaitStaticText = new wxStaticText( this, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE ); + WaitStaticText->Wrap( -1 ); + bSizer160->Add( WaitStaticText, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); + + WaitProgessBar = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL|wxGA_SMOOTH ); + WaitProgessBar->SetValue( 0 ); + bSizer160->Add( WaitProgessBar, 0, wxALL|wxEXPAND, 5 ); + + + this->SetSizer( bSizer160 ); + this->Layout(); + bSizer160->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( WaitDialogBase::OnWaitDialogClose ) ); + this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( WaitDialogBase::OnWaitDialogInit ) ); +} + +WaitDialogBase::~WaitDialogBase() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( WaitDialogBase::OnWaitDialogClose ) ); + this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( WaitDialogBase::OnWaitDialogInit ) ); + +} -- cgit v1.2.3