mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Ticket #3247: refactoring of status_msg engine.
Initial commit: create global timer. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
99dd2ef709
commit
be938c611b
@ -31,6 +31,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "lib/timer.h"
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef ENABLE_SUBSHELL
|
||||
@ -49,6 +50,7 @@
|
||||
/* *INDENT-OFF* */
|
||||
mc_global_t mc_global = {
|
||||
.mc_run_mode = MC_RUN_FULL,
|
||||
.timer = NULL,
|
||||
.midnight_shutdown = FALSE,
|
||||
|
||||
.sysconfig_dir = NULL,
|
||||
|
@ -173,6 +173,8 @@ typedef enum
|
||||
typedef struct
|
||||
{
|
||||
mc_run_mode_t mc_run_mode;
|
||||
/* global timer */
|
||||
struct mc_timer_t *timer;
|
||||
/* Used so that widgets know if they are being destroyed or shut down */
|
||||
gboolean midnight_shutdown;
|
||||
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "lib/tty/tty.h"
|
||||
#include "lib/tty/key.h" /* For init_key() */
|
||||
#include "lib/tty/mouse.h" /* init_mouse() */
|
||||
#include "lib/timer.h"
|
||||
#include "lib/skin.h"
|
||||
#include "lib/filehighlight.h"
|
||||
#include "lib/fileloc.h"
|
||||
@ -238,6 +239,8 @@ main (int argc, char *argv[])
|
||||
char *config_migrate_msg;
|
||||
int exit_code = EXIT_FAILURE;
|
||||
|
||||
mc_global.timer = mc_timer_new ();
|
||||
|
||||
/* We had LC_CTYPE before, LC_ALL includs LC_TYPE as well */
|
||||
#ifdef HAVE_SETLOCALE
|
||||
(void) setlocale (LC_ALL, "");
|
||||
@ -256,6 +259,7 @@ main (int argc, char *argv[])
|
||||
g_free (mc_global.tty.shell);
|
||||
startup_exit_ok:
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
return exit_code;
|
||||
}
|
||||
|
||||
@ -497,6 +501,8 @@ main (int argc, char *argv[])
|
||||
exit_code = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
|
||||
(void) putchar ('\n'); /* Hack to make shell's prompt start at left of screen */
|
||||
|
||||
return exit_code;
|
||||
|
Loading…
Reference in New Issue
Block a user