1
1

(mcview_ok_to_quit): move to actions_cmd.c and make static.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
Andrew Borodin 2013-06-23 18:52:42 +04:00
родитель 970cfd881a
Коммит 405143ba9f
3 изменённых файлов: 38 добавлений и 40 удалений

Просмотреть файл

@ -578,6 +578,44 @@ mcview_adjust_size (WDialog * h)
mcview_update_bytes_per_line (view);
}
/* --------------------------------------------------------------------------------------------- */
static gboolean
mcview_ok_to_quit (mcview_t * view)
{
int r;
if (view->change_list == NULL)
return TRUE;
if (!mc_global.midnight_shutdown)
{
query_set_sel (2);
r = query_dialog (_("Quit"),
_("File was modified. Save with exit?"), D_NORMAL, 3,
_("&Yes"), _("&No"), _("&Cancel quit"));
}
else
{
r = query_dialog (_("Quit"),
_("Midnight Commander is being shut down.\nSave modified file?"),
D_NORMAL, 2, _("&Yes"), _("&No"));
/* Esc is No */
if (r == -1)
r = 1;
}
switch (r)
{
case 0: /* Yes */
return mcview_hexedit_save_changes (view) || mc_global.midnight_shutdown;
case 1: /* No */
mcview_hexedit_free_change_list (view);
return TRUE;
default:
return FALSE;
}
}
/* --------------------------------------------------------------------------------------------- */
/*** public functions ****************************************************************************/

Просмотреть файл

@ -283,7 +283,6 @@ void mcview_toggle_magic_mode (mcview_t * view);
void mcview_toggle_wrap_mode (mcview_t * view);
void mcview_toggle_nroff_mode (mcview_t * view);
void mcview_toggle_hex_mode (mcview_t * view);
gboolean mcview_ok_to_quit (mcview_t * view);
void mcview_init (mcview_t * view);
void mcview_done (mcview_t * view);
void mcview_select_encoding (mcview_t * view);

Просмотреть файл

@ -152,45 +152,6 @@ mcview_toggle_hex_mode (mcview_t * view)
/* --------------------------------------------------------------------------------------------- */
gboolean
mcview_ok_to_quit (mcview_t * view)
{
int r;
if (view->change_list == NULL)
return TRUE;
if (!mc_global.midnight_shutdown)
{
query_set_sel (2);
r = query_dialog (_("Quit"),
_("File was modified. Save with exit?"), D_NORMAL, 3,
_("&Yes"), _("&No"), _("&Cancel quit"));
}
else
{
r = query_dialog (_("Quit"),
_("Midnight Commander is being shut down.\nSave modified file?"),
D_NORMAL, 2, _("&Yes"), _("&No"));
/* Esc is No */
if (r == -1)
r = 1;
}
switch (r)
{
case 0: /* Yes */
return mcview_hexedit_save_changes (view) || mc_global.midnight_shutdown;
case 1: /* No */
mcview_hexedit_free_change_list (view);
return TRUE;
default:
return FALSE;
}
}
/* --------------------------------------------------------------------------------------------- */
void
mcview_init (mcview_t * view)
{