KiCad PCB EDA Suite
PANEL_DATA_COLLECTION Class Reference

#include <panel_data_collection.h>

Inheritance diagram for PANEL_DATA_COLLECTION:
PANEL_DATA_COLLECTION_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_DATA_COLLECTION (PAGED_DIALOG *aDialog, wxWindow *aParent)
 
void ResetPanel () override
 Reset the contents of this panel. More...
 
virtual wxString GetResetTooltip () const
 Get the tooltip the reset button should display when showing this panel. More...
 
wxString GetHelpTextAtPoint (const wxPoint &aPt, wxHelpEvent::Origin aOrigin) const override
 Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }. More...
 

Protected Member Functions

bool TransferDataFromWindow () override
 
bool TransferDataToWindow () override
 
virtual void OnResetIdClick (wxCommandEvent &aEvent) override
 

Protected Attributes

PAGED_DIALOGm_dialog
 
wxStaticText * m_stExplanation
 
wxCheckBox * m_cbOptIn
 
wxTextCtrl * m_sentryUid
 
wxButton * m_buttonResetId
 

Private Member Functions

void applySettingsToPanel ()
 

Detailed Description

Definition at line 34 of file panel_data_collection.h.

Constructor & Destructor Documentation

◆ PANEL_DATA_COLLECTION()

PANEL_DATA_COLLECTION::PANEL_DATA_COLLECTION ( PAGED_DIALOG aDialog,
wxWindow *  aParent 
)

Definition at line 40 of file panel_data_collection.cpp.

40 :
41 PANEL_DATA_COLLECTION_BASE( aParent ), m_dialog( aDialog )
42{
43}
PANEL_DATA_COLLECTION_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)

Member Function Documentation

◆ applySettingsToPanel()

void PANEL_DATA_COLLECTION::applySettingsToPanel ( )
private

Definition at line 77 of file panel_data_collection.cpp.

78{
79 m_cbOptIn->SetValue( Pgm().IsSentryOptedIn() );
80}
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References PANEL_DATA_COLLECTION_BASE::m_cbOptIn, and Pgm().

Referenced by ResetPanel(), and TransferDataToWindow().

◆ GetHelpTextAtPoint()

wxString RESETTABLE_PANEL::GetHelpTextAtPoint ( const wxPoint &  aPt,
wxHelpEvent::Origin  aOrigin 
) const
inlineoverrideinherited

Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.

Definition at line 72 of file resettable_panel.h.

73 {
74 if( aPt == wxPoint( -INT_MAX, INT_MAX ) )
75 return GetResetTooltip();
76 else
77 return wxPanel::GetHelpTextAtPoint( aPt, aOrigin );
78 }
virtual wxString GetResetTooltip() const
Get the tooltip the reset button should display when showing this panel.

References RESETTABLE_PANEL::GetResetTooltip().

◆ GetResetTooltip()

virtual wxString RESETTABLE_PANEL::GetResetTooltip ( ) const
inlinevirtualinherited

Get the tooltip the reset button should display when showing this panel.

Returns
the tooltip

Reimplemented in PANEL_COLOR_SETTINGS, and PANEL_HOTKEYS_EDITOR.

Definition at line 64 of file resettable_panel.h.

65 {
66 return _( "Reset all settings on this page to their default" );
67 }
#define _(s)

References _.

Referenced by RESETTABLE_PANEL::GetHelpTextAtPoint().

◆ OnResetIdClick()

void PANEL_DATA_COLLECTION::OnResetIdClick ( wxCommandEvent &  aEvent)
overrideprotectedvirtual

Reimplemented from PANEL_DATA_COLLECTION_BASE.

Definition at line 83 of file panel_data_collection.cpp.

84{
85 Pgm().ResetSentryId();
86 m_sentryUid->SetValue( Pgm().GetSentryId() );
87}

References PANEL_DATA_COLLECTION_BASE::m_sentryUid, and Pgm().

◆ ResetPanel()

void PANEL_DATA_COLLECTION::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 71 of file panel_data_collection.cpp.

References applySettingsToPanel().

◆ TransferDataFromWindow()

bool PANEL_DATA_COLLECTION::TransferDataFromWindow ( )
overrideprotected

Definition at line 63 of file panel_data_collection.cpp.

64{
65 Pgm().SetSentryOptIn( m_cbOptIn->GetValue() );
66
67 return true;
68}

References PANEL_DATA_COLLECTION_BASE::m_cbOptIn, and Pgm().

◆ TransferDataToWindow()

bool PANEL_DATA_COLLECTION::TransferDataToWindow ( )
overrideprotected

Definition at line 46 of file panel_data_collection.cpp.

47{
49
50 KIPLATFORM::POLICY::STATE policyState =
53 {
54 Disable();
55 }
56
57 m_sentryUid->SetValue( Pgm().GetSentryId() );
58
59 return true;
60}
STATE GetPolicyState(const wxString &aKey)
Definition: gtk/policy.cpp:25
void Disable(wxWindow *aWindow)
Makes a window read-only.
Definition: ui_common.cpp:309
#define POLICY_KEY_DATACOLLECTION
Definition: policy_keys.h:28

References applySettingsToPanel(), KIUI::Disable(), KIPLATFORM::POLICY::GetPolicyState(), PANEL_DATA_COLLECTION_BASE::m_sentryUid, KIPLATFORM::POLICY::NOT_CONFIGURED, Pgm(), and POLICY_KEY_DATACOLLECTION.

Member Data Documentation

◆ m_buttonResetId

wxButton* PANEL_DATA_COLLECTION_BASE::m_buttonResetId
protectedinherited

◆ m_cbOptIn

wxCheckBox* PANEL_DATA_COLLECTION_BASE::m_cbOptIn
protectedinherited

◆ m_dialog

PAGED_DIALOG* PANEL_DATA_COLLECTION::m_dialog
protected

Definition at line 51 of file panel_data_collection.h.

◆ m_sentryUid

wxTextCtrl* PANEL_DATA_COLLECTION_BASE::m_sentryUid
protectedinherited

◆ m_stExplanation

wxStaticText* PANEL_DATA_COLLECTION_BASE::m_stExplanation
protectedinherited

The documentation for this class was generated from the following files: