/
MergeControlDialog.h
70 lines (56 loc) · 1.94 KB
/
MergeControlDialog.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include "iselection.h"
#include "imap.h"
#include "icommandsystem.h"
#include <sigc++/connection.h>
#include "wxutil/window/TransientWindow.h"
#include "wxutil/XmlResourceBasedWidget.h"
namespace ui
{
class MergeControlDialog :
public wxutil::TransientWindow,
private wxutil::XmlResourceBasedWidget,
public SelectionSystem::Observer,
public sigc::trackable
{
private:
sigc::connection _undoHandler;
sigc::connection _redoHandler;
sigc::connection _mapEventHandler;
sigc::connection _mapEditModeHandler;
bool _updateNeeded;
public:
MergeControlDialog();
static MergeControlDialog& Instance();
// The command target
static void ShowDialog(const cmd::ArgumentList& args);
/** greebo: SelectionSystem::Observer implementation. Gets called by
* the SelectionSystem upon selection change to allow updating of the
* patch property widgets.
*/
void selectionChanged(const scene::INodePtr& node, bool isComponent) override;
protected:
void _preShow() override;
void _preHide() override;
private:
void onMainFrameShuttingDown();
static std::shared_ptr<MergeControlDialog>& InstancePtr();
void convertTextCtrlToPathEntry(const std::string& ctrlName);
void onMergeSourceChanged(wxCommandEvent& ev);
void onLoadAndCompare(wxCommandEvent& ev);
void onFinishMerge(wxCommandEvent& ev);
void onAbortMerge(wxCommandEvent& ev);
void onRejectSelection(wxCommandEvent& ev);
void onResolveAccept(wxCommandEvent& ev);
void onResolveReject(wxCommandEvent& ev);
void updateControlSensitivity();
void queueUpdate();
void onIdle(wxIdleEvent& ev);
void onMapEvent(IMap::MapEvent ev);
void onMapEditModeChanged(IMap::EditMode newMode);
void updateSummary();
std::size_t getNumSelectedMergeNodes();
std::vector<scene::INodePtr> getSelectedMergeNodes();
std::shared_ptr<scene::IMergeActionNode> getSingleSelectedConflictNode();
};
}