From cd77f3bbebf34e41a8d52f36fd06ac9c6d44a98e Mon Sep 17 00:00:00 2001
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Date: Sun, 24 Jan 2021 04:45:51 -0600
Subject: Add -w/-T options.
---
src/args.c | 18 ++++++++++++++++++
src/args.h | 2 ++
src/editor/editwidget.c | 9 +++++++++
3 files changed, 29 insertions(+)
diff --git a/src/args.c b/src/args.c
index 3f6a8b2a4..df49bbd94 100644
a
|
b
|
|
46 | 46 | |
47 | 47 | /*** global variables ****************************************************************************/ |
48 | 48 | |
| 49 | gboolean mc_args__cascade = FALSE; |
| 50 | gboolean mc_args__tile = FALSE; |
| 51 | |
49 | 52 | /* If true, assume we are running on an xterm terminal */ |
50 | 53 | gboolean mc_args__force_xterm = FALSE; |
51 | 54 | |
… |
… |
static const GOptionEntry argument_main_table[] = { |
178 | 181 | }, |
179 | 182 | #endif /* ENABLE_VFS_SMB */ |
180 | 183 | |
| 184 | /* options for non-fullscreen mcedit startup */ |
| 185 | { |
| 186 | "cascade", 'w', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, |
| 187 | &mc_args__cascade, |
| 188 | N_("Start editor with windows arranged in cascade"), |
| 189 | NULL |
| 190 | }, |
| 191 | |
| 192 | { |
| 193 | "tile", 'T', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, |
| 194 | &mc_args__tile, |
| 195 | N_("Start editor with windows tiled"), |
| 196 | NULL |
| 197 | }, |
| 198 | |
181 | 199 | { |
182 | 200 | /* handle arguments manually */ |
183 | 201 | "view", 'v', G_OPTION_FLAG_IN_MAIN | G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, |
diff --git a/src/args.h b/src/args.h
index 616864d00..69b25ec16 100644
a
|
b
|
extern gboolean mc_args__force_xterm; |
22 | 22 | extern gboolean mc_args__nomouse; |
23 | 23 | extern gboolean mc_args__force_colors; |
24 | 24 | extern gboolean mc_args__nokeymap; |
| 25 | extern gboolean mc_args__cascade; |
| 26 | extern gboolean mc_args__tile; |
25 | 27 | extern char *mc_args__last_wd_file; |
26 | 28 | extern char *mc_args__netfs_logfile; |
27 | 29 | extern char *mc_args__keymap_file; |
diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c
index 41d9bc5da..d1a41de45 100644
a
|
b
|
edit_files (const GList * files) |
1387 | 1387 | ok = ok || f_ok; |
1388 | 1388 | } |
1389 | 1389 | |
| 1390 | if (mc_args__cascade) |
| 1391 | { |
| 1392 | edit_window_cascade (edit_dlg); |
| 1393 | } |
| 1394 | else if (mc_args__tile) |
| 1395 | { |
| 1396 | edit_window_tile (edit_dlg); |
| 1397 | } |
| 1398 | |
1390 | 1399 | if (ok) |
1391 | 1400 | dlg_run (edit_dlg); |
1392 | 1401 | |