Skip to content

Commit 8bab99f

Browse files
committed
fix: fixed context popup menus
1 parent a17165a commit 8bab99f

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

qscripts.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static constexpr char IDAREG_RECENT_SCRIPTS[] = "RecentScripts";
2323

2424
//-------------------------------------------------------------------------
2525
// Non-modal scripts chooser
26-
struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_listener_t
26+
struct qscripts_chooser_t: public plugmod_t, public chooser_t
2727
{
2828
using chooser_t::operator delete;
2929
using chooser_t::operator new;
@@ -66,14 +66,6 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
6666
return selected_script.file_path.c_str();
6767
}
6868

69-
ssize_t idaapi on_event(ssize_t code, va_list va) override
70-
{
71-
if (code == ui_finish_populating_widget_popup)
72-
am.on_ui_finish_populating_widget_popup(va);
73-
74-
return 0;
75-
}
76-
7769
bool make_meta_filename(
7870
const char* filename,
7971
const char* extension,
@@ -1024,7 +1016,7 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
10241016
IDAICONS::FLASH);
10251017

10261018
am.add_action(
1027-
AMAHF_IDA_POPUP,
1019+
AMAHF_NONE,
10281020
ACTION_EXECUTE_SCRIPT_WITH_UNDO_ID,
10291021
"QScripts: Execute last active script",
10301022
"Alt-Shift-X",
@@ -1060,7 +1052,7 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
10601052
IDAICONS::FLASH);
10611053

10621054
am.add_action(
1063-
AMAHF_IDA_POPUP,
1055+
AMAHF_NONE,
10641056
ACTION_EXECUTE_NOTEBOOK_ID,
10651057
"QScripts: Execute all notebook cells",
10661058
"",
@@ -1075,8 +1067,6 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
10751067
},
10761068
"An action to programmatically execute the active script",
10771069
IDAICONS::NOTEPAD_1);
1078-
1079-
hook_event_listener(HT_UI, this);
10801070
}
10811071

10821072
public:
@@ -1182,6 +1172,14 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
11821172
widget,
11831173
nullptr,
11841174
ACTION_EXECUTE_SELECTED_SCRIPT_ID);
1175+
attach_action_to_popup(
1176+
widget,
1177+
nullptr,
1178+
ACTION_EXECUTE_SCRIPT_WITH_UNDO_ID);
1179+
attach_action_to_popup(
1180+
widget,
1181+
nullptr,
1182+
ACTION_EXECUTE_NOTEBOOK_ID);
11851183
}
11861184
}
11871185

0 commit comments

Comments
 (0)