KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_autosave_recovery.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <utility>
23#include <vector>
24
25#include <wx/listctrl.h>
26#include <wx/string.h>
27
29
30
38
39
41{
42public:
43 DIALOG_AUTOSAVE_RECOVERY( wxWindow* aParent, const std::vector<std::pair<wxString, wxString>>& aStale );
44
46
47 // Subset of the input stale list that the user kept checked.
48 std::vector<std::pair<wxString, wxString>> GetSelectedStale() const;
49
50protected:
51 void OnRestore( wxCommandEvent& aEvent ) override;
52 void OnKeepCurrent( wxCommandEvent& aEvent ) override;
53 void OnKeepBoth( wxCommandEvent& aEvent ) override;
54 void OnCancel( wxCommandEvent& aEvent ) override;
55
56 void onItemCheckChanged( wxListEvent& aEvent );
58
59private:
61 std::vector<std::pair<wxString, wxString>> m_stale;
62};
DIALOG_AUTOSAVE_RECOVERY_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Auto-Save Recovery"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(600, 400), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void onItemCheckChanged(wxListEvent &aEvent)
DIALOG_AUTOSAVE_RECOVERY(wxWindow *aParent, const std::vector< std::pair< wxString, wxString > > &aStale)
void OnCancel(wxCommandEvent &aEvent) override
std::vector< std::pair< wxString, wxString > > m_stale
std::vector< std::pair< wxString, wxString > > GetSelectedStale() const
void OnKeepBoth(wxCommandEvent &aEvent) override
AUTOSAVE_RECOVERY_CHOICE m_choice
void OnKeepCurrent(wxCommandEvent &aEvent) override
AUTOSAVE_RECOVERY_CHOICE GetChoice() const
void OnRestore(wxCommandEvent &aEvent) override