2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

Added "Search for this phrase" context menu, fixed node expansion bug,

fixed problem with right clicking clearing a selection
This commit is contained in:
Matt Barringer
2006-05-10 01:45:49 +00:00
parent 4b5f1ba83f
commit b67104703e
7 changed files with 100 additions and 79 deletions

View File

@@ -33,22 +33,22 @@
{
'AM_ENABLE_STATIC' => 1,
'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
'AC_TYPE_OFF_T' => 1,
'AC_C_VOLATILE' => 1,
'AC_FUNC_CLOSEDIR_VOID' => 1,
'AC_TYPE_OFF_T' => 1,
'_LT_AC_SHELL_INIT' => 1,
'AC_FUNC_CLOSEDIR_VOID' => 1,
'AC_REPLACE_FNMATCH' => 1,
'AC_DEFUN' => 1,
'_LT_AC_LANG_CXX_CONFIG' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_FUNC_STAT' => 1,
'_LT_AC_LANG_CXX_CONFIG' => 1,
'AM_PROG_MKDIR_P' => 1,
'AC_FUNC_STAT' => 1,
'AC_FUNC_WAIT3' => 1,
'AC_STRUCT_TM' => 1,
'AC_FUNC_LSTAT' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_FUNC_STRTOD' => 1,
'AC_FUNC_LSTAT' => 1,
'AC_STRUCT_TM' => 1,
'AC_CHECK_HEADERS' => 1,
'AC_FUNC_STRTOD' => 1,
'AM_MISSING_PROG' => 1,
'AC_FUNC_STRNLEN' => 1,
'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
@@ -63,28 +63,28 @@
'AM_SANITY_CHECK' => 1,
'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
'_LT_AC_CHECK_DLFCN' => 1,
'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
'_LT_AC_CHECK_DLFCN' => 1,
'_AM_PROG_TAR' => 1,
'AC_LIBTOOL_GCJ' => 1,
'AC_PROG_GCC_TRADITIONAL' => 1,
'AC_LIBSOURCE' => 1,
'AC_STRUCT_ST_BLOCKS' => 1,
'AC_LIBTOOL_CONFIG' => 1,
'_LT_AC_LANG_F77' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AC_LIBTOOL_CONFIG' => 1,
'AC_PROG_MAKE_SET' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'AM_DISABLE_SHARED' => 1,
'AM_PROG_LIBTOOL' => 1,
'_LT_AC_LANG_CXX' => 1,
'AM_PROG_LD' => 1,
'AM_PROG_LIBTOOL' => 1,
'_LT_AC_FILE_LTDLL_C' => 1,
'AM_PROG_LD' => 1,
'AC_FUNC_STRERROR_R' => 1,
'AC_FUNC_FORK' => 1,
'AC_DECL_SYS_SIGLIST' => 1,
'AC_FUNC_VPRINTF' => 1,
'AC_FUNC_FORK' => 1,
'AU_DEFUN' => 1,
'AC_FUNC_VPRINTF' => 1,
'AC_PROG_NM' => 1,
'AC_LIBTOOL_DLOPEN' => 1,
'AC_PROG_LD' => 1,
@@ -97,9 +97,9 @@
'_AM_SET_OPTION' => 1,
'AC_CANONICAL_HOST' => 1,
'_LT_LINKER_BOILERPLATE' => 1,
'AC_PROG_RANLIB' => 1,
'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
'AC_LIBTOOL_PROG_CC_C_O' => 1,
'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
'AC_PROG_RANLIB' => 1,
'AC_FUNC_SETPGRP' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AC_FUNC_MMAP' => 1,
@@ -111,43 +111,43 @@
'AC_FUNC_UTIME_NULL' => 1,
'AC_FUNC_SELECT_ARGTYPES' => 1,
'_LT_AC_LANG_GCJ' => 1,
'AC_HEADER_STAT' => 1,
'AC_FUNC_STRFTIME' => 1,
'AC_HEADER_STAT' => 1,
'AC_C_INLINE' => 1,
'AC_LIBTOOL_RC' => 1,
'AC_DISABLE_FAST_INSTALL' => 1,
'_LT_AC_PROG_ECHO_BACKSLASH' => 1,
'AC_DISABLE_FAST_INSTALL' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'_LT_AC_SYS_LIBPATH_AIX' => 1,
'_LT_AC_TRY_DLOPEN_SELF' => 1,
'_LT_AC_SYS_LIBPATH_AIX' => 1,
'include' => 1,
'LT_AC_PROG_SED' => 1,
'AM_ENABLE_SHARED' => 1,
'AM_GNU_GETTEXT' => 1,
'_LT_AC_LANG_GCJ_CONFIG' => 1,
'AC_FUNC_OBSTACK' => 1,
'AC_CHECK_LIB' => 1,
'AC_ENABLE_SHARED' => 1,
'AC_CHECK_LIB' => 1,
'AC_FUNC_OBSTACK' => 1,
'AC_FUNC_MALLOC' => 1,
'AC_FUNC_GETGROUPS' => 1,
'AC_FUNC_GETLOADAVG' => 1,
'AC_FUNC_FSEEKO' => 1,
'AC_ENABLE_STATIC' => 1,
'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_ENABLE_STATIC' => 1,
'AC_FUNC_FSEEKO' => 1,
'_LT_AC_TAGVAR' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
'AC_FUNC_MKTIME' => 1,
'AM_CONDITIONAL' => 1,
'AC_FUNC_MKTIME' => 1,
'AC_HEADER_SYS_WAIT' => 1,
'AC_PROG_LN_S' => 1,
'AC_FUNC_MEMCMP' => 1,
'm4_include' => 1,
'AC_PROG_LN_S' => 1,
'AM_PROG_INSTALL_SH' => 1,
'AC_HEADER_DIRENT' => 1,
'm4_include' => 1,
'AC_PROG_EGREP' => 1,
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
'AC_HEADER_DIRENT' => 1,
'AC_PATH_MAGIC' => 1,
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
'AM_MAKE_INCLUDE' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
@@ -159,44 +159,44 @@
'AC_LIBTOOL_WIN32_DLL' => 1,
'AC_PROG_LD_RELOAD_FLAG' => 1,
'AC_HEADER_TIME' => 1,
'AC_TYPE_MODE_T' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AM_MISSING_HAS_RUN' => 1,
'm4_sinclude' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AC_TYPE_MODE_T' => 1,
'AC_LIBTOOL_DLOPEN_SELF' => 1,
'm4_sinclude' => 1,
'AC_PATH_X' => 1,
'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
'AC_HEADER_STDC' => 1,
'AC_LIBTOOL_LINKER_OPTION' => 1,
'AC_LIBTOOL_CXX' => 1,
'LT_AC_PROG_RC' => 1,
'AC_LIBTOOL_CXX' => 1,
'LT_AC_PROG_GCJ' => 1,
'AC_FUNC_ERROR_AT_LINE' => 1,
'AM_DEP_TRACK' => 1,
'_LT_AC_PROG_CXXCPP' => 1,
'AM_DISABLE_STATIC' => 1,
'AC_FUNC_MBRTOWC' => 1,
'_LT_AC_PROG_CXXCPP' => 1,
'AM_DEP_TRACK' => 1,
'_AC_PROG_LIBTOOL' => 1,
'AC_FUNC_MBRTOWC' => 1,
'AC_TYPE_SIGNAL' => 1,
'AC_TYPE_UID_T' => 1,
'_AM_IF_OPTION' => 1,
'AC_TYPE_UID_T' => 1,
'AC_PATH_TOOL_PREFIX' => 1,
'AC_LIBTOOL_F77' => 1,
'm4_pattern_allow' => 1,
'AC_LIBTOOL_F77' => 1,
'AM_SET_LEADING_DOT' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'_AM_DEPENDENCIES' => 1,
'AC_LIBTOOL_LANG_C_CONFIG' => 1,
'AC_PROG_CC' => 1,
'_LT_AC_SYS_COMPILER' => 1,
'AC_PROG_CC' => 1,
'AM_PROG_NM' => 1,
'AC_FUNC_STRCOLL' => 1,
'AC_PROG_YACC' => 1,
'AC_LIBLTDL_CONVENIENCE' => 1,
'AC_DEPLIBS_CHECK_METHOD' => 1,
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
'AC_LIBLTDL_INSTALLABLE' => 1,
'AC_FUNC_CHOWN' => 1,
'AC_LIBLTDL_INSTALLABLE' => 1,
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
'AC_FUNC_GETPGRP' => 1,
'AM_INIT_AUTOMAKE' => 1,
@@ -207,27 +207,27 @@
'_LT_AC_LOCK' => 1,
'_LT_AC_LANG_RC_CONFIG' => 1,
'AC_PROG_CPP' => 1,
'AC_TYPE_PID_T' => 1,
'AC_PROG_LEX' => 1,
'AC_C_CONST' => 1,
'AC_PROG_LEX' => 1,
'AC_TYPE_PID_T' => 1,
'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
'AC_FUNC_SETVBUF_REVERSED' => 1,
'AC_PROG_INSTALL' => 1,
'AM_AUX_DIR_EXPAND' => 1,
'AC_PROG_INSTALL' => 1,
'WXTEST' => 1,
'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
'_LT_AC_LANG_F77_CONFIG' => 1,
'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
'_AM_SET_OPTIONS' => 1,
'AM_RUN_LOG' => 1,
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'AM_RUN_LOG' => 1,
'AC_LIBTOOL_PICMODE' => 1,
'AH_OUTPUT' => 1,
'AC_CHECK_LIBM' => 1,
'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
'_AM_MANGLE_OPTION' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
'AC_CONFIG_HEADERS' => 1,
'AM_SET_DEPDIR' => 1,
'_LT_CC_BASENAME' => 1,
'AC_CHECK_FUNCS' => 1
@@ -249,21 +249,21 @@
'm4_pattern_forbid' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_C_VOLATILE' => 1,
'AC_TYPE_OFF_T' => 1,
'AC_C_VOLATILE' => 1,
'AC_FUNC_CLOSEDIR_VOID' => 1,
'AC_REPLACE_FNMATCH' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_FUNC_STAT' => 1,
'AC_FUNC_WAIT3' => 1,
'AC_HEADER_TIME' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_FUNC_LSTAT' => 1,
'AC_FUNC_WAIT3' => 1,
'AC_STRUCT_TM' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AC_FUNC_LSTAT' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_TYPE_MODE_T' => 1,
'AC_CHECK_HEADERS' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AC_FUNC_STRTOD' => 1,
'AC_CHECK_HEADERS' => 1,
'AC_FUNC_STRNLEN' => 1,
'm4_sinclude' => 1,
'AC_PROG_CXX' => 1,
@@ -278,20 +278,20 @@
'AC_LIBSOURCE' => 1,
'AC_FUNC_MBRTOWC' => 1,
'AC_STRUCT_ST_BLOCKS' => 1,
'AC_CANONICAL_BUILD' => 1,
'AC_TYPE_SIGNAL' => 1,
'AC_CANONICAL_BUILD' => 1,
'AC_TYPE_UID_T' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AC_PROG_MAKE_SET' => 1,
'm4_pattern_allow' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'm4_pattern_allow' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AC_FUNC_STRERROR_R' => 1,
'AC_PROG_CC' => 1,
'AC_DECL_SYS_SIGLIST' => 1,
'AC_FUNC_FORK' => 1,
'AC_FUNC_STRCOLL' => 1,
'AC_DECL_SYS_SIGLIST' => 1,
'AC_FUNC_VPRINTF' => 1,
'AC_FUNC_STRCOLL' => 1,
'AC_PROG_YACC' => 1,
'AC_LIBLTDL_CONVENIENCE' => 1,
'AC_STRUCT_TIMEZONE' => 1,
@@ -309,41 +309,41 @@
'AC_FUNC_MMAP' => 1,
'AC_FUNC_REALLOC' => 1,
'AC_TYPE_SIZE_T' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_CHECK_TYPES' => 1,
'AC_CONFIG_LINKS' => 1,
'LT_SUPPORTED_TAG' => 1,
'AC_CHECK_MEMBERS' => 1,
'AM_MAINTAINER_MODE' => 1,
'AC_FUNC_UTIME_NULL' => 1,
'AC_FUNC_SELECT_ARGTYPES' => 1,
'AC_FUNC_STRFTIME' => 1,
'AC_HEADER_STAT' => 1,
'AC_C_INLINE' => 1,
'AC_FUNC_STRFTIME' => 1,
'AC_PROG_CPP' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AC_C_CONST' => 1,
'AC_PROG_LEX' => 1,
'AC_C_INLINE' => 1,
'AC_TYPE_PID_T' => 1,
'AC_PROG_LEX' => 1,
'AC_C_CONST' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'AC_FUNC_SETVBUF_REVERSED' => 1,
'AC_PROG_INSTALL' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_FUNC_OBSTACK' => 1,
'AC_CHECK_LIB' => 1,
'AC_FUNC_OBSTACK' => 1,
'AC_FUNC_MALLOC' => 1,
'AC_FUNC_GETGROUPS' => 1,
'AC_FUNC_GETLOADAVG' => 1,
'AH_OUTPUT' => 1,
'AC_FUNC_FSEEKO' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_FUNC_MKTIME' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
'AC_FUNC_MKTIME' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_HEADER_SYS_WAIT' => 1,
'AC_FUNC_MEMCMP' => 1,
'AC_PROG_LN_S' => 1,
'AC_FUNC_MEMCMP' => 1,
'm4_include' => 1,
'AC_HEADER_DIRENT' => 1,
'AC_CHECK_FUNCS' => 1

View File

@@ -1,6 +1,6 @@
# norootforbuild
Name: apparmor-profile-editor
BuildRequires: wxGTK-devel gcc-c++
BuildRequires: wxGTK-devel gcc-c++
Version: 0.9
Release: 1
Vendor: Novell
@@ -8,7 +8,7 @@ Copyright: GPL
Summary: AppArmor profile editor
Group: Application/Editors
Packager: mbarringer@suse.de
BuildRoot: %{_tmppath}/%{name}-root
BuildRoot: %{_tmppath}/%{name}-root
Source: apparmor-profile-editor-0.9.tar.gz
%description
@@ -19,7 +19,7 @@ AppArmor profile editor
%build
autoreconf --force --install
export CFLAGS="$RPM_OPT_FLAGS -DSCI_LEXER -DLINK_LEXERS -fPIC -DPIC -DWX_PRECOMP -DNO_GCC_PRAGMA -D__WX"
export CXXFLAGS="$RPM_OPT_FLAGS -DSCI_LEXER -DLINK_LEXERS -fPIC -DPIC -DWX_PRECOMP -DNO_GCC_PRAGMA -D__WX"
export CXXFLAGS="$RPM_OPT_FLAGS -DSCI_LEXER -DLINK_LEXERS -fPIC -DPIC -DWX_PRECOMP -DNO_GCC_PRAGMA -D__WX"
%{?suse_update_config:%{suse_update_config -f}}
./configure --prefix=%{_prefix} --disable-debug --enable-debug=no
make
@@ -36,7 +36,9 @@ rm -rf %{buildroot}
%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
/usr/bin/profileeditor
%doc AUTHORS COPYING ChangeLog NEWS README TODO doc/en/AppArmorProfileEditor.htb
%{_prefix}/bin/profileeditor
%{_prefix}/share/doc/profileeditor/AppArmorProfileEditor.htb
%dir %{_prefix}/share/doc/profileeditor
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%changelog

View File

@@ -37,6 +37,8 @@ public:
void SetProfileDirectory (const wxString& dir) { mProfileDirectory = dir; }
void SetEditorExecutable (const wxString& exec) { mEditorExecutable = exec; }
void SetSearchText (const wxString& searchString) { mpSearchPhraseTextCtrl->SetValue(searchString); }
private:
wxFlexGridSizer* mpSearchPhraseSizer;
wxStaticText* mpSearchStaticText;

View File

@@ -63,6 +63,7 @@ BEGIN_EVENT_TABLE( ProfileToolFrame, wxFrame )
EVT_MENU(ID_TREE_CONTEXT_RELOAD, ProfileToolFrame::OnReloadProfile)
EVT_MENU(wxSTC_APPARMOR_OPEN_INCLUDE_MENU_ITEM, ProfileToolFrame::OnOpenInclude)
EVT_MENU(wxSTC_APPARMOR_INSERT_INCLUDE_MENU_ITEM, ProfileToolFrame::OnInsertInclude)
EVT_MENU(wxSTC_APPARMOR_SEARCH_PHRASE_IN_ALL_PROFILES, ProfileToolFrame::OnSearchAllProfiles)
EVT_TREE_ITEM_ACTIVATED(ID_PROFILE_TREE, ProfileToolFrame::OnTreeSelection)
EVT_TREE_ITEM_MENU(ID_PROFILE_TREE, ProfileToolFrame::OnTreeContextMenu)
EVT_STC_CHANGE(ID_STYLED_PROFILE_WINDOW, ProfileToolFrame::OnProfileModified)
@@ -1038,11 +1039,15 @@ void ProfileToolFrame::OnSaveAs (wxCommandEvent& WXUNUSED(event))
* Event handler triggered by Edit->Search All
* @param event
*/
void ProfileToolFrame::OnSearchAllProfiles (wxCommandEvent& WXUNUSED(event))
void ProfileToolFrame::OnSearchAllProfiles (wxCommandEvent& event)
{
SearchAllProfilesDialog *searchDialog = new SearchAllProfilesDialog(this);
searchDialog->SetProfileDirectory(Configuration::GetProfileDirectory());
searchDialog->SetEditorExecutable(Configuration::GetEditorExecutable());
if (wxSTC_APPARMOR_SEARCH_PHRASE_IN_ALL_PROFILES == event.GetId())
searchDialog->SetSearchText(mpProfileView->GetSelectedText());
searchDialog->ShowModal();
searchDialog->Destroy();
}
@@ -1092,8 +1097,8 @@ void ProfileToolFrame::OnTreeSelection(wxTreeEvent& event)
ProfileTreeData *data = (ProfileTreeData *) mpProfileTree->GetItemData(node);
if (NULL == data)
{
// It's not a profile, it's a directory node, so expand it
mpProfileTree->Expand(node);
// It's not a profile, it's a directory node
mpProfileTree->Toggle(node);
}
else
{

View File

@@ -397,7 +397,17 @@ void ScintillaBase::CallTipClick() {
}
void ScintillaBase::ContextMenu(Point pt) {
// Save any prior highlighting
int tmpPos = currentPos;
int tmpAnchor = anchor;
MovePositionTo(PositionFromLocation(pt));
if (tmpPos != tmpAnchor)
{
SetSelection(tmpAnchor, tmpPos);
}
if (displayPopupMenu) {
bool writable = !WndProc(SCI_GETREADONLY, 0, 0);
popup.CreatePopUp();
@@ -411,6 +421,7 @@ void ScintillaBase::ContextMenu(Point pt) {
AddToPopUp("");
AddToPopUp("Select All", idcmdSelectAll);
AddToPopUp("");
AddToPopUp("Search for this phrase in all profiles", APPARMOR_SEARCH_PHRASE_IN_ALL_PROFILES, currentPos != anchor);
AddToPopUp("Insert an include", APPARMOR_INSERT_INCLUDE_MENU_ITEM);
if (pdoc->StyleAt(currentPos) == SCE_APPARMOR_INCLUDE)
AddToPopUp("Open included file in New Window", APPARMOR_OPEN_INCLUDE_MENU_ITEM);

View File

@@ -10,7 +10,7 @@
#define APPARMOR_OPEN_INCLUDE_MENU_ITEM 4891
#define APPARMOR_INSERT_INCLUDE_MENU_ITEM 4892
#define APPARMOR_SEARCH_PHRASE_IN_ALL_PROFILES 4893
/**
*/
class ScintillaBase : public Editor {

View File

@@ -321,7 +321,7 @@
// Keep this number the same as in ScintillaBase.h
#define wxSTC_APPARMOR_OPEN_INCLUDE_MENU_ITEM 4891
#define wxSTC_APPARMOR_INSERT_INCLUDE_MENU_ITEM 4892
#define wxSTC_APPARMOR_SEARCH_PHRASE_IN_ALL_PROFILES 4893
//-----------------------------------------
// Commands that can be bound to keystrokes
@@ -599,6 +599,7 @@
// "Open in a new window" has been selected from the context menu
#define wxSTC_CMD_OPEN_INCLUDE_IN_NEW_WINDOW 2443
// END of generated section
//----------------------------------------------------------------------