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
|
2025-01-01 13:30:11 -08:00
|
|
|
* 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 );
|
2021-11-11 13:56:53 +00:00
|
|
|
|
2021-11-08 17:14:48 +01:00
|
|
|
~DIALOG_MANAGE_REPOSITORIES();
|
2021-11-11 13:56:53 +00:00
|
|
|
|
|
|
|
void SetData( const std::vector<std::pair<wxString, wxString>>& aData );
|
|
|
|
|
2022-05-23 20:40:12 +00:00
|
|
|
void OnAdd( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void OnAddDefault( wxCommandEvent& event );
|
|
|
|
|
2021-11-11 13:56:53 +00:00
|
|
|
std::vector<std::pair<wxString, wxString>> GetData();
|
2020-10-26 03:54:36 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
void selectRow( int aRow );
|
|
|
|
void setColumnWidths();
|
2022-05-23 20:40:12 +00:00
|
|
|
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_
|