Remove hardcoded ioregtool in tool menu creation by adding a shortname field in the dTool_t struct. While at it cleanup a bit the names and shrink a bit name field.
This commit is contained in:
parent
40ac90fa14
commit
b6e6cfd1f0
|
@ -10,7 +10,9 @@ typedef void (*dTool_closeFn)();
|
|||
|
||||
typedef struct
|
||||
{
|
||||
const char name[64];
|
||||
/* this should be the same name of the action in the gui xml */
|
||||
const char shortname[16];
|
||||
const char name[32];
|
||||
dTool_openFn open;
|
||||
dTool_updateFn update;
|
||||
dTool_closeFn close;
|
||||
|
|
|
@ -226,7 +226,7 @@ static const char *ui_description =
|
|||
" </menu>"
|
||||
" </menu>"
|
||||
" <menu action='ToolsMenu'>"
|
||||
" <menuitem action='ioregtool'/>"
|
||||
" <menuitem action='ioregs'/>"
|
||||
" </menu>"
|
||||
" <menu action='HelpMenu'>"
|
||||
" <menuitem action='about'/>"
|
||||
|
@ -1682,8 +1682,7 @@ static void desmume_gtk_menu_tools (GtkActionGroup *ag)
|
|||
gint i;
|
||||
for(i = 0; i < dTools_list_size; i++) {
|
||||
GtkAction *act;
|
||||
//FIXME: remove hardcoded 'ioregtool' from here and in ui_description
|
||||
act = gtk_action_new("ioregtool", dTools_list[i]->name, NULL, NULL);
|
||||
act = gtk_action_new(dTools_list[i]->shortname, dTools_list[i]->name, NULL, NULL);
|
||||
g_signal_connect(G_OBJECT(act), "activate", G_CALLBACK(Start_dTool), GINT_TO_POINTER(i));
|
||||
gtk_action_group_add_action(ag, GTK_ACTION(act));
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "../MMU.h"
|
||||
|
||||
#define SHORTNAME "ioregs"
|
||||
#define TOOL_NAME "IO regs view"
|
||||
|
||||
BOOL CPUS [2] = {TRUE, TRUE};
|
||||
|
@ -472,6 +473,7 @@ static void open(int ID)
|
|||
|
||||
dTool_t dTool_ioregsView =
|
||||
{
|
||||
SHORTNAME,
|
||||
TOOL_NAME,
|
||||
&open,
|
||||
&update,
|
||||
|
|
Loading…
Reference in New Issue