mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Make instances of struct hierbox_browser_button const.
And explicitly disable the "Save" buttons in anonymous mode, even though they are currently inside #if 0.
This commit is contained in:
parent
31dc108c73
commit
a5e321cb2b
@ -318,7 +318,7 @@ hierbox_browser(struct hierbox_browser *browser, struct session *ses)
|
||||
add_dlg_listbox(dlg, listbox_data);
|
||||
|
||||
for (button = 0; button < browser->buttons_size; button++) {
|
||||
struct hierbox_browser_button *but = &browser->buttons[button];
|
||||
const struct hierbox_browser_button *but = &browser->buttons[button];
|
||||
|
||||
/* Skip buttons that should not be displayed in anonymous mode */
|
||||
if (anonymous && !but->anonymous) {
|
||||
|
@ -18,7 +18,7 @@ struct hierbox_browser_button {
|
||||
struct hierbox_browser {
|
||||
unsigned char *title;
|
||||
void (*expansion_callback)(void);
|
||||
struct hierbox_browser_button *buttons;
|
||||
const struct hierbox_browser_button *buttons;
|
||||
size_t buttons_size;
|
||||
|
||||
struct list_head boxes;
|
||||
|
@ -482,7 +482,7 @@ push_move_button(struct dialog_data *dlg_data,
|
||||
|
||||
/**** MANAGEMENT *****************************************************/
|
||||
|
||||
static struct hierbox_browser_button bookmark_buttons[] = {
|
||||
static const struct hierbox_browser_button bookmark_buttons[] = {
|
||||
/* [gettext_accelerator_context(.bookmark_buttons)] */
|
||||
{ N_("~Goto"), push_hierbox_goto_button, 1 },
|
||||
{ N_("~Edit"), push_edit_button, 0 },
|
||||
@ -498,7 +498,7 @@ static struct hierbox_browser_button bookmark_buttons[] = {
|
||||
{ N_("Clear"), push_hierbox_clear_button, 0 },
|
||||
|
||||
/* TODO: Would this be useful? --jonas */
|
||||
{ N_("Save"), push_save_button },
|
||||
{ N_("Save"), push_save_button, 0 },
|
||||
#endif
|
||||
};
|
||||
|
||||
|
2
src/cache/dialogs.c
vendored
2
src/cache/dialogs.c
vendored
@ -224,7 +224,7 @@ static struct listbox_ops cache_entry_listbox_ops = {
|
||||
&cache_messages,
|
||||
};
|
||||
|
||||
static struct hierbox_browser_button cache_buttons[] = {
|
||||
static const struct hierbox_browser_button cache_buttons[] = {
|
||||
/* [gettext_accelerator_context(.cache_buttons)] */
|
||||
{ N_("~Info"), push_hierbox_info_button, 1 },
|
||||
{ N_("~Goto"), push_hierbox_goto_button, 1 },
|
||||
|
@ -492,7 +492,7 @@ push_save_button(struct dialog_data *dlg_data,
|
||||
}
|
||||
|
||||
|
||||
static struct hierbox_browser_button option_buttons[] = {
|
||||
static const struct hierbox_browser_button option_buttons[] = {
|
||||
/* [gettext_accelerator_context(.option_buttons)] */
|
||||
{ N_("~Info"), push_hierbox_info_button, 1 },
|
||||
{ N_("~Edit"), push_edit_button, 0 },
|
||||
@ -921,7 +921,7 @@ push_kbdbind_save_button(struct dialog_data *dlg_data,
|
||||
|
||||
static INIT_LIST_HEAD(keybinding_dialog_list);
|
||||
|
||||
static struct hierbox_browser_button keybinding_buttons[] = {
|
||||
static const struct hierbox_browser_button keybinding_buttons[] = {
|
||||
/* [gettext_accelerator_context(.keybinding_buttons)] */
|
||||
{ N_("~Add"), push_kbdbind_add_button, 0 },
|
||||
{ N_("~Delete"), push_hierbox_delete_button, 0 },
|
||||
|
@ -471,7 +471,7 @@ push_save_button(struct dialog_data *dlg_data, struct widget_data *button)
|
||||
return EVENT_PROCESSED;
|
||||
}
|
||||
|
||||
static struct hierbox_browser_button cookie_buttons[] = {
|
||||
static const struct hierbox_browser_button cookie_buttons[] = {
|
||||
/* [gettext_accelerator_context(.cookie_buttons)] */
|
||||
{ N_("~Info"), push_hierbox_info_button, 1 },
|
||||
{ N_("~Add"), push_add_button, 1 },
|
||||
|
@ -487,7 +487,7 @@ push_info_button(struct dialog_data *dlg_data, struct widget_data *button)
|
||||
* - Open button that can be used to set file_download->prog.
|
||||
* - Toggle notify button
|
||||
*/
|
||||
static struct hierbox_browser_button download_buttons[] = {
|
||||
static const struct hierbox_browser_button download_buttons[] = {
|
||||
/* [gettext_accelerator_context(.download_buttons)] */
|
||||
{ N_("~Info"), push_info_button },
|
||||
{ N_("~Abort"), push_hierbox_delete_button },
|
||||
|
@ -204,7 +204,7 @@ push_save_button(struct dialog_data *dlg_data, struct widget_data *button)
|
||||
return EVENT_PROCESSED;
|
||||
}
|
||||
|
||||
static struct hierbox_browser_button formhist_buttons[] = {
|
||||
static const struct hierbox_browser_button formhist_buttons[] = {
|
||||
/* [gettext_accelerator_context(.formhist_buttons)] */
|
||||
{ N_("~Login"), push_login_button, 1 },
|
||||
{ N_("~Info"), push_hierbox_info_button, 1 },
|
||||
|
@ -219,7 +219,7 @@ push_bookmark_button(struct dialog_data *dlg_data,
|
||||
|
||||
/* The global history manager: */
|
||||
|
||||
static struct hierbox_browser_button globhist_buttons[] = {
|
||||
static const struct hierbox_browser_button globhist_buttons[] = {
|
||||
/* [gettext_accelerator_context(.globhist_buttons)] */
|
||||
{ N_("~Goto"), push_hierbox_goto_button, 1 },
|
||||
{ N_("~Info"), push_hierbox_info_button, 1 },
|
||||
@ -232,7 +232,7 @@ static struct hierbox_browser_button globhist_buttons[] = {
|
||||
{ N_("C~lear"), push_hierbox_clear_button, 0 },
|
||||
#if 0
|
||||
/* TODO: Would this be useful? --jonas */
|
||||
{ N_("Save"), push_save_button },
|
||||
{ N_("Save"), push_save_button, 0 },
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -256,7 +256,7 @@ static struct listbox_ops auth_listbox_ops = {
|
||||
&http_auth_messages,
|
||||
};
|
||||
|
||||
static struct hierbox_browser_button auth_buttons[] = {
|
||||
static const struct hierbox_browser_button auth_buttons[] = {
|
||||
/* [gettext_accelerator_context(.auth_buttons)] */
|
||||
{ N_("~Goto"), push_hierbox_goto_button, 1 },
|
||||
{ N_("~Info"), push_hierbox_info_button, 1 },
|
||||
|
Loading…
Reference in New Issue
Block a user