Skip to content

Commit

Permalink
- New: user will no longer need to reload default settings of the key…
Browse files Browse the repository at this point in the history
…board shortcuts in order to see new entries, CodeLite will merge them automatically

git-svn-id: https://codelite.svn.sourceforge.net/svnroot/codelite/trunk@2132 9da81c78-c036-0410-9e1f-a2b0375e4b5a
  • Loading branch information
eranif committed Sep 13, 2008
1 parent 82f9fcc commit d155ec7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
19 changes: 17 additions & 2 deletions LiteEditor/acceltabledlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,24 @@ AccelTableDlg::AccelTableDlg( wxWindow* parent )
m_listCtrl1->InsertColumn(2, wxT("Action"));
m_listCtrl1->InsertColumn(3, wxT("Accelerator"));

MenuItemDataMap accelMap;
MenuItemDataMap accelMap, defAccelMap;
ManagerST::Get()->GetAcceleratorMap(accelMap);


// load the default accelerator map
ManagerST::Get()->GetDefaultAcceleratorMap(defAccelMap);

// loop over default accelerators map, and search for items that does not exist in the user's list
std::map< wxString, MenuItemData >::iterator it = defAccelMap.begin();
for(; it != defAccelMap.end(); it++){
if(accelMap.find(it->first) == accelMap.end()){
// this item does not exist in the users accelerators
// probably a new accelerator that was added to the default
// files directly via update/manully modified it
accelMap[it->first] = it->second;
}
}


PopulateTable(accelMap);

// center the dialog
Expand Down
20 changes: 18 additions & 2 deletions LiteEditor/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2541,12 +2541,28 @@ void Manager::RunCustomPreMakeCommand(const wxString &project)

void Manager::UpdateMenuAccelerators()
{
MenuItemDataMap menuMap;
MenuItemDataMap menuMap, defAccelMap;

wxArrayString files;
DoGetAccelFiles(files);


// load user accelerators map
LoadAcceleratorTable(files, menuMap);

// load the default accelerator map
GetDefaultAcceleratorMap(defAccelMap);

// loop over default accelerators map, and search for items that does not exist in the user's list
std::map< wxString, MenuItemData >::iterator it = defAccelMap.begin();
for(; it != defAccelMap.end(); it++){
if(menuMap.find(it->first) == menuMap.end()){
// this item does not exist in the users accelerators
// probably a new accelerator that was added to the default
// files directly via update/manully modified it
menuMap[it->first] = it->second;
}
}

wxMenuBar *bar = Frame::Get()->GetMenuBar();

wxString content;
Expand Down

0 comments on commit d155ec7

Please sign in to comment.