Commit Graph

52 Commits

Author SHA1 Message Date
Andrew Borodin
04f04ba130 Send new widget size as parameter of MSG_RESIZE message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:15:37 +03:00
Andrew Borodin
045816ed13 (dlg_set_position): use WRect.
(widget_set_size_rect): new API.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:15:37 +03:00
Andrew Borodin
22ad70ed02 Move widget add/del API from WDialog to WGroup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:11:55 +03:00
Andrew Borodin
31b37a1f79 Ticket #4050: code cleanup before 4.8.25 release.
Update copyright years.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
21376ec1e9 (history_show): fix order of history items.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-29 15:11:53 +03:00
Andrew Borodin
29110e5681 Move history operation routines from lib/widget/history.c to lib/mcconfig/history.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-01 19:41:12 +03:00
Andrew Borodin
c4668b56f7 history: refactoring.
Prepare to support CK_Delete in editor and viewer history.
The filepos file contains file positions and bookmarks. We must keep
them.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-08-10 09:45:27 +03:00
Andrew Borodin
0f02d49b0d (history_show): port to WListbox keybindings.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-08-10 09:45:27 +03:00
Andrew Borodin
b81e4aac55 (history_show): rename variable.
(history_dlg_data): rename member.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-08-10 09:45:27 +03:00
Andrew Borodin
644d72fed2 (history_show): constify argument.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-08-10 09:45:27 +03:00
Andrew Borodin
2fce07a7e1 (listbox_set_list): change argument type. 2019-08-10 09:45:27 +03:00
Ilia Maslakov
87428aa8ea added new keybindings (F3, F4) in history list.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2019-08-10 09:45:27 +03:00
Andrew Borodin
1dd8a47987 Ticket #3955: code cleanup before 4.8.23 release.
Update copyright years.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 12:44:40 +03:00
Andrew Borodin
ddd645526a Update copyright years. 2018-02-04 11:30:22 +03:00
Andrew Borodin
e9fd11bfcd Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 19:12:55 +03:00
Andrew Borodin
b4af91dfc0 Reorganize WDialog flags.
* DLG_FULLSCREEN: move and rename to WPOS_FULLSCREEN.
 * DLG_CENTER: move and rename to WPOS_CENTER.
 * DLG_TRYUP: move and rename to WPOS_TRYUP.
 * WDialog::fullscreen: remove, use WPOS_FULLSCREEN instead.
 * WDialog::compact: new field. Use instead of DLG_COMPACT.
 * WDialog:🎏 remove.
 * dlg_flags_t: remove.
 * dlg_create: add new agruments: pos_flags, compact. Remove
argument: flags.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-06-02 20:41:00 +03:00
Andrew Borodin
0933b08964 (dlg_set_position): minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-06-02 20:34:38 +03:00
Andrew Borodin
bc14ff44c8 Remove min() and max() macros. Use MIN() and MAX() macros from GLib.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Yury V. Zaytsev
a8f512c12c Remove unneeded struct keyword for typedef'd structs
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-04 09:23:38 +03:00
Andrew Borodin
471ea781ca Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:10 +03:00
Andrew Borodin
70fa973f47 Fix typos.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:21 +03:00
Andrew Borodin
b698b7e834 Ticket #3435: clang compiler fixes/cleanups.
Since O_* macros are used in lib/global.h, include <fcntl.h> there.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:49 +03:00
Andrew Borodin
454479549c Update copyright years. 2015-02-26 09:12:08 +03:00
Andrew Borodin
e5203cb023 Fix name of FSF in all *.c files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-28 13:33:17 +04:00
Andrew Borodin
f0da49345a Collapse list of copyright years to ranges. Add 2014 year.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin
7df67031a2 Refactoring of WListbox widget.
Use GQueue instead of GList to store listbox entries.

g_list_append() function is slow because it uses g_list_last()
internally to traverse from the beginning to the end of a list, so
forming a list of results has O(n*n) complexity instead of O(n).
GQueue contains pointers to head and tail of list and list length.
So in this case we don't need seach end of list every time when we
want append listbox entry to the listbox.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-01-14 14:13:38 +04:00
Andrew Borodin
29f6dd2a84 Use g_list_free_full().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Slava Zanko
0d489acd58 cppcheck: reduce variable scope.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Andrew Borodin
48abe8735f Rename functions:
init_widget -> widget_init
create_dlg -> dlg_create
init_dlg -> dlg_init
run_dlg -> dlg_run
destroy_dlg -> dlg_destroy

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin
2ec122bc05 Add useful macros for widget type cast.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:44:14 +04:00
Andrew Borodin
665d238ffa Unify widget and dialog message handling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:44:14 +04:00
Andrew Borodin
843dcd104e Rename Dlg_head to WDialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:42:47 +04:00
Andrew Borodin
0078874613 Rename default callbacks of widget and dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:42:47 +04:00
Andrew Borodin
2a95cb2ffd Ticket #2919: widget system improvements and unifications.
First step: derive dialog from widget.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:42:44 +04:00
Andrew Borodin
8b382756bf Use g_strndup() instead of g_strdup()
...to ret rid of extra calculation of string length.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-09-10 14:29:53 +03:00
Andrew Borodin
908e747861 Optimization of ini files load.
Some ini files (keymaps, skins) are loaded in read-only mode. For those
files, we don't need load and keep comments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-31 14:50:11 +04:00
Andrew Borodin
c813d1baad Handle history of input line.
Added pointer to the current history item and use to walk in history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-06-11 15:02:19 +04:00
Andrew Borodin
83e3945c24 Ticket #2817: add mouse handler to the dialog.
Currently, dialog itself doesn't handle mouse events. It just
resends mouse event to each its widget. If we can several overlapped
widgets (especially, menu bar), there is some problem to decide which
widget must get event at first.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-05-30 13:23:12 +04: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
d412b1ec8f (history_put): unused. Removed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-12-12 12:23:25 +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
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
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
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
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
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
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