-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditQueriesCmd.cpp
40 lines (32 loc) · 946 Bytes
/
EditQueriesCmd.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
40
////////////////////////////////////////////////////////////////////////////////
//! \file EditQueriesCmd.cpp
//! \brief The EditQueriesCmd class definition.
//! \author Chris Oldwood
#include "Common.hpp"
#include "EditQueriesCmd.hpp"
#include "QueriesDialog.hpp"
#include "AppWnd.hpp"
////////////////////////////////////////////////////////////////////////////////
//! Constructor.
EditQueriesCmd::EditQueriesCmd(AppWnd& appWnd, AppDlg& appDlg, Queries& queries)
: WCL::UiCommandBase(ID_VIEW_QUERIES)
, m_appWnd(appWnd)
, m_appDlg(appDlg)
, m_queries(queries)
{
}
////////////////////////////////////////////////////////////////////////////////
//! Execute the command.
void EditQueriesCmd::execute()
{
QueriesDialog dialog;
dialog.m_queries.deepCopy(m_queries);
if (dialog.RunModal(m_appWnd) == IDOK)
{
if (dialog.m_queries.isModified())
{
m_queries.replaceAll(dialog.m_queries);
m_appDlg.rebuildView();
}
}
}