ref: 864d763e906cf39fd322a6a83aa5d4641d86c37b
parent: bef71d55de6982dc40b932c8808bdad41ac13304
author: cancel <cancel@cancel.fm>
date: Sun Jan 5 18:17:32 EST 2020
Change ordering of args for qmenu_add_choice()
--- a/term_util.c
+++ b/term_util.c
@@ -312,7 +312,7 @@
void qmenu_set_title(Qmenu* qm, char const* title) {
qblock_set_title(&qm->qblock, title);
}
-void qmenu_add_choice(Qmenu* qm, char const* text, int id) {
+void qmenu_add_choice(Qmenu* qm, int id, char const* text) {
assert(id >= Qmenu_first_valid_user_choice_id);
ITEM* item = new_item(text, NULL);
set_item_userptr(item, (void*)(intptr_t)(id));
--- a/term_util.h
+++ b/term_util.h
@@ -133,7 +133,7 @@
void qmenu_destroy(Qmenu* qm);
int qmenu_id(Qmenu const* qm);
void qmenu_set_title(Qmenu* qm, char const* title);
-void qmenu_add_choice(Qmenu* qm, char const* text, int id);
+void qmenu_add_choice(Qmenu* qm, int id, char const* text);
void qmenu_add_spacer(Qmenu* qm);
void qmenu_set_current_item(Qmenu* qm, int id);
void qmenu_set_displayed_active(Qmenu* qm, bool active);
--- a/tui_main.c
+++ b/tui_main.c
@@ -1904,24 +1904,24 @@
void push_main_menu(void) {
Qmenu* qm = qmenu_create(Main_menu_id);
qmenu_set_title(qm, "ORCA");
- qmenu_add_choice(qm, "New", Main_menu_new);
- qmenu_add_choice(qm, "Open...", Main_menu_open);
- qmenu_add_choice(qm, "Save", Main_menu_save);
- qmenu_add_choice(qm, "Save As...", Main_menu_save_as);
+ qmenu_add_choice(qm, Main_menu_new, "New");
+ qmenu_add_choice(qm, Main_menu_open, "Open...");
+ qmenu_add_choice(qm, Main_menu_save, "Save");
+ qmenu_add_choice(qm, Main_menu_save_as, "Save As...");
qmenu_add_spacer(qm);
- qmenu_add_choice(qm, "Set BPM...", Main_menu_set_tempo);
- qmenu_add_choice(qm, "Set Grid Size...", Main_menu_set_grid_dims);
- qmenu_add_choice(qm, "Auto-fit Grid", Main_menu_autofit_grid);
+ qmenu_add_choice(qm, Main_menu_set_tempo, "Set BPM...");
+ qmenu_add_choice(qm, Main_menu_set_grid_dims, "Set Grid Size...");
+ qmenu_add_choice(qm, Main_menu_autofit_grid, "Auto-fit Grid");
qmenu_add_spacer(qm);
#ifdef FEAT_PORTMIDI
- qmenu_add_choice(qm, "PortMidi Output", Main_menu_choose_portmidi_output);
+ qmenu_add_choice(qm, Main_menu_choose_portmidi_output, "PortMidi Output");
qmenu_add_spacer(qm);
#endif
- qmenu_add_choice(qm, "Controls...", Main_menu_controls);
- qmenu_add_choice(qm, "Operators...", Main_menu_opers_guide);
- qmenu_add_choice(qm, "About...", Main_menu_about);
+ qmenu_add_choice(qm, Main_menu_controls, "Controls...");
+ qmenu_add_choice(qm, Main_menu_opers_guide, "Operators...");
+ qmenu_add_choice(qm, Main_menu_about, "About...");
qmenu_add_spacer(qm);
- qmenu_add_choice(qm, "Quit", Main_menu_quit);
+ qmenu_add_choice(qm, Main_menu_quit, "Quit");
qmenu_push_to_nav(qm);
}
@@ -1935,8 +1935,8 @@
void push_confirm_new_file_menu(void) {
Qmenu* qm = qmenu_create(Confirm_new_file_menu_id);
qmenu_set_title(qm, "Are you sure?");
- qmenu_add_choice(qm, "Cancel", Confirm_new_file_reject_id);
- qmenu_add_choice(qm, "Create New File", Confirm_new_file_accep_id);
+ qmenu_add_choice(qm, Confirm_new_file_reject_id, "Cancel");
+ qmenu_add_choice(qm, Confirm_new_file_accep_id, "Create New File");
qmenu_push_to_nav(qm);
}
@@ -1943,8 +1943,8 @@
void push_autofit_menu(void) {
Qmenu* qm = qmenu_create(Autofit_menu_id);
qmenu_set_title(qm, "Auto-fit Grid");
- qmenu_add_choice(qm, "Nicely", Autofit_nicely_id);
- qmenu_add_choice(qm, "Tightly", Autofit_tightly_id);
+ qmenu_add_choice(qm, Autofit_nicely_id, "Nicely");
+ qmenu_add_choice(qm, Autofit_tightly_id, "Tightly");
qmenu_push_to_nav(qm);
}
@@ -2190,7 +2190,7 @@
PmDeviceInfo const* info = Pm_GetDeviceInfo(i);
if (!info || !info->output)
continue;
- qmenu_add_choice(qm, info->name, i);
+ qmenu_add_choice(qm, i, info->name);
// printf("ID: %-4d Name: %s\n", i, info->name);
++output_devices;
}