KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_manager_control.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) 2019 CERN
5 * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef KICAD_MANAGER_CONTROL_H
26#define KICAD_MANAGER_CONTROL_H
27
29#include <mutex>
30
31
33
34
39{
40public:
43
45 void Reset( RESET_REASON aReason ) override;
46
47 int NewProject( const TOOL_EVENT& aEvent );
48 int NewFromTemplate( const TOOL_EVENT& aEvent );
49 int NewFromRepository( const TOOL_EVENT& aEvent );
50 int OpenProject( const TOOL_EVENT& aEvent );
51 int OpenDemoProject( const TOOL_EVENT& aEvent );
52 int CloseProject( const TOOL_EVENT& aEvent );
53 int SaveProjectAs( const TOOL_EVENT& aEvent );
54 int LoadProject( const TOOL_EVENT& aEvent );
55
60 int ViewDroppedViewers( const TOOL_EVENT& aEvent );
61
62 int Refresh( const TOOL_EVENT& aEvent );
63 int UpdateMenu( const TOOL_EVENT& aEvent );
64
65 int ShowPlayer( const TOOL_EVENT& aEvent );
66 int Execute( const TOOL_EVENT& aEvent );
67
68 int ShowPluginManager( const TOOL_EVENT& aEvent );
69
71 void setTransitions() override;
72
73private:
76
77 // Mutex to allow only a single KiFace to load at one time (released when loaded)
78 std::mutex m_loading;
79
80 int openProject( const wxString& aDefaultDir );
81
82 wxFileName newProjectDirectory( wxString* aFileName = nullptr, bool isRepo = false );
83};
84
85#endif
Handle actions in the kicad manager frame.
int OpenProject(const TOOL_EVENT &aEvent)
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
int OpenDemoProject(const TOOL_EVENT &aEvent)
int CloseProject(const TOOL_EVENT &aEvent)
int SaveProjectAs(const TOOL_EVENT &aEvent)
int NewProject(const TOOL_EVENT &aEvent)
int ViewDroppedViewers(const TOOL_EVENT &aEvent)
Imports a non kicad project from a sch/pcb dropped file.
int NewFromTemplate(const TOOL_EVENT &aEvent)
int ShowPluginManager(const TOOL_EVENT &aEvent)
Set up handlers for various events.
int UpdateMenu(const TOOL_EVENT &aEvent)
wxFileName newProjectDirectory(wxString *aFileName=nullptr, bool isRepo=false)
int NewFromRepository(const TOOL_EVENT &aEvent)
int LoadProject(const TOOL_EVENT &aEvent)
KICAD_MANAGER_FRAME * m_frame
< Pointer to the currently used edit/draw frame.
int ShowPlayer(const TOOL_EVENT &aEvent)
int openProject(const wxString &aDefaultDir)
int Execute(const TOOL_EVENT &aEvent)
The main KiCad project manager frame.
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
Generic, UI-independent tool event.
Definition: tool_event.h:167
void Reset() override
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...