KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_update_notice.cpp
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) 2023 Mark Roszko <[email protected]>
5 * Copyright (C) 2023 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
26#include <build_version.h>
29#include <pgm_base.h>
30
31DIALOG_UPDATE_NOTICE::DIALOG_UPDATE_NOTICE( wxWindow* aWindow, const wxString& aNewVersion,
32 const wxString& aDetailsUrl,
33 const wxString& aDownloadsUrl ) :
35 m_detailsUrl( aDetailsUrl ),
36 m_downloadsUrl( aDownloadsUrl )
37{
38 wxString msg = wxString::Format( _( "KiCad %s is now available (you have %s). Would you like to download it now?" ), aNewVersion, GetMajorMinorPatchVersion() );
39 m_messageLine2->SetLabelText( msg );
40
41 Fit();
42 Layout();
43}
44
45
47{
48 EndModal( wxID_NO );
49}
50
51
52void DIALOG_UPDATE_NOTICE::OnBtnRemindMeClicked( wxCommandEvent& aEvent )
53{
54 EndModal( wxID_RETRY );
55}
56
57
59{
60 wxLaunchDefaultBrowser( m_detailsUrl, wxBROWSER_NEW_WINDOW );
61}
62
63
65{
66 wxLaunchDefaultBrowser( m_downloadsUrl, wxBROWSER_NEW_WINDOW );
67 EndModal( wxID_YES );
68}
wxString GetMajorMinorPatchVersion()
Get the major, minor and patch version in a string major.minor.patch This is extracted by CMake from ...
Class DIALOG_UPDATE_NOTICE_BASE.
virtual void OnBtnDownloadsPageClicked(wxCommandEvent &aEvent) override
DIALOG_UPDATE_NOTICE(wxWindow *aWindow, const wxString &aNewVersion, const wxString &aDetailsUrl, const wxString &aDownloadsUrl)
virtual void OnBtnRemindMeClicked(wxCommandEvent &aEvent) override
virtual void OnBtnDetailsPageClicked(wxCommandEvent &aEvent) override
virtual void OnSkipThisVersionClicked(wxCommandEvent &aEvent) override
#define _(s)
see class PGM_BASE