4
#include <wx/notebook.h>
6
#define CONFIG_NAME "AppArmorProfileEditor"
7
#define DEFAULT_COMMENT_COLOUR_R 31
8
#define DEFAULT_COMMENT_COLOUR_G 31
9
#define DEFAULT_COMMENT_COLOUR_B 210
10
#define DEFAULT_INCLUDE_COLOUR_R 56
11
#define DEFAULT_INCLUDE_COLOUR_G 136
12
#define DEFAULT_INCLUDE_COLOUR_B 31
13
#define DEFAULT_CAP_COLOUR_R 229
14
#define DEFAULT_CAP_COLOUR_G 33
15
#define DEFAULT_CAP_COLOUR_B 204
16
#define DEFAULT_PATH_COLOUR_R 1
17
#define DEFAULT_PATH_COLOUR_G 1
18
#define DEFAULT_PATH_COLOUR_B 1
19
#define DEFAULT_PERM_COLOUR_R 160
20
#define DEFAULT_PERM_COLOUR_G 32
21
#define DEFAULT_PERM_COLOUR_B 240
25
ID_COMMENT_COLOUR_BUTTON,
26
ID_PERMS_COLOUR_BUTTON,
27
ID_INCLUDES_COLOUR_BUTTON,
28
ID_CAPABILITIES_COLOUR_BUTTON,
29
ID_PATHS_COLOUR_BUTTON,
30
ID_COMMENT_FONT_BUTTON,
32
ID_INCLUDES_FONT_BUTTON,
33
ID_CAPABILITIES_FONT_BUTTON,
35
ID_PREFERENCES_NOTEBOOK,
39
* The preferences dialog
41
class PreferencesDialog: public wxDialog
43
DECLARE_DYNAMIC_CLASS( PreferencesDialog )
49
PreferencesDialog(wxWindow* parent,
51
const wxString& caption = _("Preferences"),
52
const wxPoint& pos = wxDefaultPosition,
53
const wxSize& size = wxSize(400, 300),
54
long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX);
55
bool Create(wxWindow* parent,
57
const wxString& caption = _("Preferences"),
58
const wxPoint& pos = wxDefaultPosition,
59
const wxSize& size = wxSize(400, 300),
60
long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX );
61
void CreateControls();
62
wxString BestGuessProfileDirectory ();
63
wxString BestGuessParserCommand ();
66
void OnColourButton(wxCommandEvent &event);
67
void OnFontButton (wxCommandEvent &event);
69
// Various accessor functions so we can save the data
70
wxColour GetCommentButtonColour(void) { return mpCommentsButton->GetBackgroundColour(); }
71
wxColour GetIncludeButtonColour(void) { return mpIncludesButton->GetBackgroundColour(); }
72
wxColour GetCapabilityButtonColour(void) { return mpCapabilitiesButton->GetBackgroundColour(); }
73
wxColour GetPathButtonColour(void) { return mpPathsButton->GetBackgroundColour(); }
74
wxColour GetPermButtonColour(void) { return mpPermsButton->GetBackgroundColour(); }
75
wxFont GetCommentButtonFont(void) { return mpCommentsFontButton->GetFont(); }
76
wxFont GetIncludeButtonFont(void) { return mpIncludesFontButton->GetFont(); }
77
wxFont GetPathButtonFont(void) { return mpPathsFontButton->GetFont(); }
78
wxFont GetCapabilityButtonFont(void) { return mpCapabilitiesFontButton->GetFont(); }
79
wxFont GetPermButtonFont(void) { return mpPermsFontButton->GetFont(); }
80
wxString GetProfileDir(void) { return mpProfileDir->GetValue(); }
81
wxString GetParser(void) { return mpParserCommand->GetValue(); }
82
wxString GetTemplateText(void) { return mpTemplateTextCtrl->GetText(); }
84
wxNotebook* mpPrefsNotebook;
85
wxTextCtrl* mpProfileDir;
86
wxTextCtrl* mpParserCommand;
87
ProfileTextCtrl* mpTemplateTextCtrl;
88
wxButton* mpCommentsButton;
89
wxButton* mpIncludesButton;
90
wxButton* mpPermsButton;
91
wxButton* mpCapabilitiesButton;
92
wxButton* mpPathsButton;
93
wxButton* mpCommentsFontButton;
94
wxButton* mpIncludesFontButton;
95
wxButton* mpCapabilitiesFontButton;
96
wxButton* mpPathsFontButton;
97
wxButton* mpPermsFontButton;