Skip to content

Commit

Permalink
#452 Fix external command saving into settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
cbucher committed Sep 27, 2017
1 parent 4bdf27a commit 2e80153
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Console/SettingsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,7 @@ bool HotKeys::Save(const CComPtr<IXMLDOMElement>& pSettingsRoot)
if( i->empty() ) continue;

CComPtr<IXMLDOMElement> pNewExternalCommandElement;
if( FAILED(XmlHelper::CreateDomElement(pSettingsRoot, CComBSTR(L"external_command"), pNewExternalCommandElement)) ) return false;
if( FAILED(XmlHelper::CreateDomElement(pExternalCommandsElement, CComBSTR(L"external_command"), pNewExternalCommandElement)) ) return false;

XmlHelper::SetAttribute(pNewExternalCommandElement, CComBSTR(L"id"), static_cast<int>(i - externalCommands.begin() + 1));
XmlHelper::SetAttribute(pNewExternalCommandElement, CComBSTR(L"value"), *i);
Expand Down
2 changes: 1 addition & 1 deletion Console/SettingsHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ struct HotKeys : public SettingsBase

Commands commands;

std::array<std::wstring, ID_EXTERNAL_COMMAND_1> externalCommands;
std::array<std::wstring, EXTERNAL_COMMANDS_COUNT> externalCommands;

bool bUseScrollLock;
};
Expand Down
19 changes: 12 additions & 7 deletions Console/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@ using namespace boost::multi_index;
#include "../shared/Win32Exception.h"
#include "../shared/Cpp11Helpers.h"
#include "../shared/NamedPipe.h"

//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
#define EXTERNAL_COMMANDS_COUNT 10
#define SEARCH_MRU_COUNT 10

//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
#include "Helpers.h"
#include "XmlHelper.h"
#include "ImageHandler.h"
Expand Down Expand Up @@ -242,13 +254,6 @@ using namespace boost::multi_index;
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
#define EXTERNAL_COMMANDS_COUNT 10
#define SEARCH_MRU_COUNT 10

//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
// pseudo SCROLL constant
#define SB_WHEEL 99
Expand Down

0 comments on commit 2e80153

Please sign in to comment.