Re: current time in MC



On Mon, 3 Nov 2003, Vyacheslav Filyayev wrote:

Dear Christian Hamar and MC users,

I didn't submit all patches I've done under MC knowingly
because I was not sure whether it'll be useful for someone.
One more thing, I'm a novice in Linux and don't know how to
create patches, in particular when I want to do it under the
whole directory. That is why I send you short description
instead of real patch.

Diff between directories is done by "diff -ur" if there are no new or old
files.  If you keep backups for base versions, you can also use ldiff from
mc CVS, but you should change the suffix for the base file from ".v0" to
whatever you are using.

In order to add current time in upper right corner you have to
1) add the following line at the beginning of src/screen.c
#include <sys/time.h>
2) modify the show_dir function in src/screen.c. It must be as
   following

Having times in every copy of mc consumes CPU for every copy, but the user
looks only at one clock.

Short description:
At first I've added new variables: timer, tms and str. Then got the current time
and convert it to the string str (you can change this string format as you like:
seconds, date etc.). Finally add the str to upper MC line to the right panel
(  if(strcmp(panel->panel_name,get_nth_panel_name(0)))   ). It seems to be all.
Time will be refreshed after changing directory, F3, Ctrl+O and other
actions which leads to panels refreshing.

That would be very misleading.  It's better to show no time than wrong
time.

Also, I'm not accepting patched that introduce or require new
configuration parameters until those parameters can be configured
interactively (i.e. until we have "Advanced Options").

-- 
Regards,
Pavel Roskin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]