kicad-source/kicad/pcm/dialogs/dialog_manage_repositories.h

65 lines
2.2 KiB
C
Raw Normal View History

2020-10-26 03:54:36 -07:00
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 Andrew Lutsenko, anlutsenko at gmail dot com
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
2020-10-26 03:54:36 -07:00
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DIALOG_MANAGE_REPOSITORIES_H_
#define DIALOG_MANAGE_REPOSITORIES_H_
#include "dialog_manage_repositories_base.h"
#include "pcm.h"
#include <memory>
#include <vector>
/** Implementing DIALOG_MANAGE_REPOSITORIES_BASE */
class DIALOG_MANAGE_REPOSITORIES : public DIALOG_MANAGE_REPOSITORIES_BASE
{
protected:
// Handlers for DIALOG_MANAGE_REPOSITORIES_BASE events.
void OnRemoveButtonClicked( wxCommandEvent& event ) override;
void OnMoveUpButtonClicked( wxCommandEvent& event ) override;
void OnMoveDownButtonClicked( wxCommandEvent& event ) override;
void OnGridCellClicked( wxGridEvent& event ) override;
void OnSaveClicked( wxCommandEvent& event ) override;
public:
/** Constructor */
DIALOG_MANAGE_REPOSITORIES( wxWindow* parent, std::shared_ptr<PLUGIN_CONTENT_MANAGER> aPcm );
~DIALOG_MANAGE_REPOSITORIES();
void SetData( const std::vector<std::pair<wxString, wxString>>& aData );
void OnAdd( wxCommandEvent& event );
void OnAddDefault( wxCommandEvent& event );
std::vector<std::pair<wxString, wxString>> GetData();
2020-10-26 03:54:36 -07:00
private:
void selectRow( int aRow );
void setColumnWidths();
void addRepository( const wxString& aUrl );
int findRow( int aCol, const wxString& aVal );
2020-10-26 03:54:36 -07:00
std::shared_ptr<PLUGIN_CONTENT_MANAGER> m_pcm;
};
#endif // DIALOG_MANAGE_REPOSITORIES_H_