Commit Graph

180 Commits

Author SHA1 Message Date
Andrew Borodin
7e6ff9caf9 Allow override standard dialog actions in some dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:55 +03:00
Andrew Borodin
dc3d161e71 Don't get dialog hotkey from disabled widget.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:55 +03:00
Andrew Borodin
65d9697d69 Fixed widget redraw order in dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:55 +03:00
Andrew Borodin
8bbad1dbfb Menu hack to keep overlapped widgets order
...required in multi-window editor.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:55 +03:00
Andrew Borodin
fe34f89a19 Added dlg_set_top_widget() function
...to move widget to the top of widget list and make it current.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:55 +03:00
Andrew Borodin
6ad4b2466b Allow add and remove widgets in runtime.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:55 +03:00
Andrew Borodin
33d25a0c8f Put global mouse coordinates to widgets.
Now each widget gets absolute coordinates of mouse pointer and decides
itself how to handle them.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:55 +03:00
Andrew Borodin
7956b64e54 Fix mouse handling in dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:55 +03:00
Andrew Borodin
c3f359c82b Ticket #2608: widget enhancements.
New method of widget ID assignment:
now widget ID is a value of unsigned long type. Dlg_head structure now has
new filed widget_id that contains a ID of the next added widget. When new
widget is added into dialog, widget_id is set as ID of it and then
incremented.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:55 +03:00
Slava Zanko
2b5c28b316 Changes to handle vfs_path_t object:
* removed strip_password () function;
 * Added new vfs_path flag: VPF_HIDE_CHARSET;
 * added vfs_path_add_element() function.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:31 +03:00
Slava Zanko
8562a215be Code refactoring: removed concat_dir_and_file() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:30 +03:00
Slava Zanko
034252a71a Changed interface of function mc_opendir()
...to handle vfs_path_t object as parameter.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:24 +03:00
Slava Zanko
eeaad790ab Changed interface of mc_stat() and mc_lstat() functions
...to handle vfs_path_t object as parameter.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:24 +03:00
Andrew Borodin
bff2736906 Support of disable of shell variables substitution in autocompletion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-02-24 09:39:04 +03:00
Andrew Borodin
d412b1ec8f (history_put): unused. Removed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-12-12 12:23:25 +03:00
Andrew Borodin
d99feea391 Ticket #2678: fixup of filemanager layout after screen resize.
Initial state: forced suspend the previous screen when new screen has
been created. Forced resume the current screen when the previous screen
has been closed. Don't redraw suspended screens, just set sinch_pending
flag. Screen will be redrawn immediately after resume.

This commit allow ret rid of setup_panels() call if screen is resized
and filemanager is not active screen at that time.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-12-07 16:02:20 +03:00
Slava Zanko
6c32fa3b84 Added function mc_config_get_full_path() for search user's config files by short names.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-12-06 16:24:10 +03:00
Ilia Maslakov
e1231e3d8e Ticket #2653 (fixed: input password)
Fixed: input field in password mode is fully masked with asterisks.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-11-03 16:46:31 +04:00
Slava Zanko
0138645541 Ticket 1551: Update GPL version from 2 to 3
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-10-18 14:08:34 +03:00
Andrew Borodin
cef8eb5cc4 (mc_refresh): moved from lib/widget/wtools.[ch] to lib/widget/dialog-switch.[ch]
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-10-17 13:30:03 +03:00
Andrew Borodin
8f4b9e32f1 Remove extra screen update after show help.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-10-17 13:30:03 +03:00
Andrew Borodin
f68b35b475 (try_complete): fixed warinig:
input_complete.c:874:26:  warning: use of logical && with constant
operand; switch to  bitwise & or remove constant
[-Wconstant-logical-operand]
    if (q && q[1] == '(' && INPUT_COMPLETE_COMMANDS)
                         ^  ~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-09 12:01:56 +03:00
