From: Eran I. <no...@so...> - 2014-01-15 14:43:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "codelite". The branch, master has been updated via dc37283854b912fe12b11ab962f70dd055aeb9b4 (commit) via 477e1867f8337cd2f4f87a0c7bd492e8f4ed4716 (commit) from c2d61cace8a1d97ec7a94951dffbea9501441e2f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceforge.net/p/codelite/codelitegit/ci/dc37283854b912fe12b11ab962f70dd055aeb9b4 commit dc37283854b912fe12b11ab962f70dd055aeb9b4 Author: Eran <era...@gm...> Date: Wed Jan 15 16:42:38 2014 +0200 Build settings: when creating new compiler, allow the user to copy the settins from an existing compiler diff --git a/LiteEditor.workspace b/LiteEditor.workspace index 8b5820e..d252ee0 100644 --- a/LiteEditor.workspace +++ b/LiteEditor.workspace @@ -114,7 +114,7 @@ <Project Name="wxsqlite3" ConfigName="WinDebugUnicode"/> <Project Name="ZoomNavigator" ConfigName="WinDebugUnicode"/> </WorkspaceConfiguration> - <WorkspaceConfiguration Name="CMake_Release" Selected="no"> + <WorkspaceConfiguration Name="CMake_Release" Selected="yes"> <Project Name="ZoomNavigator" ConfigName="DebugUnicode"/> <Project Name="wxsqlite3" ConfigName="WinReleaseUnicode"/> <Project Name="wxshapeframework" ConfigName="WinReleaseUnicode"/> @@ -149,7 +149,7 @@ <Project Name="Tweaks" ConfigName="DebugUnicode"/> <Project Name="CMakePlugin" ConfigName="WinDebugUnicode"/> </WorkspaceConfiguration> - <WorkspaceConfiguration Name="CMake_Debug" Selected="yes"> + <WorkspaceConfiguration Name="CMake_Debug" Selected="no"> <Project Name="ZoomNavigator" ConfigName="WinReleaseUnicode"/> <Project Name="wxsqlite3" ConfigName="WinReleaseUnicode"/> <Project Name="wxshapeframework" ConfigName="WinReleaseUnicode"/> diff --git a/LiteEditor/LiteEditor.project b/LiteEditor/LiteEditor.project index 94819d1..0f7dfe2 100644 --- a/LiteEditor/LiteEditor.project +++ b/LiteEditor/LiteEditor.project @@ -271,6 +271,8 @@ <File Name="addoptioncheckdlgbase.cpp"/> <File Name="compiler_page.wxcp"/> <File Name="advance_settings.wxcp"/> + <File Name="NewCompilerDlg.h"/> + <File Name="NewCompilerDlg.cpp"/> </VirtualDirectory> <VirtualDirectory Name="Build"> <File Name="configuration_manager_base_dlg.cpp"/> diff --git a/LiteEditor/NewCompilerDlg.cpp b/LiteEditor/NewCompilerDlg.cpp new file mode 100644 index 0000000..9a33286 --- /dev/null +++ b/LiteEditor/NewCompilerDlg.cpp @@ -0,0 +1,37 @@ +#include "NewCompilerDlg.h" +#include "windowattrmanager.h" +#include "build_settings_config.h" + +NewCompilerDlg::NewCompilerDlg(wxWindow* parent) + : NewCompilerDlgBase(parent) +{ + BuildSettingsConfigCookie cookie; + m_choiceCompilers->Append("<None>"); + CompilerPtr cmp = BuildSettingsConfigST::Get()->GetFirstCompiler(cookie); + while ( cmp ) { + m_choiceCompilers->Append(cmp->GetName()); + cmp = BuildSettingsConfigST::Get()->GetNextCompiler(cookie); + } + + m_choiceCompilers->SetStringSelection("<None>"); + WindowAttrManager::Load(this, "NewCompilerDlg"); +} + +NewCompilerDlg::~NewCompilerDlg() +{ + WindowAttrManager::Save(this, "NewCompilerDlg"); +} + +void NewCompilerDlg::OnOkUI(wxUpdateUIEvent& event) +{ + event.Enable( !m_textCtrlCompilerName->IsEmpty() ); +} + +wxString NewCompilerDlg::GetMasterCompiler() const +{ + wxString compilerName = m_choiceCompilers->GetStringSelection(); + if ( compilerName == "<None>" ) { + return wxEmptyString; + } + return compilerName; +} diff --git a/LiteEditor/NewCompilerDlg.h b/LiteEditor/NewCompilerDlg.h new file mode 100644 index 0000000..1068801 --- /dev/null +++ b/LiteEditor/NewCompilerDlg.h @@ -0,0 +1,19 @@ +#ifndef NEWCOMPILERDLG_H +#define NEWCOMPILERDLG_H +#include "compiler_pages.h" + +class NewCompilerDlg : public NewCompilerDlgBase +{ +public: + NewCompilerDlg(wxWindow* parent); + virtual ~NewCompilerDlg(); + + wxString GetCompilerName() const { + return m_textCtrlCompilerName->GetValue(); + } + + wxString GetMasterCompiler() const; +protected: + virtual void OnOkUI(wxUpdateUIEvent& event); +}; +#endif // NEWCOMPILERDLG_H diff --git a/LiteEditor/advanced_settings.cpp b/LiteEditor/advanced_settings.cpp index 4886149..79de6c4 100644 --- a/LiteEditor/advanced_settings.cpp +++ b/LiteEditor/advanced_settings.cpp @@ -49,6 +49,7 @@ #include "frame.h" #include <wx/textdlg.h> #include "advance_settings_base.h" +#include "NewCompilerDlg.h" BEGIN_EVENT_TABLE(AdvancedDlg, AdvancedDlgBase) EVT_MENU(XRCID("delete_compiler"), AdvancedDlg::OnDeleteCompiler) @@ -149,11 +150,9 @@ AdvancedDlg::~AdvancedDlg() void AdvancedDlg::OnButtonNewClicked(wxCommandEvent &event) { wxUnusedVar(event); - wxString newCompilerName = ::wxGetTextFromUser( _("Enter New Compiler Name:"), _("New Compiler")); - TrimString(newCompilerName); - - if ( !newCompilerName.IsEmpty() ) { - CreateDefaultNewCompiler(newCompilerName); + NewCompilerDlg dlg(this); + if ( dlg.ShowModal() == wxID_OK ) { + CreateNewCompiler(dlg.GetCompilerName(), dlg.GetMasterCompiler()); LoadCompilers(); if(m_compilersNotebook->GetPageCount() > ((m_compilerPagesMap.size() *6)-1) ) { @@ -226,14 +225,19 @@ void AdvancedDlg::SaveCompilers() } } -bool AdvancedDlg::CreateDefaultNewCompiler ( const wxString &name ) +bool AdvancedDlg::CreateNewCompiler (const wxString& name, const wxString& copyFrom) { if ( BuildSettingsConfigST::Get()->IsCompilerExist ( name ) ) { wxMessageBox ( _( "A compiler with this name already exists" ), _( "Error" ), wxOK | wxICON_HAND ); return false; } - - CompilerPtr cmp = BuildSettingsConfigST::Get()->GetCompiler ( name ); + + CompilerPtr cmp; + if ( !copyFrom.IsEmpty() ) { + cmp = BuildSettingsConfigST::Get()->GetCompiler ( copyFrom ); + } else { + cmp = BuildSettingsConfigST::Get()->GetCompiler ( name ); + } cmp->SetName ( name ); BuildSettingsConfigST::Get()->SetCompiler ( cmp ); return true; diff --git a/LiteEditor/advanced_settings.h b/LiteEditor/advanced_settings.h index 5253bde..878dcd0 100644 --- a/LiteEditor/advanced_settings.h +++ b/LiteEditor/advanced_settings.h @@ -83,7 +83,7 @@ protected: void OnContextMenu(wxContextMenuEvent &e); void LoadCompilers(); - bool CreateDefaultNewCompiler(const wxString &name); + bool CreateNewCompiler(const wxString &name, const wxString ©From); void AddCompiler(CompilerPtr cmp, bool selected); bool DeleteCompiler(const wxString &name); void SaveCompilers(); diff --git a/LiteEditor/compiler_page.wxcp b/LiteEditor/compiler_page.wxcp index 2535990..0815d2f 100644 --- a/LiteEditor/compiler_page.wxcp +++ b/LiteEditor/compiler_page.wxcp @@ -1,7 +1,7 @@ { "metadata": { "m_generatedFilesDir": ".", - "m_objCounter": 69, + "m_objCounter": 90, "m_includeFiles": [], "m_bitmapFunction": "wxCAD0CInitBitmapResources", "m_bitmapsFile": "compiler_page_plugin_bitmaps.cpp", @@ -7973,5 +7973,617 @@ }] }] }] + }, { + "m_type": 4421, + "proportion": 0, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxDEFAULT_DIALOG_STYLE", "wxRESIZE_BORDER"], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"], + "m_properties": [{ + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "NewCompilerDlgBase" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "<Default>" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "<Default>" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "string", + "m_label": "Title:", + "m_value": "New Compiler" + }, { + "type": "virtualFolderPicker", + "m_label": "Virtual Folder:", + "m_path": "LiteEditor:Dialogs:Compiler" + }, { + "type": "choice", + "m_label": "Centre:", + "m_selection": 1, + "m_options": ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"] + }, { + "type": "string", + "m_label": "File:", + "m_value": "NewCompilerDlg" + }, { + "type": "string", + "m_label": "Inherited Class", + "m_value": "NewCompilerDlg" + }, { + "type": "string", + "m_label": "Class Decorator", + "m_value": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (16x16) :", + "m_path": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (32x32) :", + "m_path": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (64x64) :", + "m_path": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (128x128):", + "m_path": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (256x256):", + "m_path": "" + }], + "m_events": [], + "m_children": [{ + "m_type": 4401, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": [], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"], + "m_properties": [{ + "type": "string", + "m_label": "Name:", + "m_value": "boxSizer73" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "choice", + "m_label": "Orientation:", + "m_selection": 0, + "m_options": ["wxVERTICAL", "wxHORIZONTAL"] + }], + "m_events": [], + "m_children": [{ + "m_type": 4403, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": [], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"], + "m_properties": [{ + "type": "string", + "m_label": "Name:", + "m_value": "flexGridSizer82" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "string", + "m_label": "# Columns:", + "m_value": "2" + }, { + "type": "string", + "m_label": "# Rows:", + "m_value": "0" + }, { + "type": "string", + "m_label": "Growable columns:", + "m_value": "1" + }, { + "type": "string", + "m_label": "Growable rows:", + "m_value": "" + }, { + "type": "string", + "m_label": "Horizontal gap:", + "m_value": "0" + }, { + "type": "string", + "m_label": "Vertical gap:", + "m_value": "0" + }], + "m_events": [], + "m_children": [{ + "m_type": 4405, + "proportion": 0, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": [], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_staticText84" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "<Default>" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "<Default>" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "multi-string", + "m_label": "Label:", + "m_value": "New compiler name:" + }, { + "type": "string", + "m_label": "Wrap:", + "m_value": "-1" + }], + "m_events": [], + "m_children": [] + }, { + "m_type": 4406, + "proportion": 0, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": [], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_textCtrlCompilerName" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "<Default>" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "<Default>" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": true + }, { ... 1330 lines suppressed ... hooks/post-receive -- codelite |