Commit Graph

10871 Commits

Author SHA1 Message Date
Slava Zanko
a01b8edd7a Use events for suspend mc (by pressing on CTRL+Z)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
aad40e52fb Moved mc_refresh() to lib/widget
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
5f8a5e4290 Use events for calling help window
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
62207c8d4d Use events for operate with clipboard (copy/paste to external clipboard, save/load to file)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
c2dfb82f61 Use events for update panels
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
3634716374 Moved input_map, listbox_map and dialog_map variables to 'lib' subdirectory.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
0f93e313df src/background.c: added some forgotten va_end() calls
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
c58365fa64 Move check_for_default() function from lib/util.c to src/util.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
7dad2df6a8 Moved initialization of mc_global.share_data_dir and mc_global.sysconf_dir to library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
e784cf65a5 Move src/filemanager/complete.c to lib/widget/input_complete.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
5a458c702d Use events to show VFS messages.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
746653fda2 Removed mc_main_error_quark() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
4005b7924e Use events to check timestamp of panel directories
...instead of direct access to panels in VGS GC.

Inlcudes clean up.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
6016620f42 Remove backlinks from lib to src - move global variables(used in lib) to mc_global structure (see lib/global.c)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:50 +02:00
Slava Zanko
6c5f5bf768 VFS structure changes:
* moved from lib/vfs/mc-vfs to lib/vfs;
  * split by directories for VFS-plugins and moved to src/vfs;
  * lib/vfs/vfs-impl.h was merged into lib/vfs/vfs.h.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 11:48:26 +02:00
Slava Zanko
d512649b33 Prepare to initialize application events.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 11:46:41 +02:00
Slava Zanko
a5195d285a Added new engine for universal event system.
Example:

gboolean mkdir_callback(const gchar *event_group, const gchar *event_name, gpointer init_data, gpointer event_data)
{
    ... /* some action for handle event */
    return TRUE; /* got chance to run other callbacks for this event or */
    return FALSE; /* break execution for other callbacks */
}

mc_event_add ("filesystem", "mkdir", mkdir_callback, "some init data", NULL);
mc_event_add ("filesystem", "mkdir", mkdir_log_callback, "some init data", NULL);
mc_event_add ("filesystem", "mkdir", third_callback, NULL, NULL);

/*
    Last add - first run. In this case execution order is
 * third_callback
 * mkdir_log_callback
 * mkdir_callback
 if third_callback fuctions will return FALSE, then other callbacks
 (mkdir_log_callback and mkdir_callback) never run!
*/

... /* some code */

