KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_manage_repositories.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2021 Andrew Lutsenko, anlutsenko at gmail dot com
5 * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef DIALOG_MANAGE_REPOSITORIES_H_
22#define DIALOG_MANAGE_REPOSITORIES_H_
23
25#include "pcm.h"
26#include <memory>
27#include <vector>
28
29
32{
33protected:
34 // Handlers for DIALOG_MANAGE_REPOSITORIES_BASE events.
35 void OnRemoveButtonClicked( wxCommandEvent& event ) override;
36 void OnMoveUpButtonClicked( wxCommandEvent& event ) override;
37 void OnMoveDownButtonClicked( wxCommandEvent& event ) override;
38 void OnGridCellClicked( wxGridEvent& event ) override;
39 void OnSaveClicked( wxCommandEvent& event ) override;
40
41public:
43 DIALOG_MANAGE_REPOSITORIES( wxWindow* parent, std::shared_ptr<PLUGIN_CONTENT_MANAGER> aPcm );
44
46
47 void SetData( const std::vector<std::pair<wxString, wxString>>& aData );
48
49 void OnAdd( wxCommandEvent& event );
50
51 void OnAddDefault( wxCommandEvent& event );
52
53 std::vector<std::pair<wxString, wxString>> GetData();
54
55private:
56 void swapRows( int aRowA, int aRowB );
57 void selectRow( int aRow );
58 void setColumnWidths();
59 void addRepository( const wxString& aUrl );
60 int findRow( int aCol, const wxString& aVal );
61
62 std::shared_ptr<PLUGIN_CONTENT_MANAGER> m_pcm;
63};
64
65#endif // DIALOG_MANAGE_REPOSITORIES_H_
Class DIALOG_MANAGE_REPOSITORIES_BASE.
Implementing DIALOG_MANAGE_REPOSITORIES_BASE.
void OnRemoveButtonClicked(wxCommandEvent &event) override
void OnMoveDownButtonClicked(wxCommandEvent &event) override
std::vector< std::pair< wxString, wxString > > GetData()
void addRepository(const wxString &aUrl)
void OnSaveClicked(wxCommandEvent &event) override
std::shared_ptr< PLUGIN_CONTENT_MANAGER > m_pcm
void OnAdd(wxCommandEvent &event)
int findRow(int aCol, const wxString &aVal)
void SetData(const std::vector< std::pair< wxString, wxString > > &aData)
void OnMoveUpButtonClicked(wxCommandEvent &event) override
void swapRows(int aRowA, int aRowB)
void OnAddDefault(wxCommandEvent &event)
void OnGridCellClicked(wxGridEvent &event) override