New "Multiscreen" megapatch



Hi, All!

This patch (mc-multiscreen-patch) adds possibility to
open multiple internal viewers and internal editors at once.
This fearure is almost the same as in the FAR manager.
I'm sure it is will be very convenient for developers,
but not only.

When you have at least one open editor or viewer,
you can use the following keys:

F12: Call "dialog list" to choose dialog to switch to.
     Just like FAR manager.
Alt-U: Switch to previous dialog
Alt-I: Switch to next dialog


So, you can, for instance, open a viewer, switch to
file manager, open editor, switch to file manager again,
open another editor, switch to previous editor, etc.

When you exit from MC when other editors and/or viewers
are sleeping in the background,
all viewers and unmodified editors are killed,
but modified editors are activated and user have exit
from this editors manually with or without saving a file.


Now about the implementation.

Implementing this feature was impossible
without special hacks on MC dialog management system.
With old system ALL dialogs HAVE TO BE modal,
so you couldn't switch between whem randomly.
But now it is fixed.

Almost all screen switching framework is
incorporated in the new module: dlglist.c.


Now about applying the patch.

Almost ALL new or changed code in enclosed into the
#ifdef HAVE_DLGSWITCH
#endif
pair. HAVE_DLGSWITCH can be defined in config.h.
So it is (probably) safe to apply to current sources,
because it is easy to turn off the feature.

Only some peaces of code is not enclosed in
#ifdef HAVE_DLGSWITCH .. #endif pair.
For example it is a new glib-based logging handler
in main.c. I thinks it will be useful for debugging
various peaces of MC anyway.
Probably we can make this feature "experimental"
and provide a ./configure switch to turn it on,
for example "--enable-multiscreen" or
"--enable-dlgswitch".


About debugging.

The patch extensively uses glib-based logging for
debugging purposes. To turn this logging on you have
to #define MY_DEBUG in config.h.
The handler writes all logging messages to ~/.mc/debug.log.
Without #define MY_DEBUG only fatal errors is handled:
an error message is printed on the screen
and program aborts with a core dump.

IMO this logging framework can be used in other parts
of MC as well.


IMPORTANT NOTE!

The patch is big and complex
(that's why I've called it "megapatch"),
so it should be applied AFTER the new release,
but BEFORE cleaning from GNOME.

If we clean from GNOME before applying the patch
it would be wery difficult to apply it
cause HUGE changes in the source core.


The patch itself is located at
http://www.sama.ru/~despair/mc-multiscreen-patch-0.1.tar.gz


Enjoy it!


Regards, Walery




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