KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_data_collection.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 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 2
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, you may find one here:
18
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19
* or you may search the http://www.gnu.org website for the version 2 license,
20
* or you may write to the Free Software Foundation, Inc.,
21
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22
*/
23
24
#include <
dialogs/panel_data_collection.h
>
25
26
#include <
advanced_config.h
>
27
#include <
app_monitor.h
>
28
#include <
bitmaps.h
>
29
#include <
dialog_shim.h
>
30
#include <
kiface_base.h
>
31
#include <
kiplatform/policy.h
>
32
#include <
kiplatform/ui.h
>
33
#include <
policy_keys.h
>
34
#include <
id.h
>
35
#include <
settings/common_settings.h
>
36
#include <
settings/settings_manager.h
>
37
38
39
PANEL_DATA_COLLECTION::PANEL_DATA_COLLECTION
( wxWindow* aParent ) :
40
PANEL_DATA_COLLECTION_BASE
( aParent )
41
{
42
}
43
44
45
bool
PANEL_DATA_COLLECTION::TransferDataToWindow
()
46
{
47
applySettingsToPanel
();
48
49
KIPLATFORM::POLICY::PBOOL
policyState =
50
KIPLATFORM::POLICY::GetPolicyBool
(
POLICY_KEY_DATACOLLECTION
);
51
52
if
( policyState !=
KIPLATFORM::POLICY::PBOOL::NOT_CONFIGURED
)
53
{
54
Disable();
55
}
56
57
m_sentryUid
->SetValue(
APP_MONITOR::SENTRY::Instance
()->GetSentryId() );
58
59
return
true
;
60
}
61
62
63
bool
PANEL_DATA_COLLECTION::TransferDataFromWindow
()
64
{
65
APP_MONITOR::SENTRY::Instance
()->
SetSentryOptIn
(
m_cbOptIn
->GetValue() );
66
67
return
true
;
68
}
69
70
71
void
PANEL_DATA_COLLECTION::ResetPanel
()
72
{
73
applySettingsToPanel
();
74
}
75
76
77
void
PANEL_DATA_COLLECTION::applySettingsToPanel
()
78
{
79
m_cbOptIn
->SetValue(
APP_MONITOR::SENTRY::Instance
()->IsOptedIn() );
80
}
81
82
83
void
PANEL_DATA_COLLECTION::OnResetIdClick
( wxCommandEvent& aEvent )
84
{
85
APP_MONITOR::SENTRY::Instance
()->
ResetSentryId
();
86
m_sentryUid
->SetValue(
APP_MONITOR::SENTRY::Instance
()->GetSentryId() );
87
}
advanced_config.h
app_monitor.h
bitmaps.h
APP_MONITOR::SENTRY::SetSentryOptIn
void SetSentryOptIn(bool aOptIn)
Definition:
app_monitor.cpp:73
APP_MONITOR::SENTRY::Instance
static SENTRY * Instance()
Definition:
app_monitor.h:112
APP_MONITOR::SENTRY::ResetSentryId
void ResetSentryId()
Definition:
app_monitor.cpp:120
PANEL_DATA_COLLECTION_BASE
Class PANEL_DATA_COLLECTION_BASE.
Definition:
panel_data_collection_base.h:35
PANEL_DATA_COLLECTION_BASE::m_sentryUid
wxTextCtrl * m_sentryUid
Definition:
panel_data_collection_base.h:41
PANEL_DATA_COLLECTION_BASE::m_cbOptIn
wxCheckBox * m_cbOptIn
Definition:
panel_data_collection_base.h:40
PANEL_DATA_COLLECTION::TransferDataToWindow
bool TransferDataToWindow() override
Definition:
panel_data_collection.cpp:45
PANEL_DATA_COLLECTION::applySettingsToPanel
void applySettingsToPanel()
Definition:
panel_data_collection.cpp:77
PANEL_DATA_COLLECTION::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition:
panel_data_collection.cpp:63
PANEL_DATA_COLLECTION::OnResetIdClick
virtual void OnResetIdClick(wxCommandEvent &aEvent) override
Definition:
panel_data_collection.cpp:83
PANEL_DATA_COLLECTION::PANEL_DATA_COLLECTION
PANEL_DATA_COLLECTION(wxWindow *aParent)
Definition:
panel_data_collection.cpp:39
PANEL_DATA_COLLECTION::ResetPanel
void ResetPanel() override
Reset the contents of this panel.
Definition:
panel_data_collection.cpp:71
common_settings.h
dialog_shim.h
id.h
kiface_base.h
KIPLATFORM::POLICY::PBOOL
PBOOL
Definition:
policy.h:34
KIPLATFORM::POLICY::PBOOL::NOT_CONFIGURED
@ NOT_CONFIGURED
KIPLATFORM::POLICY::GetPolicyBool
PBOOL GetPolicyBool(const wxString &aKey)
Definition:
unix/policy.cpp:26
panel_data_collection.h
policy.h
policy_keys.h
POLICY_KEY_DATACOLLECTION
#define POLICY_KEY_DATACOLLECTION
Definition:
policy_keys.h:30
settings_manager.h
ui.h
src
common
dialogs
panel_data_collection.cpp
Generated on Tue Aug 12 2025 00:06:44 for KiCad PCB EDA Suite by
1.9.6