コード例 #1
0
void AdvancedDlg::OnAddExistingCompiler()
{
    wxString folder = ::wxDirSelector(_("Select the compiler folder"));
    if(folder.IsEmpty()) {
        return;
    }

    CompilerPtr cmp = m_compilersDetector.Locate(folder);
    if(cmp) {
        // We found new compiler
        // Prompt the user to give it a name
        while(true) {
            wxString name =
                ::wxGetTextFromUser(_("Set a name to the compiler"), _("New compiler found!"), cmp->GetName());
            if(name.IsEmpty()) {
                return;
            }
            // Add the compiler
            if(BuildSettingsConfigST::Get()->IsCompilerExist(name)) {
                continue;
            }
            cmp->SetName(name);
            break;
        }

        // Save the new compiler
        BuildSettingsConfigST::Get()->SetCompiler(cmp);

        // Reload the dialog
        LoadCompilers();
    }
}
コード例 #2
0
void AdvancedDlg::OnButtonNewClicked()
{
    NewCompilerDlg dlg(this);
    if(dlg.ShowModal() == wxID_OK) {
        CreateNewCompiler(dlg.GetCompilerName(), dlg.GetMasterCompiler());
        LoadCompilers();
    }
}
コード例 #3
0
void CompilerMainPage::OnDeleteCompiler(wxCommandEvent& event)
{
    int selection = m_listBoxCompilers->GetSelection();
    if(selection == wxNOT_FOUND) return;

    if(::wxMessageBox(wxString() << _("Are you sure you want to delete compiler\n'")
                                 << m_listBoxCompilers->GetStringSelection() << "'?",
                      _("Delete Compiler"),
                      wxYES_NO | wxCENTER | wxICON_WARNING) != wxYES)
        return;

    wxString compilerName = m_listBoxCompilers->GetStringSelection();
    BuildSettingsConfigST::Get()->DeleteCompiler(compilerName);

    // Reload the content
    LoadCompilers();
}
コード例 #4
0
AdvancedDlg::AdvancedDlg(wxWindow* parent,
                         size_t selected_page,
                         int id,
                         wxString title,
                         wxPoint pos,
                         wxSize size,
                         int style)
    : AdvancedDlgBase(parent)
    , m_rightclickMenu(NULL)
{
    //m_compilersMainPanel = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
    //
    //wxBoxSizer* bSizer5;
    //bSizer5 = new wxBoxSizer(wxVERTICAL);
    //
    //wxBoxSizer* bSizer4;
    //bSizer4 = new wxBoxSizer(wxHORIZONTAL);
    //
    //bSizer5->Add(bSizer4, 0, wxEXPAND, 5);
    //
    m_compilersPage = new CompilerMainPage(m_notebook);
    //bSizer5->Add(m_compilersPage, 1, wxALL | wxEXPAND, 5);

    //m_compilersMainPanel->SetSizer(bSizer5);
    //m_compilersMainPanel->Layout();

    m_notebook->AddPage(m_compilersPage, _("Compilers"), true);
    m_buildSettings = new BuildTabSetting(m_notebook);
    m_notebook->AddPage(m_buildSettings, _("Build Output Appearance"), false);

    m_buildPage = new BuildPage(m_notebook);
    m_notebook->AddPage(m_buildPage, _("Build Systems"), false);

    m_rightclickMenu = wxXmlResource::Get()->LoadMenu(wxT("delete_compiler_menu"));

    LoadCompilers();

    // center the dialog
    CentreOnParent();
    this->Layout();
    
    SetName("AdvancedDlg");
    WindowAttrManager::Load(this);
}
コード例 #5
0
void CompilerMainPage::OnRenameCompiler(wxCommandEvent& event)
{
    int selection = m_listBoxCompilers->GetSelection();
    if(selection == wxNOT_FOUND) return;

    wxString newName =
        ::wxGetTextFromUser(_("New Compiler Name"), _("Rename Compiler"), m_listBoxCompilers->GetStringSelection());
    if(newName.IsEmpty()) return;

    CompilerPtr compiler = BuildSettingsConfigST::Get()->GetCompiler(m_listBoxCompilers->GetStringSelection());
    if(!compiler) return;

    // Delete the old compiler
    BuildSettingsConfigST::Get()->DeleteCompiler(compiler->GetName());

    // Create new one with differet name
    compiler->SetName(newName);
    BuildSettingsConfigST::Get()->SetCompiler(compiler);

    // Reload the content
    LoadCompilers();
}