2
* This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3
* http://www.gnu.org/licenses/gpl-3.0.html
6
#include <scrollingdialog.h>
8
#include <configmanager.h>
9
#include <pluginmanager.h>
13
// Custom window to shutdown the app when closed.
14
// used for batch builds only.
15
class BatchLogWindow : public wxScrollingDialog
18
BatchLogWindow(wxWindow *parent, const wxChar *title)
19
: wxScrollingDialog(parent, -1, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX | wxMINIMIZE_BOX)
22
size.SetWidth(Manager::Get()->GetConfigManager(_T("message_manager"))->ReadInt(_T("/batch_build_log/width"), wxDefaultSize.GetWidth()));
23
size.SetHeight(Manager::Get()->GetConfigManager(_T("message_manager"))->ReadInt(_T("/batch_build_log/height"), wxDefaultSize.GetHeight()));
26
void EndModal(int retCode)
29
// find compiler plugin
30
PluginsArray arr = Manager::Get()->GetPluginManager()->GetCompilerOffers();
31
if (arr.GetCount() != 0)
33
cbCompilerPlugin* compiler = static_cast<cbCompilerPlugin*>(arr[0]);
34
if (compiler && compiler->IsRunning())
36
if (cbMessageBox(_("The build is in progress. Are you sure you want to abort it?"),
38
wxICON_QUESTION | wxYES_NO, this) == wxID_YES)
40
compiler->KillProcess();
41
while (compiler->IsRunning())
51
Manager::Get()->GetConfigManager(_T("message_manager"))->Write(_T("/batch_build_log/width"), (int)GetSize().GetWidth());
52
Manager::Get()->GetConfigManager(_T("message_manager"))->Write(_T("/batch_build_log/height"), (int)GetSize().GetHeight());
53
wxScrollingDialog::EndModal(retCode);