diff --git a/src/ChangeLog b/src/ChangeLog index ede5f9951..afb0f0f30 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2003-09-10 Pavel Roskin + * dlg.c: Don't supply ID of the current widget with any + callbacks. It's mostly useless and can be found by the + callback. + * layout.c: Likewise. + * widget.c: Likewise. + * chmod.c (chmod_callback): Adjust for the above. + * layout.c (layout_change): Make static. * screen.c (paint_panel): Likewise. * cmd.c (dirsizes_cmd): Use dirty flag. diff --git a/src/chmod.c b/src/chmod.c index 85f0a207c..e0b71a5bf 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -153,11 +153,14 @@ static cb_ret_t chmod_callback (Dlg_head *h, dlg_msg_t msg, int parm) { char buffer[BUF_TINY]; + int id; switch (msg) { case DLG_ACTION: - if (parm >= BUTTONS - single_set * 2) { - c_stat ^= check_perm[parm - BUTTONS + single_set * 2].mode; + id = h->current->dlg_id - BUTTONS + single_set * 2; + + if (id >= 0) { + c_stat ^= check_perm[id].mode; g_snprintf (buffer, sizeof (buffer), "%o", c_stat); label_set_text (statl, buffer); chmod_toggle_select (h); diff --git a/src/dlg.c b/src/dlg.c index 32d429a0a..7730b93b3 100644 --- a/src/dlg.c +++ b/src/dlg.c @@ -348,7 +348,7 @@ int dlg_focus (Dlg_head *h) return 0; if (send_message (h->current->widget, WIDGET_FOCUS, 0)){ - (*h->callback) (h, DLG_FOCUS, h->current->dlg_id); + (*h->callback) (h, DLG_FOCUS, 0); return 1; } return 0; @@ -361,7 +361,7 @@ dlg_unfocus (Dlg_head *h) return 0; if (send_message (h->current->widget, WIDGET_UNFOCUS, 0)){ - (*h->callback) (h, DLG_UNFOCUS, h->current->dlg_id); + (*h->callback) (h, DLG_UNFOCUS, 0); return 1; } return 0; @@ -755,7 +755,7 @@ void init_dlg (Dlg_head *h) void dlg_run_done (Dlg_head *h) { if (h->current) - (*h->callback) (h, DLG_END, h->current->dlg_id); + (*h->callback) (h, DLG_END, 0); current_dlg = (Dlg_head *) h->previous_dialog; } diff --git a/src/layout.c b/src/layout.c index ae88d47c3..72f802a8a 100644 --- a/src/layout.c +++ b/src/layout.c @@ -781,8 +781,7 @@ change_screen_size (void) setup_panels (); /* Inform currently running dialog */ - (*current_dlg->callback) (current_dlg, DLG_RESIZE, - current_dlg->current->dlg_id); + (*current_dlg->callback) (current_dlg, DLG_RESIZE, 0); #ifdef RESIZABLE_MENUBAR menubar_arrange (the_menubar); diff --git a/src/widget.c b/src/widget.c index 9e0fd9d8a..9aa4dd405 100644 --- a/src/widget.c +++ b/src/widget.c @@ -290,7 +290,7 @@ radio_callback (WRadio *r, int Msg, int Par) switch (Par){ case ' ': r->sel = r->pos; - (*h->callback) (h, DLG_ACTION, h->current->dlg_id); + (*h->callback) (h, DLG_ACTION, 0); radio_callback (r, WIDGET_FOCUS, ' '); return 1; @@ -312,7 +312,7 @@ radio_callback (WRadio *r, int Msg, int Par) return 0; case WIDGET_CURSOR: - (*h->callback) (h, DLG_ACTION, h->current->dlg_id); + (*h->callback) (h, DLG_ACTION, 0); radio_callback (r, WIDGET_FOCUS, ' '); widget_move (&r->widget, r->pos, 1); break; @@ -417,7 +417,7 @@ check_callback (WCheck *c, int Msg, int Par) break; c->state ^= C_BOOL; c->state ^= C_CHANGE; - (*h->callback) (h, DLG_ACTION, h->current->dlg_id); + (*h->callback) (h, DLG_ACTION, 0); check_callback (c, WIDGET_FOCUS, ' '); return 1;