Rebase against 6b205e41cf0798fd6dff7c37e9b250fc885cf792.

This commit is contained in:
Sebastian Lackner 2015-06-30 17:15:47 +02:00
parent 2da169a01b
commit 62117ba8d6
3 changed files with 4 additions and 85 deletions

View File

@ -55,7 +55,7 @@ version()
echo "Copyright (C) 2014-2015 the Wine Staging project authors."
echo ""
echo "Patchset to be applied on upstream Wine:"
echo " commit 9353a36d8fc8bb400bc2227914db0f2e60a19c24"
echo " commit 6b205e41cf0798fd6dff7c37e9b250fc885cf792"
echo ""
}
@ -4889,18 +4889,16 @@ fi
# | * [#38697] Allow to enable/disable InsertMode in wineconsole settings
# |
# | Modified files:
# | * programs/wineconsole/dialog.c, programs/wineconsole/registry.c, programs/wineconsole/winecon_private.h,
# | programs/wineconsole/wineconsole.c, programs/wineconsole/wineconsole.rc, programs/wineconsole/wineconsole_res.h
# | * programs/wineconsole/dialog.c, programs/wineconsole/wineconsole.c, programs/wineconsole/wineconsole.rc,
# | programs/wineconsole/wineconsole_res.h
# |
if test "$enable_wineconsole_Insert_Mode" -eq 1; then
patch_apply wineconsole-Insert_Mode/0001-wineconsole-Rearrange-user-dialog-to-make-space-for-.patch
patch_apply wineconsole-Insert_Mode/0002-wineconsole-Improve-semantics-of-some-poorly-worded-.patch
patch_apply wineconsole-Insert_Mode/0003-wineconsole-Add-InsertMode-to-HKCU.patch
patch_apply wineconsole-Insert_Mode/0004-wineconsole-Add-InsertMode-to-the-user-dialog.patch
patch_apply wineconsole-Insert_Mode/0003-wineconsole-Add-InsertMode-to-the-user-dialog.patch
(
echo '+ { "Hugh McMaster", "wineconsole: Rearrange user dialog to make space for InsertMode checkbox.", 1 },';
echo '+ { "Hugh McMaster", "wineconsole: Improve semantics of some poorly-worded resource strings.", 1 },';
echo '+ { "Hugh McMaster", "wineconsole: Add InsertMode to HKCU.", 1 },';
echo '+ { "Hugh McMaster", "wineconsole: Add InsertMode to the user dialog.", 1 },';
) >> "$patchlist"
fi

View File

@ -1,79 +0,0 @@
From 8ff887be7e2b57523f19534c1c83ae3e5111aa23 Mon Sep 17 00:00:00 2001
From: Hugh McMaster <hugh.mcmaster@outlook.com>
Date: Thu, 28 May 2015 21:30:08 +1000
Subject: wineconsole: Add InsertMode to HKCU
---
programs/wineconsole/registry.c | 13 +++++++++++--
programs/wineconsole/winecon_private.h | 1 +
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/programs/wineconsole/registry.c b/programs/wineconsole/registry.c
index 2805f2a..c1d04c1 100644
--- a/programs/wineconsole/registry.c
+++ b/programs/wineconsole/registry.c
@@ -40,6 +40,7 @@ static const WCHAR wszFontSize[] = {'F','o','n','t','S','i','z','e',0};
static const WCHAR wszFontWeight[] = {'F','o','n','t','W','e','i','g','h','t',0};
static const WCHAR wszHistoryBufferSize[] = {'H','i','s','t','o','r','y','B','u','f','f','e','r','S','i','z','e',0};
static const WCHAR wszHistoryNoDup[] = {'H','i','s','t','o','r','y','N','o','D','u','p',0};
+static const WCHAR wszInsertMode[] = {'I','n','s','e','r','t','M','o','d','e',0};
static const WCHAR wszMenuMask[] = {'M','e','n','u','M','a','s','k',0};
static const WCHAR wszQuickEdit[] = {'Q','u','i','c','k','E','d','i','t',0};
static const WCHAR wszScreenBufferSize[] = {'S','c','r','e','e','n','B','u','f','f','e','r','S','i','z','e',0};
@@ -48,10 +49,10 @@ static const WCHAR wszWindowSize[] = {'W','i','n','d','o','w','S','i','z'
void WINECON_DumpConfig(const char* pfx, const struct config_data* cfg)
{
- WINE_TRACE("%s cell=(%u,%u) cursor=(%d,%d) attr=%02x font=%s/%u hist=%u/%d flags=%c%c msk=%08x sb=(%u,%u) win=(%u,%u)x(%u,%u) edit=%u registry=%s\n",
+ WINE_TRACE("%s cell=(%u,%u) cursor=(%d,%d) attr=%02x font=%s/%u hist=%u/%d flags=%c%c%c msk=%08x sb=(%u,%u) win=(%u,%u)x(%u,%u) edit=%u registry=%s\n",
pfx, cfg->cell_width, cfg->cell_height, cfg->cursor_size, cfg->cursor_visible, cfg->def_attr,
wine_dbgstr_w(cfg->face_name), cfg->font_weight, cfg->history_size, cfg->history_nodup ? 1 : 2,
- cfg->quick_edit ? 'Q' : 'q', cfg->exit_on_die ? 'X' : 'x',
+ cfg->insert_mode ? 'I' : 'i', cfg->quick_edit ? 'Q' : 'q', cfg->exit_on_die ? 'X' : 'x',
cfg->menu_mask, cfg->sb_width, cfg->sb_height, cfg->win_pos.X, cfg->win_pos.Y, cfg->win_width, cfg->win_height,
cfg->edition_mode,
wine_dbgstr_w(cfg->registry));
@@ -126,6 +127,10 @@ static void WINECON_RegLoadHelper(HKEY hConKey, struct config_data* cfg)
cfg->history_nodup = val;
count = sizeof(val);
+ if (!RegQueryValueExW(hConKey, wszInsertMode, 0, &type, (LPBYTE)&val, &count))
+ cfg->insert_mode = val;
+
+ count = sizeof(val);
if (!RegQueryValueExW(hConKey, wszMenuMask, 0, &type, (LPBYTE)&val, &count))
cfg->menu_mask = val;
@@ -175,6 +180,7 @@ void WINECON_RegLoad(const WCHAR* appname, struct config_data* cfg)
cfg->font_weight = 0;
cfg->history_size = 50;
cfg->history_nodup = 0;
+ cfg->insert_mode = 1;
cfg->menu_mask = 0;
cfg->quick_edit = 0;
cfg->sb_height = 25;
@@ -245,6 +251,9 @@ static void WINECON_RegSaveHelper(HKEY hConKey, const struct config_data* cfg)
val = cfg->history_nodup;
RegSetValueExW(hConKey, wszHistoryNoDup, 0, REG_DWORD, (LPBYTE)&val, sizeof(val));
+ val = cfg->insert_mode;
+ RegSetValueExW(hConKey, wszInsertMode, 0, REG_DWORD, (LPBYTE)&val, sizeof(val));
+
val = cfg->menu_mask;
RegSetValueExW(hConKey, wszMenuMask, 0, REG_DWORD, (LPBYTE)&val, sizeof(val));
diff --git a/programs/wineconsole/winecon_private.h b/programs/wineconsole/winecon_private.h
index eec4171..2178dd0 100644
--- a/programs/wineconsole/winecon_private.h
+++ b/programs/wineconsole/winecon_private.h
@@ -36,6 +36,7 @@ struct config_data {
DWORD font_weight;
DWORD history_size; /* number of commands in history buffer */
DWORD history_nodup; /* TRUE if commands are not stored twice in buffer */
+ DWORD insert_mode; /* TRUE to insert text at the cursor location; FALSE to overwrite it */
DWORD menu_mask; /* MK_CONTROL MK_SHIFT mask to drive submenu opening */
DWORD quick_edit; /* whether mouse ops are sent to app (false) or used for content selection (true) */
unsigned sb_width; /* active screen buffer width */
--
2.4.1