diff --git a/src/src/app.cpp b/src/src/app.cpp
index 22a46dfb1..8b90cae68 100644
--- a/src/src/app.cpp
+++ b/src/src/app.cpp
@@ -749,8 +749,15 @@ bool CodeBlocksApp::OnInit()
s_Loading = false;
LoadDelayedFiles(frame);
- BatchJob();
- frame->Close();
+ m_startBatchBuild.Bind(wxEVT_TIMER, [this](wxTimerEvent& evt)
+ {
+ this->BatchJob();
+ });
+
+ m_startBatchBuild.Start(2000, true);
+
+
+ //frame->Close();
return true;
}
@@ -974,6 +981,10 @@ int CodeBlocksApp::BatchJob()
wxString bb_title = m_pBatchBuildDialog->GetTitle();
m_pBatchBuildDialog->SetTitle(bb_title + _T(" - ") + title);
m_pBatchBuildDialog->Show();
+ m_pBatchBuildDialog->Bind(wxEVT_CLOSE_WINDOW, [=](wxCloseEvent& evt)
+ {
+ m_Frame->Close();
+ });
if (m_ReBuild)
{
@@ -1000,7 +1011,7 @@ int CodeBlocksApp::BatchJob()
// The batch build log might have been deleted in
diff --git a/src/src/app.cpp b/src/src/app.cpp
index 22a46dfb1..8b90cae68 100644
--- a/src/src/app.cpp
+++ b/src/src/app.cpp
@@ -749,8 +749,15 @@ bool CodeBlocksApp::OnInit()
s_Loading = false;
LoadDelayedFiles(frame);
- BatchJob();
- frame->Close();
+ m_startBatchBuild.Bind(wxEVT_TIMER, [this](wxTimerEvent& evt)
+ {
+ this->BatchJob();
+ });
+
+ m_startBatchBuild.Start(2000, true);
+
+
+ //frame->Close();
return true;
}
@@ -974,6 +981,10 @@ int CodeBlocksApp::BatchJob()
wxString bb_title = m_pBatchBuildDialog->GetTitle();
m_pBatchBuildDialog->SetTitle(bb_title + _T(" - ") + title);
m_pBatchBuildDialog->Show();
+ m_pBatchBuildDialog->Bind(wxEVT_CLOSE_WINDOW, [=](wxCloseEvent& evt)
+ {
+ m_Frame->Close();
+ });
if (m_ReBuild)
{
@@ -1000,7 +1011,7 @@ int CodeBlocksApp::BatchJob()
// The batch build log might have been deleted in
diff --git a/src/src/app.cpp b/src/src/app.cpp
index 22a46dfb1..8b90cae68 100644
--- a/src/src/app.cpp
+++ b/src/src/app.cpp
@@ -749,8 +749,15 @@ bool CodeBlocksApp::OnInit()
s_Loading = false;
LoadDelayedFiles(frame);
- BatchJob();
- frame->Close();
+ m_startBatchBuild.Bind(wxEVT_TIMER, [this](wxTimerEvent& evt)
+ {
+ this->BatchJob();
+ });
+
+ m_startBatchBuild.Start(2000, true);
+
+
+ //frame->Close();
return true;
}
@@ -974,6 +981,10 @@ int CodeBlocksApp::BatchJob()
wxString bb_title = m_pBatchBuildDialog->GetTitle();
m_pBatchBuildDialog->SetTitle(bb_title + _T(" - ") + title);
m_pBatchBuildDialog->Show();
+ m_pBatchBuildDialog->Bind(wxEVT_CLOSE_WINDOW, [=](wxCloseEvent& evt)
+ {
+ m_Frame->Close();
+ });
if (m_ReBuild)
{
@@ -1000,7 +1011,7 @@ int CodeBlocksApp::BatchJob()
// The batch build log might have been deleted in
// CodeBlocksApp::OnBatchBuildDone().
// If it has not, it's still compiling.
- if (m_pBatchBuildDialog)
+ /*if (m_pBatchBuildDialog)
{
// If operation is "--clean", there is no need to display the dialog
// as the operation is synchronous and it already has finished by the
@@ -1015,7 +1026,7 @@ int CodeBlocksApp::BatchJob()
m_pBatchBuildDialog->Destroy();
m_pBatchBuildDialog = nullptr;
}
- }
+ }*/
if (tbIcon)
{
@@ -1053,13 +1064,16 @@ void CodeBlocksApp::OnBatchBuildDone(CodeBlocksEvent& event)
if (m_pBatchBuildDialog && m_BatchWindowAutoClose)
{
- if (m_pBatchBuildDialog->IsModal())
+ /*if (m_pBatchBuildDialog->IsModal())
m_pBatchBuildDialog->EndModal(wxID_OK);
else
{
- m_pBatchBuildDialog->Destroy();
- m_pBatchBuildDialog = nullptr;
- }
+
+
+ }*/
+ m_pBatchBuildDialog->Close();
+ //m_pBatchBuildDialog->Destroy();
+ //m_pBatchBuildDialog = nullptr;
}
}
diff --git a/src/src/app.h b/src/src/app.h
index 97c69e74e..953916fba 100644
--- a/src/src/app.h
+++ b/src/src/app.h
@@ -142,6 +142,8 @@ class CodeBlocksApp : public wxApp
void SetupPersonality(const wxString& personality);
void SetupImageSizes(wxToolBarAddOnXmlHandler *toolbarAddonHandler);
+ wxTimer m_startBatchBuild;
+
wxString m_Prefix; // directory specified in --prefix switch
wxString m_UserDataDir; // directory specified in --user-data-dir switch
still quick patch. I am still testing.... time is limited... and testing is difficult and slow...
[edit:] first problem found: can not cancel building withtout crash