2019-06-09 14:12:44 +01:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2019-08-14 09:28:07 +01:00
|
|
|
* Copyright (C) 2019 CERN
|
2021-01-27 17:15:38 -05:00
|
|
|
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
2019-06-09 14:12:44 +01: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 2
|
|
|
|
* 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, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KICAD_MANAGER_CONTROL_H
|
|
|
|
#define KICAD_MANAGER_CONTROL_H
|
|
|
|
|
|
|
|
#include <tool/tool_interactive.h>
|
2020-06-04 16:47:49 -07:00
|
|
|
#include <mutex>
|
2019-06-09 14:12:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
class KICAD_MANAGER_FRAME;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2021-01-27 17:15:38 -05:00
|
|
|
* Handle actions in the kicad manager frame.
|
2019-06-09 14:12:44 +01:00
|
|
|
*/
|
|
|
|
class KICAD_MANAGER_CONTROL : public TOOL_INTERACTIVE
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
KICAD_MANAGER_CONTROL();
|
|
|
|
~KICAD_MANAGER_CONTROL() override { }
|
|
|
|
|
|
|
|
/// @copydoc TOOL_INTERACTIVE::Reset()
|
|
|
|
void Reset( RESET_REASON aReason ) override;
|
|
|
|
|
|
|
|
int NewProject( const TOOL_EVENT& aEvent );
|
|
|
|
int NewFromTemplate( const TOOL_EVENT& aEvent );
|
2023-09-14 14:39:42 -07:00
|
|
|
int NewFromRepository( const TOOL_EVENT& aEvent );
|
2024-07-15 18:20:13 -04:00
|
|
|
int NewJobsetFile( const TOOL_EVENT& aEvent );
|
2019-06-09 14:12:44 +01:00
|
|
|
int OpenProject( const TOOL_EVENT& aEvent );
|
2021-07-25 21:58:44 -04:00
|
|
|
int OpenDemoProject( const TOOL_EVENT& aEvent );
|
2020-08-08 18:52:14 +00:00
|
|
|
int CloseProject( const TOOL_EVENT& aEvent );
|
2019-11-09 19:39:08 +00:00
|
|
|
int SaveProjectAs( const TOOL_EVENT& aEvent );
|
2022-09-14 22:28:09 +00:00
|
|
|
int LoadProject( const TOOL_EVENT& aEvent );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Imports a non kicad project from a sch/pcb dropped file.
|
|
|
|
* No error is displayed if the project can not be imported.
|
|
|
|
*/
|
|
|
|
int ViewDroppedViewers( const TOOL_EVENT& aEvent );
|
2019-06-09 14:12:44 +01:00
|
|
|
|
|
|
|
int Refresh( const TOOL_EVENT& aEvent );
|
2019-06-16 20:11:08 +01:00
|
|
|
int UpdateMenu( const TOOL_EVENT& aEvent );
|
2019-06-09 14:12:44 +01:00
|
|
|
|
2019-06-10 15:23:37 +01:00
|
|
|
int ShowPlayer( const TOOL_EVENT& aEvent );
|
|
|
|
int Execute( const TOOL_EVENT& aEvent );
|
|
|
|
|
2024-02-21 11:35:09 -05:00
|
|
|
int ShowDesignBlockLibTable( const TOOL_EVENT& aEvent );
|
2021-11-26 10:52:38 +01:00
|
|
|
int ShowPluginManager( const TOOL_EVENT& aEvent );
|
|
|
|
|
2021-01-27 17:15:38 -05:00
|
|
|
///< Set up handlers for various events.
|
2019-06-09 14:12:44 +01:00
|
|
|
void setTransitions() override;
|
|
|
|
|
|
|
|
private:
|
2021-01-27 17:15:38 -05:00
|
|
|
///< Pointer to the currently used edit/draw frame.
|
2019-06-09 14:12:44 +01:00
|
|
|
KICAD_MANAGER_FRAME* m_frame;
|
2020-06-04 16:47:49 -07:00
|
|
|
|
|
|
|
// Mutex to allow only a single KiFace to load at one time (released when loaded)
|
|
|
|
std::mutex m_loading;
|
2021-07-25 21:58:44 -04:00
|
|
|
|
|
|
|
int openProject( const wxString& aDefaultDir );
|
2023-09-14 14:39:42 -07:00
|
|
|
|
2024-01-19 23:52:37 +00:00
|
|
|
wxFileName newProjectDirectory( wxString* aFileName = nullptr, bool isRepo = false );
|
2019-06-09 14:12:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|