Andrew Borodin
cd1e5fb76d Nice location of red (warning and error) dialogs.
Now warning/error dialog overlaps the previous status dialog.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-09 12:01:56 +03:00
Andrew Borodin
bb8babce1e (dlg_find_by_id): use the GLib way to find widget.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-09 12:01:56 +03:00
Andrew Borodin
db2fa05e27 (menubar_arrange): fixed typos.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-09 12:01:56 +03:00
Andrew Borodin
ba86de945c Optimization of walking in dialog widgets.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-09 12:01:55 +03:00
Slava Zanko
bfbe9b94ae Removed global variable slow_tty
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-09-08 14:12:10 +04:00
Andrew Borodin
387bad2c7e Move SIGWINCH handler initialization to tty_init()
... and rename tty_low_level_change_screen_size() to
tty_change_screen_size().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-08 14:11:51 +04:00
Andrew Borodin
c4b95bcd32 Ticket #2576: fix of symbols duplication.
dialog_map, input_map and listbox_map variabels are declared and defined twice.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-14 21:46:59 +04:00
Andrew Borodin
17033652ee Revert "Ticket #2453: aggressive screen repaint"
This reverts commit f809e6cf7a.

While navigating in main menu (from one submenu to another one)
or after closing a dialog, the screen is blinking.
2011-07-09 20:39:46 +04:00
Slava Zanko
63c0f34dce Direct commit: Fixed double memory free in input histoey list.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-09 11:55:30 +03:00
Andrew Borodin
f3fefa67f6 (push_history): fixed memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-08 20:48:53 +04:00
Andrew Borodin
630bcae4d4 (input_destroy): optimization: don't do useless actions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-08 20:48:53 +04:00
Andrew Borodin
de5fac8d0a Ticket #2545: fixup of saving WInput history.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-08 20:48:53 +04:00
Andrew Borodin
f809e6cf7a Ticket #2453: aggressive screen repaint
... to avoid artefacts after printing of non-printable symbols.

(tty_touch_lines): new function to mark modified lines of screen.
(do_refresh): mark lines as modified before redraw of non-fullscreen dialog
and clear entire screen before redraw of fullscreen dialog.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-08 13:51:41 +04:00
Andrew Borodin
5ffcffbeb6 Optimization of history saving.
Now history is not saved if it was not modified and content of input
line is equal to history top entry. Thanks Francesco Cosoleto
<cosoleto at gmail dot com> for the original patch.

Also fixed a regression introduced in cff5925598:
after CK_HistoryNext and CK_HistoryPrev actions in input line,
the input line content is not put to the top of history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-07 14:19:15 +04:00
Andrew Borodin
1a343a1a47 Type accuracy and some clean up.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-07 14:19:15 +04:00
Andrew Borodin
166281c39a Ticket #2545: optimization of history saving.
(hist_next): get rid of direct access to the next histroy item.
(history_show): remove redundant check.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-07 14:19:15 +04:00
Andrew Borodin
82b27ead4d Optimization of history load.
Formerly, each widget loaded its history self in its constructor.
Thus, history file was read as many times as many widgets with history
are in dialog.

Now all widget histories are read from ${XDG_CACHE_HOME}/mc/history
file at one time after dialog initialization.

The ev_history_load_save_t event is apllied to load  histories.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin
cff5925598 Optimization of history save.
Formerly, each widget saved its history self in WIDGET_DESTROY stage.
Thus, history file was read and written as many times as many widgets
with history are in dialog.

Now all widget histories are written to ${XDG_CACHE_HOME}/mc/history
file at one time before dialog destruction.

An ev_history_load_save_t event type is created to use new event engine
to save histories.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin
3aa74a2320 Added event_group member to the Dlg_head structure
...to start use the new event engine in widgets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin
7d469f841c (history_save): new function to save widget history
...to some in-memory created config without write it to file.

(history_put): now uses history_save().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin
05ae0b187d Ticket #2459: if active panel changed type from file listing to info, inactive panel is not become active.
How to reproduce:

1. Run mc.
2. Change both panels to listing modes.
3. Switch to the right panel.
4. Switch type of active right panel to info using menu.

Result: left panel is not active.
Expected result: left panel must become active.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-05-04 17:07:25 +04:00
Andrew Borodin
47115e97ad Fix of terminal resize handling
...and fix of <sys/ioctl.h> includes
and includes cleanup in src/filemanager/layout.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin
d92a2a4fd6 Get rid of some function forward declarations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin
330e3c60bc Dlg_head::parent is unused. Removed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin
f83bdadfa8 Ticket #2520: SIGINT generated by Ctrl-g pressing closes file panels.
When SIGINT signal is raised, the CK_Cancel message is handled by
dlg_execute_cmd() and midnight_dlg is closed.