/* for example, after pressing F7 */
mc_event_raise("filesystem", "mkdir", "some event_data... path to directory");

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 11:46:40 +02:00
Slava Zanko
fc7142d2a0 Ticket #2501: 'lib' should be independ to 'src' directory
Added base support for unit tests (see http://check.sourceforge.net/ for details).

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 10:30:27 +02:00
Andrew Borodin
b67d0c0b92 Merge branch '2511_simplify_keybindings'
* 2511_simplify_keybindings:
  Symbolic names of keymap sections are defined.
  Change hardcoded definitions of default keymap.
  Allow remove key with empty value from target config.
  Prepare to merge default and user-defined keymaps.
  Added --nokeymap command line option to disable load keybindings from file.
  Define keybind numbers using enum.
  Fixup of shift-arrow mark in editor.
  Unification of keybinding names.
  Ticket #2511: simplification and unification of keybinding names.
2011-03-20 19:36:26 +03:00
Andrew Borodin
5ef6375120 Symbolic names of keymap sections are defined.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
b3d0a9237b Change hardcoded definitions of default keymap.
Now default key bindings are hardcoded as strings like values in keymap
file. Such presentation of key bindings allows simplify keymaps merge
when new bindings are added, replaced or removed old ones during MC
initialization.

Previously, to rebind some keys, used must redefine the entire section
where that bindings are in. New merge algorithm doesn't require the
redefinition of entire section in user's keymap file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
6484b1dce7 Allow remove key with empty value from target config.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
35b429f625 Prepare to merge default and user-defined keymaps.
default_main_map and default_main_x_map renamed to
default_main_keymap and default_main_x_keymap respectively to unified
variable names.

Editor: setup keymaps only once for all editors.
Viewer: share single keymap array for all viewers.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
4fbdbd4456 Added --nokeymap command line option to disable load keybindings from file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-20 19:26:08 +03:00
Andrew Borodin
722121a575 Define keybind numbers using enum.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
1374340aa2 Fixup of shift-arrow mark in editor.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
50de02cfe4 Unification of keybinding names.
Most of keybind names are changed to unify that names.
Details see in doc/keybind-migration.txt file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
68a8745f6d Ticket #2511: simplification and unification of keybinding names.
Added doc/keybind-migration.txt file to describe new keybinding names
used in mc.keymap.* files in 4.8.x series.
Cosmetics: reordering of keymap section declarations to provide identical
order totally in the source tree.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Ilia Maslakov
7e87dd7024 Merge branch '2512_usermenu_fix'
* 2512_usermenu_fix:
  replaced #interactive to #silent into misc/macros.d/*
  changed mcedit.1.in. replaced directive #interactive to #silent.
  Ticket #2512 (fixup for usermenu)
2011-03-17 20:22:01 +00:00
Ilia Maslakov
c7638e1a75 replaced #interactive to #silent into misc/macros.d/*
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-03-17 16:17:03 +00:00
Ilia Maslakov
91b234bbfe changed mcedit.1.in. replaced directive #interactive to #silent.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-03-17 16:17:02 +00:00
Ilia Maslakov
4015e14aff Ticket #2512 (fixup for usermenu)
Fixed user menu behaviour. MC hangs if menu entry contains the 'read' command or something like that.
    bug introduced in the Ticket #323 (changeset: 0cfbe19d96).

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-03-17 16:12:12 +00:00
Ilia Maslakov
3fec8a4282 Merge branch '2504_vertical_persistent_block_mark'
* 2504_vertical_persistent_block_mark:
  mark inserted from file
  Ticket #2504 (Verical block is unmarked after copy/move)
2011-03-17 08:52:04 +00:00
Ilia Maslakov
ecd8ca2292 mark inserted from file
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-17 08:50:52 +00:00
Ilia Maslakov
dc6bd875c4 Ticket #2504 (Verical block is unmarked after copy/move)
Now mark of vertical block is not reset after copy/move. This make easy many copies/movements.
    Do nothing if cursor is in first line of selection.
2011-03-17 08:50:52 +00:00
Ilia Maslakov
bc3c848ab1 Added two macro examples:
* macro.6.sh - execute selected block
    * macro.7.sh - delete trailing whitespaces

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-03-07 14:06:38 +03:00
Slava Zanko
bdf5543950 Direct commit: fixed visibility scope for global variable GArray *macros_list
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-04 11:53:30 +02:00
Ilia Maslakov
0cfbe19d96 Merge branch '323_editor_macros'
* 323_editor_macros:
  (mc_config_init): don't drop file name if file is not exist.
  added examples     added rules for misc/macros.d/*. in the process of installation, example scripts will be copied into share/mc/examples/macros.d
  added check for instruction "#interactive" in the script. if the external script contain #interactive then do show prompt.
  changed mcedit.1.in
  Fix cursor position after execution of external script.
  Changed engine of external macros execution
  added a new action "Record and Repeat commands", added menu entry (Record/Repeat actions) for this.
  Removed unneeded menu entries.
  Added lookup_key_by_code, now parameter is string.
  Ticket #323 (reimplimented editor macros)
2011-03-03 20:53:34 +00:00
Andrew Borodin
f28ec51c77 (mc_config_init): don't drop file name if file is not exist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-03 20:48:31 +00:00
Ilia Maslakov
04d54931d0 added examples
added rules for misc/macros.d/*. in the process of installation, example scripts will be copied into share/mc/examples/macros.d

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-03-03 20:48:31 +00:00
Ilia Maslakov
b642e2e1e1 added check for instruction "#interactive" in the script.
if the external script contain #interactive then do show prompt.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-03 20:48:30 +00:00
Ilia Maslakov
4438117628 changed mcedit.1.in
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-03 20:48:30 +00:00
Ilia Maslakov
b58e7e64fc Fix cursor position after execution of external script.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-03-03 20:48:30 +00:00
Ilia Maslakov
d31116328a Changed engine of external macros execution
Now "EditPipeBlock (X)" action tries execute the
~/.local/share/mc/mcedit/macros.d/macro.X.sh script.
To bind action EditPipeBlock (X) to the any hotkey you need add this binding
into ~/.local/share/mc/mc.macros file like following:

[editor]
ctrl-Q=EditWordLeft:-1;EditWordRightHighlight:-1;EditPipeBlock:3;
ctrl-W=EditPipeBlock:1;

This means that "ctrl-W" hotkey initiates the EditPipeBlock (1) action,
editor handler translates this into execution of
~/.local/share/mc/mcedit/macros.d/macro.1.sh shell script.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-03 20:48:30 +00:00
Ilia Maslakov
83177cfc16 added a new action "Record and Repeat commands", added menu entry (Record/Repeat actions) for this.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

some fixes

Signed-off-by: Slava Zanko <slavazanko@gmail.com>

and one more fix

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-03 20:45:07 +00:00
Ilia Maslakov
6066713f77 Removed unneeded menu entries.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-03-02 11:16:55 +00:00
Ilia Maslakov
8e22a16430 Added lookup_key_by_code, now parameter is string.
For example: "ctrl-w=action:code;action:code;action:code;"

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-02 11:16:54 +00:00
Ilia Maslakov
8509b74f73 Ticket #323 (reimplimented editor macros)
Reimplemented editor macro engine:

    * added string binding "InsertChar" for action - "CK_Insert_Char"
    * added keybind_lookup_actionname - found action name by numeric constant
    * replaced struct macro to struct macro_action_t
    * added struct macros_t for describe editor scripts
    * rewritten edit_load_macro_cmd, edit_execute_macro
    * renamed edit_save_macro_cmd into edit_store_macro_cmd (WEdit * edit);
    * dropped Wedit properties: macro_i, macro_depth, macro[MAX_MACRO_LENGTH]
    * added GArray *macros_list to the store macroses of mcedit
    * added edit_get_macro

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-02 11:16:44 +00:00
Andrew Borodin
1636f8e956 Merge branch '2509_diff_quick_move'
* 2509_diff_quick_move:
  Ticket #2509: missed names of CK_DiffQuickLeft and CK_DiffQuickRight actions
2011-03-02 11:00:17 +03:00
Tomasz Pala
eaf889a3a2 Ticket #2509: missed names of CK_DiffQuickLeft and CK_DiffQuickRight actions
...used in keymap files.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-02 10:43:36 +03:00