KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_autosave_recovery_base.cpp
Go to the documentation of this file.
1
2// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
3// http://www.wxformbuilder.org/
4//
5// PLEASE DO *NOT* EDIT THIS FILE!
7
9
11
12DIALOG_AUTOSAVE_RECOVERY_BASE::DIALOG_AUTOSAVE_RECOVERY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
13{
14 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
15
16 bMainSizer = new wxBoxSizer( wxVERTICAL );
17
18 m_explanation = new wxStaticText( this, wxID_ANY, _("KiCad found auto-saved changes from a previous session. This usually means KiCad closed unexpectedly while you had unsaved work."), wxDefaultPosition, wxDefaultSize, 0 );
19 m_explanation->Wrap( 560 );
20 bMainSizer->Add( m_explanation, 0, wxALL|wxEXPAND, 10 );
21
22 m_fileList = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES );
23 bMainSizer->Add( m_fileList, 1, wxALL|wxEXPAND, 10 );
24
25 wxBoxSizer* bButtonSizer;
26 bButtonSizer = new wxBoxSizer( wxHORIZONTAL );
27
28 m_btnRestore = new wxButton( this, wxID_ANY, _("Restore auto-saved"), wxDefaultPosition, wxDefaultSize, 0 );
29 m_btnRestore->SetToolTip( _("Replaces your saved file with the auto-saved version. The previous saved content is discarded.") );
30
31 bButtonSizer->Add( m_btnRestore, 0, wxALL, 5 );
32
33 m_btnKeepCurrent = new wxButton( this, wxID_ANY, _("Keep current"), wxDefaultPosition, wxDefaultSize, 0 );
34 m_btnKeepCurrent->SetToolTip( _("Keeps your saved file as-is and discards the auto-saved changes.") );
35
36 bButtonSizer->Add( m_btnKeepCurrent, 0, wxALL, 5 );
37
38 m_btnKeepBoth = new wxButton( this, wxID_ANY, _("Keep both"), wxDefaultPosition, wxDefaultSize, 0 );
39 m_btnKeepBoth->SetToolTip( _("Keeps your saved file and writes the auto-saved version alongside it as a separate timestamped file you can review later.") );
40
41 bButtonSizer->Add( m_btnKeepBoth, 0, wxALL, 5 );
42
43
44 bButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 );
45
46 m_btnCancel = new wxButton( this, wxID_CANCEL, _("Cancel open"), wxDefaultPosition, wxDefaultSize, 0 );
47
48 m_btnCancel->SetDefault();
49 m_btnCancel->SetToolTip( _("Closes this dialog without making any changes. The auto-saved files stay on disk and will be offered again next time you open the project.") );
50
51 bButtonSizer->Add( m_btnCancel, 0, wxALL, 5 );
52
53
54 bMainSizer->Add( bButtonSizer, 0, wxALL|wxEXPAND, 10 );
55
56
57 this->SetSizer( bMainSizer );
58 this->Layout();
59
60 this->Centre( wxBOTH );
61
62 // Connect Events
63 m_btnRestore->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_AUTOSAVE_RECOVERY_BASE::OnRestore ), NULL, this );
64 m_btnKeepCurrent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_AUTOSAVE_RECOVERY_BASE::OnKeepCurrent ), NULL, this );
65 m_btnKeepBoth->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_AUTOSAVE_RECOVERY_BASE::OnKeepBoth ), NULL, this );
66 m_btnCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_AUTOSAVE_RECOVERY_BASE::OnCancel ), NULL, this );
67}
68
70{
71 // Disconnect Events
72 m_btnRestore->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_AUTOSAVE_RECOVERY_BASE::OnRestore ), NULL, this );
73 m_btnKeepCurrent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_AUTOSAVE_RECOVERY_BASE::OnKeepCurrent ), NULL, this );
74 m_btnKeepBoth->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_AUTOSAVE_RECOVERY_BASE::OnKeepBoth ), NULL, this );
75 m_btnCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_AUTOSAVE_RECOVERY_BASE::OnCancel ), NULL, this );
76
77}
virtual void OnCancel(wxCommandEvent &event)
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)
virtual void OnKeepBoth(wxCommandEvent &event)
virtual void OnKeepCurrent(wxCommandEvent &event)
virtual void OnRestore(wxCommandEvent &event)
#define _(s)