mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* cmd.c (get_random_hint): Add "force" argument to ignore
timeout. Adjust all dependencies. * main.c (load_hint): Likewise. * layout.c (setup_panels): Force updating the hint bar. Original patch by Adam Byrtek <alpha@debian.org>
This commit is contained in:
parent
620bf270aa
commit
0f865bcf8f
@ -1,3 +1,11 @@
|
||||
2003-02-04 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* cmd.c (get_random_hint): Add "force" argument to ignore
|
||||
timeout. Adjust all dependencies.
|
||||
* main.c (load_hint): Likewise.
|
||||
* layout.c (setup_panels): Force updating the hint bar.
|
||||
Original patch by Adam Byrtek <alpha@debian.org>
|
||||
|
||||
2003-02-03 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* slint.c (getch): If there is EOF on the input, exit
|
||||
|
11
src/cmd.c
11
src/cmd.c
@ -1200,8 +1200,11 @@ char *guess_message_value (void)
|
||||
return g_strdup (locale);
|
||||
}
|
||||
|
||||
/* Returns a random hint */
|
||||
char *get_random_hint (void)
|
||||
/*
|
||||
* Return a random hint. If force is not 0, ignore the timeout.
|
||||
*/
|
||||
char *
|
||||
get_random_hint (int force)
|
||||
{
|
||||
char *data, *result, *eol;
|
||||
int len;
|
||||
@ -1214,7 +1217,7 @@ char *get_random_hint (void)
|
||||
time_t now;
|
||||
|
||||
time (&now);
|
||||
if ((now - last) < 60)
|
||||
if (!force && (now - last) < 60)
|
||||
return g_strdup ("");
|
||||
last = now;
|
||||
#else
|
||||
@ -1222,7 +1225,7 @@ char *get_random_hint (void)
|
||||
static struct timeval tv;
|
||||
|
||||
gettimeofday (&tv, NULL);
|
||||
if (!(tv.tv_sec> last_sec+60))
|
||||
if (!force && !(tv.tv_sec > last_sec + 60))
|
||||
return g_strdup ("");
|
||||
last_sec = tv.tv_sec;
|
||||
#endif /* !SCO_FLAVOR */
|
||||
|
@ -49,7 +49,7 @@ void swap_cmd (void);
|
||||
void view_other_cmd (void);
|
||||
void quick_cd_cmd (void);
|
||||
void save_setup_cmd (void);
|
||||
char *get_random_hint (void);
|
||||
char *get_random_hint (int force);
|
||||
void source_routing (void);
|
||||
void user_file_menu_cmd (void);
|
||||
char *guess_message_value (void);
|
||||
|
@ -712,7 +712,7 @@ setup_panels (void)
|
||||
} else
|
||||
widget_set_size (&the_hint->widget, 0, 0, 0, 0);
|
||||
|
||||
load_hint ();
|
||||
load_hint (1);
|
||||
update_xterm_title_path ();
|
||||
}
|
||||
|
||||
|
13
src/main.c
13
src/main.c
@ -789,7 +789,7 @@ _do_panel_cd (WPanel *panel, char *new_dir, enum cd_enum cd_type)
|
||||
do_load_dir (&panel->dir, panel->sort_type, panel->reverse,
|
||||
panel->case_sensitive, panel->filter);
|
||||
try_to_select (panel, get_parent_dir_name (panel->cwd, olddir));
|
||||
load_hint ();
|
||||
load_hint (0);
|
||||
panel_update_contents (panel);
|
||||
update_xterm_title_path ();
|
||||
|
||||
@ -1853,9 +1853,12 @@ update_xterm_title_path (void)
|
||||
}
|
||||
}
|
||||
|
||||
/* Load new hint and display it. */
|
||||
/*
|
||||
* Load new hint and display it.
|
||||
* IF force is not 0, ignore the timeout.
|
||||
*/
|
||||
void
|
||||
load_hint (void)
|
||||
load_hint (int force)
|
||||
{
|
||||
char *hint;
|
||||
|
||||
@ -1867,7 +1870,7 @@ load_hint (void)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((hint = get_random_hint ())) {
|
||||
if ((hint = get_random_hint (force))) {
|
||||
if (*hint)
|
||||
set_hintbar (hint);
|
||||
g_free (hint);
|
||||
@ -1887,7 +1890,7 @@ setup_panels_and_run_mc (void)
|
||||
|
||||
xtoolkit_panel_setup ();
|
||||
add_widget (midnight_dlg, the_hint);
|
||||
load_hint ();
|
||||
load_hint (1);
|
||||
add_widget (midnight_dlg, cmdline);
|
||||
add_widget (midnight_dlg, the_prompt);
|
||||
add_widget (midnight_dlg, the_bar);
|
||||
|
@ -131,7 +131,7 @@ int quiet_quit_cmd (void); /* For cmd.c and command.c */
|
||||
void untouch_bar (void);
|
||||
void touch_bar (void);
|
||||
void update_xterm_title_path (void);
|
||||
void load_hint (void);
|
||||
void load_hint (int force);
|
||||
|
||||
void print_vfs_message(char *msg, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
|
Loading…
Reference in New Issue
Block a user