Skip to content

Commit

Permalink
fix: fixed context popup menus
Browse files Browse the repository at this point in the history
  • Loading branch information
0xeb committed Aug 14, 2024
1 parent a17165a commit 8bab99f
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions qscripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static constexpr char IDAREG_RECENT_SCRIPTS[] = "RecentScripts";

//-------------------------------------------------------------------------
// Non-modal scripts chooser
struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_listener_t
struct qscripts_chooser_t: public plugmod_t, public chooser_t
{
using chooser_t::operator delete;
using chooser_t::operator new;
Expand Down Expand Up @@ -66,14 +66,6 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
return selected_script.file_path.c_str();
}

ssize_t idaapi on_event(ssize_t code, va_list va) override
{
if (code == ui_finish_populating_widget_popup)
am.on_ui_finish_populating_widget_popup(va);

return 0;
}

bool make_meta_filename(
const char* filename,
const char* extension,
Expand Down Expand Up @@ -1024,7 +1016,7 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
IDAICONS::FLASH);

am.add_action(
AMAHF_IDA_POPUP,
AMAHF_NONE,
ACTION_EXECUTE_SCRIPT_WITH_UNDO_ID,
"QScripts: Execute last active script",
"Alt-Shift-X",
Expand Down Expand Up @@ -1060,7 +1052,7 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
IDAICONS::FLASH);

am.add_action(
AMAHF_IDA_POPUP,
AMAHF_NONE,
ACTION_EXECUTE_NOTEBOOK_ID,
"QScripts: Execute all notebook cells",
"",
Expand All @@ -1075,8 +1067,6 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
},
"An action to programmatically execute the active script",
IDAICONS::NOTEPAD_1);

hook_event_listener(HT_UI, this);
}

public:
Expand Down Expand Up @@ -1182,6 +1172,14 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t, public event_list
widget,
nullptr,
ACTION_EXECUTE_SELECTED_SCRIPT_ID);
attach_action_to_popup(
widget,
nullptr,
ACTION_EXECUTE_SCRIPT_WITH_UNDO_ID);
attach_action_to_popup(
widget,
nullptr,
ACTION_EXECUTE_NOTEBOOK_ID);
}
}

Expand Down

0 comments on commit 8bab99f

Please sign in to comment.