The solution: CK_Cancel is sent to current dialog via callback, and if
current dialog doesn't handle CK_Cancel message, then handle it with common
way using dlg_execute_cmd().

Since Ctrl-g is used to generate SIGINT in MC, remove this shortcut from
all sections of keymaps except the [dialog] section.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-30 16:17:16 +04:00
Pavel Vasilyev
f4cbe4a4f3 Ticket #2515: Unused variable if without WITH_BACKGROUND
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-25 14:19:40 +01:00
Slava Zanko
f40887c3c6 Lib: removed includes to "src" directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
6621250292 Added events for handle parent_call_string() and parent_call()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
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
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
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
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
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
912c62f564 Ticket #2459: switch to the left panel after mouse click on input line history pictogram.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-01-24 20:42:38 +03:00
Slava Zanko
c8982e822c Updated docs (man pages and comments in source code)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-20 17:38:27 +02:00
Slava Zanko
acbe048486 Ticket #1851: Home config directory [xdg-user-dirs]
Instead of hardcoded (via MC_USERCONF_DIR) path mc mc now used
dynamic directories specified by environment variables:
 * XDG_CONFIG_HOME - dir for config files . By default is ~/.config/mc
 * XDG_DATA_HOME - dir for some data, such as user defuned Syntax file, menu etc By default is ~/.local/share/mc
 * XDG_CACHE_HOME - dir for temp files, such as cooledit.clip etc. By default is ~/.cache/mc

This is mainstream standard already adopted by many projects.

Old settings will be migrated at first time from ~/.mc to these dirs.

See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html for more info.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-01-20 17:38:27 +02:00
Vladislav Grishenko
73eae56a99 Ticket #1634 (BS, Del incorrect works in CP866 locale)
fixed trouble with BS and Del in dialog input fields (in CP866 locale).

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-01-05 23:09:53 +00:00
Andrew Borodin
4c83f8b4df (panel_save_curent_file_to_clip_file): 'res' might be used uninitialized here.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-28 09:10:43 +03:00
Andrew Borodin
65d4e1752d (input_key_is_in_map): don't execute any input actions here.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-12-23 13:24:50 +03:00
Andrew Borodin
6e6ec057cb Avoid compiler warnings.
(file_mask_dialog): do_background argument shadows do_background()
function; renamed to do_bg.

(label_callback): unitialized variable.

(read_filesystem_list): const char *.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-12-02 22:12:56 +03:00
Andrew Borodin
d8ce7e5e4e Include stdio.h for fprintf().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-02 21:59:42 +03:00
Andrew Borodin
380d9bd885 Ticket #2171: colors for popup menu:
... for menu items, selected menu item and for menu title.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-02 09:55:59 +03:00
Slava Zanko
bbf1f4e857 Moved filemanager-related stuff to src/filemanager directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:32 +03:00
Andrew Borodin
fdb61594df Cleanup of main.[ch].
All file panels related stuff was moved to midnight.[ch].

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Slava Zanko
08e9759283 Split file src/keybind.[ch] to lib/keybind.[ch] and src/keybind-defaults.[ch].
File src/cmddef.h now merged to lib/keybind.h

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:31 +03:00
Slava Zanko
62f3c368c9 Renamed keybind-related functions:
* lookup_action          -> keybind_lookup_action
* lookup_keymap_shortcut -> keybind_lookup_keymap_shortcut
* lookup_keymap_command  -> keybind_lookup_keymap_command

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Andrew Borodin
139fdaa6bd History optimization.
Don't create conversion handler for each history line while reading
and saving history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:31 +03:00
Andrew Borodin
3d92a0846a Menu improvements.
menubar_set_visible(): new function to get rid of menubar_visible global variable
in widgtes library.

menu_set_name(): new function to avoid total recreation of main menu
after change panel layout.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
f24dd62dc2 Use str_msg_term_size() instead of msglen()
... because msglen() is not tolerant to multi-byte encodings.
Remove msglen() because it unused now.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
71364f88c3 Split lib/widget/widget.[ch] and lib/widget/wtools.[ch] files
...into small: one widget in one file.
Renamed most if WInput functions.
Minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
8d1708225c Don't include lib/util.h via lib/global.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Slava Zanko
8b018db98f Some WIDGET-related stuff moved to lib/widget directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:30 +03:00