-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditToolsCmd.cpp
39 lines (31 loc) · 884 Bytes
/
EditToolsCmd.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
////////////////////////////////////////////////////////////////////////////////
//! \file EditToolsCmd.cpp
//! \brief The EditToolsCmd class definition.
//! \author Chris Oldwood
#include "Common.hpp"
#include "EditToolsCmd.hpp"
#include "ToolsDialog.hpp"
#include "AppWnd.hpp"
////////////////////////////////////////////////////////////////////////////////
//! Constructor.
EditToolsCmd::EditToolsCmd(AppWnd& appWnd, Tools& tools)
: WCL::UiCommandBase(ID_TOOLS_HOSTTOOLS)
, m_appWnd(appWnd)
, m_tools(tools)
{
}
////////////////////////////////////////////////////////////////////////////////
//! Execute the command.
void EditToolsCmd::execute()
{
ToolsDialog dialog;
dialog.m_tools.deepCopy(m_tools);
if (dialog.RunModal(m_appWnd) == IDOK)
{
if (dialog.m_tools.isModified())
{
m_tools.replaceAll(dialog.m_tools);
m_appWnd.rebuildToolsMenu();
}
}
}