Ticket #2226: info panel inprovements.
Fixed info panel initialization and destroying. Fixed info panel drawing: don't draw info twice. Fixed includes: added missing <sys/stat.h>. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
97b8d4f57a
Коммит
86a89655e5
15
src/info.c
15
src/info.c
@ -23,14 +23,14 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
|
||||
#include "lib/unixcompat.h"
|
||||
#include "lib/tty/tty.h"
|
||||
#include "lib/tty/key.h" /* is_idle() */
|
||||
#include "lib/tty/mouse.h" /* Gpm_Event */
|
||||
#include "lib/skin.h"
|
||||
#include "lib/unixcompat.h"
|
||||
#include "lib/strutil.h"
|
||||
|
||||
#include "dialog.h"
|
||||
@ -53,8 +53,6 @@ struct WInfo
|
||||
int ready;
|
||||
};
|
||||
|
||||
/* Have we called the init_my_statfs routine? */
|
||||
static gboolean initialized = FALSE;
|
||||
static struct my_statfs myfs_stats;
|
||||
|
||||
static void
|
||||
@ -248,13 +246,13 @@ info_callback (Widget * w, widget_msg_t msg, int parm)
|
||||
{
|
||||
|
||||
case WIDGET_INIT:
|
||||
init_my_statfs ();
|
||||
add_hook (&select_file_hook, info_hook, info);
|
||||
info->ready = 0;
|
||||
return MSG_HANDLED;
|
||||
|
||||
case WIDGET_DRAW:
|
||||
info_hook (info);
|
||||
info_show_info (info);
|
||||
return MSG_HANDLED;
|
||||
|
||||
case WIDGET_FOCUS:
|
||||
@ -262,6 +260,7 @@ info_callback (Widget * w, widget_msg_t msg, int parm)
|
||||
|
||||
case WIDGET_DESTROY:
|
||||
delete_hook (&select_file_hook, info_hook);
|
||||
free_my_statfs ();
|
||||
return MSG_HANDLED;
|
||||
|
||||
default:
|
||||
@ -294,11 +293,5 @@ info_new (int y, int x, int lines, int cols)
|
||||
/* We do not want the cursor */
|
||||
widget_want_cursor (info->widget, 0);
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
initialized = TRUE;
|
||||
init_my_statfs ();
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user