Browse Source

Mark modified hotkeys in the hotkey editor

THis uses a simple " *" suffix, as the wxTreeListCtrl-derivative
widget doesn't allow easy access to things like font style.
pull/13/head
John Beard 7 years ago
committed by Wayne Stambaugh
parent
commit
3283bd9fdc
  1. 11
      common/widgets/widget_hotkey_list.cpp
  2. 9
      include/hotkey_store.h

11
common/widgets/widget_hotkey_list.cpp

@ -308,10 +308,17 @@ void WIDGET_HOTKEY_LIST::UpdateFromClientData()
if( hkdata )
{
const EDA_HOTKEY& hk = hkdata->GetChangedHotkey().GetCurrentValue();
const auto& changed_hk = hkdata->GetChangedHotkey();
const EDA_HOTKEY& hk = changed_hk.GetCurrentValue();
wxString key_text = KeyNameFromKeyCode( hk.m_KeyCode );
// mark unsaved changes
if( changed_hk.HasUnsavedChange() )
key_text += " *";
SetItemText( i, 0, wxGetTranslation( hk.m_InfoMsg ) );
SetItemText( i, 1, KeyNameFromKeyCode( hk.m_KeyCode ) );
SetItemText( i, 1, key_text);
}
}
}

9
include/hotkey_store.h

@ -71,6 +71,15 @@ public:
m_orig = m_changed;
}
/**
* @brief Return true if the hotkey doesn't match the original (i.e. it
* has been changed)
*/
bool HasUnsavedChange() const
{
return m_orig.m_KeyCode != m_changed.m_KeyCode;
}
const wxString& GetSectionTag() const
{
return m_tag;

Loading…
Cancel
Save