3 Commits

2 changed files with 70 additions and 79 deletions

View File

@@ -461,6 +461,8 @@ static void mg_create_entry (session *sess, GtkWidget *box);
static void mg_create_search (session *sess, GtkWidget *box); static void mg_create_search (session *sess, GtkWidget *box);
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
static GdkFilterReturn mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data); static GdkFilterReturn mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data);
static void mg_show_win32_emoji_panel (GtkEntry *entry);
static void mg_inputbox_icon_press (GtkEntry *entry, GtkEntryIconPosition icon_pos, GdkEvent *event, gpointer user_data);
#endif #endif
static void mg_link_irctab (session *sess, int focus); static void mg_link_irctab (session *sess, int focus);
@@ -4027,7 +4029,13 @@ mg_create_entry (session *sess, GtkWidget *box)
if (prefs.hex_gui_input_style) if (prefs.hex_gui_input_style)
mg_apply_entry_style (entry); mg_apply_entry_style (entry);
#ifdef G_OS_WIN32
g_object_set (G_OBJECT (entry), "show-emoji-icon", FALSE, NULL);
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, NULL);
g_signal_connect (G_OBJECT (entry), "icon-press", G_CALLBACK (mg_inputbox_icon_press), NULL);
#else
g_object_set (G_OBJECT (entry), "show-emoji-icon", TRUE, NULL); g_object_set (G_OBJECT (entry), "show-emoji-icon", TRUE, NULL);
#endif
if (gtk_entry_get_icon_storage_type (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY) if (gtk_entry_get_icon_storage_type (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY)
{ {
@@ -4037,6 +4045,62 @@ mg_create_entry (session *sess, GtkWidget *box)
} }
} }
#ifdef G_OS_WIN32
static void
mg_show_win32_emoji_panel (GtkEntry *entry)
{
INPUT input[4];
GdkRectangle icon_rect;
GtkWidget *widget;
GdkWindow *window;
gint pointer_x, pointer_y;
widget = GTK_WIDGET (entry);
if (gtk_widget_get_realized (widget))
{
window = gtk_widget_get_window (widget);
if (window)
{
gtk_entry_get_icon_area (entry, GTK_ENTRY_ICON_SECONDARY, &icon_rect);
gdk_window_get_root_coords (window,
icon_rect.x + (icon_rect.width / 2),
icon_rect.y,
&pointer_x,
&pointer_y);
SetCursorPos (pointer_x, pointer_y);
}
}
ZeroMemory (input, sizeof (input));
input[0].type = INPUT_KEYBOARD;
input[0].ki.wVk = VK_LWIN;
input[1].type = INPUT_KEYBOARD;
input[1].ki.wVk = VK_OEM_PERIOD;
input[2].type = INPUT_KEYBOARD;
input[2].ki.wVk = VK_OEM_PERIOD;
input[2].ki.dwFlags = KEYEVENTF_KEYUP;
input[3].type = INPUT_KEYBOARD;
input[3].ki.wVk = VK_LWIN;
input[3].ki.dwFlags = KEYEVENTF_KEYUP;
SendInput ((UINT) G_N_ELEMENTS (input), input, sizeof (INPUT));
}
static void
mg_inputbox_icon_press (GtkEntry *entry, GtkEntryIconPosition icon_pos, GdkEvent *event, gpointer user_data)
{
(void) event;
(void) user_data;
if (icon_pos != GTK_ENTRY_ICON_SECONDARY)
return;
g_signal_stop_emission_by_name (entry, "icon-press");
mg_show_win32_emoji_panel (entry);
}
#endif
static void static void
mg_switch_tab_cb (chanview *cv, chan *ch, int tag, gpointer ud) mg_switch_tab_cb (chanview *cv, chan *ch, int tag, gpointer ud)
{ {

View File

@@ -61,8 +61,6 @@ Name: "langs"; Description: "Language Interfaces"; Types: custom; Flags: disable
Name: "langs\lua"; Description: "Lua"; Types: normal custom; Flags: disablenouninstallwarning Name: "langs\lua"; Description: "Lua"; Types: normal custom; Flags: disablenouninstallwarning
Name: "langs\perl"; Description: "Perl (requires Perl 5.42)"; Types: custom; Flags: disablenouninstallwarning Name: "langs\perl"; Description: "Perl (requires Perl 5.42)"; Types: custom; Flags: disablenouninstallwarning
Name: "langs\python"; Description: "Python (requires Python 3.14.3)"; Types: custom; Flags: disablenouninstallwarning Name: "langs\python"; Description: "Python (requires Python 3.14.3)"; Types: custom; Flags: disablenouninstallwarning
Name: "deps"; Description: "Dependencies"; Types: custom; Flags: disablenouninstallwarning
Name: "deps\vcredist2015"; Description: "Visual C++ Redistributable 2015"; Types: normal minimal custom; Flags: disablenouninstallwarning
[Tasks] [Tasks]
Name: portable; Description: "Yes"; GroupDescription: "Portable Mode: Stores configuration files within install directory for portable drives."; Flags: unchecked Name: portable; Description: "Yes"; GroupDescription: "Portable Mode: Stores configuration files within install directory for portable drives."; Flags: unchecked
@@ -83,7 +81,7 @@ Root: HKCR; Subkey: "ZoiteChat.Theme\shell\open\command"; ValueType: string; Val
[Run] [Run]
Filename: "{app}\zoitechat.exe"; Description: "Run ZoiteChat after closing the Wizard"; Flags: nowait postinstall skipifsilent Filename: "{app}\zoitechat.exe"; Description: "Run ZoiteChat after closing the Wizard"; Flags: nowait postinstall skipifsilent
Filename: "http://docs.zoitechat.org/en/latest/changelog.html"; Description: "See what's changed"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked Filename: "http://docs.zoitechat.org/en/latest/changelog.html"; Description: "See what's changed"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked
Filename: "{tmp}\vcredist.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing Visual C++ Redistributable"; Components: deps\vcredist2015; Flags: skipifdoesntexist; Tasks: not portable Filename: "{tmp}\vcredist.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing Visual C++ Redistributable"; Flags: skipifdoesntexist; Tasks: not portable
Filename: "{tmp}\perl.msi"; StatusMsg: "Installing Perl"; Components: langs\perl; Flags: shellexec skipifdoesntexist; Tasks: not portable Filename: "{tmp}\perl.msi"; StatusMsg: "Installing Perl"; Components: langs\perl; Flags: shellexec skipifdoesntexist; Tasks: not portable
Filename: "{tmp}\python.msi"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable Filename: "{tmp}\python.msi"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
Filename: "{tmp}\python.exe"; Parameters: "InstallAllUsers=1 PrependPath=1"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable Filename: "{tmp}\python.exe"; Parameters: "InstallAllUsers=1 PrependPath=1"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
@@ -198,13 +196,6 @@ BeveledLabel= {#APPNAM}
[Code] [Code]
#ifndef USE_INNO_DOWNLOAD_PLUGIN #ifndef USE_INNO_DOWNLOAD_PLUGIN
var
FallbackDownloadUrls: array of String;
FallbackDownloadFiles: array of String;
function URLDownloadToFile(Caller: Integer; URL: String; FileName: String; Reserved: Integer; StatusCB: Integer): Integer;
external 'URLDownloadToFileW@urlmon.dll stdcall delayload';
// The Inno Download Plugin isn't always installed in CI environments. // The Inno Download Plugin isn't always installed in CI environments.
// Provide no-op fallback procedures so installer compilation still succeeds. // Provide no-op fallback procedures so installer compilation still succeeds.
procedure idpDownloadAfter(PageID: Integer); procedure idpDownloadAfter(PageID: Integer);
@@ -213,40 +204,10 @@ end;
procedure idpClearFiles; procedure idpClearFiles;
begin begin
SetArrayLength(FallbackDownloadUrls, 0);
SetArrayLength(FallbackDownloadFiles, 0);
end; end;
procedure idpAddFile(URL: String; Filename: String); procedure idpAddFile(URL: String; Filename: String);
var
I: Integer;
begin begin
I := GetArrayLength(FallbackDownloadUrls);
SetArrayLength(FallbackDownloadUrls, I + 1);
SetArrayLength(FallbackDownloadFiles, I + 1);
FallbackDownloadUrls[I] := URL;
FallbackDownloadFiles[I] := Filename;
end;
function idpDownloadQueuedFiles(): Boolean;
var
I: Integer;
ResultCode: Integer;
begin
Result := True;
for I := 0 to GetArrayLength(FallbackDownloadUrls) - 1 do
begin
if not FileExists(FallbackDownloadFiles[I]) then
begin
ResultCode := URLDownloadToFile(0, FallbackDownloadUrls[I], FallbackDownloadFiles[I], 0, 0);
if ResultCode <> 0 then
begin
MsgBox('Unable to download required installer dependency:' + #13#10 + FallbackDownloadUrls[I], mbError, MB_OK);
Result := False;
Exit;
end;
end;
end;
end; end;
#endif #endif
@@ -278,30 +239,8 @@ end;
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
function CheckVCInstall(): Boolean; function CheckVCInstall(): Boolean;
var
Installed: Cardinal;
begin begin
Result := False; Result := FileExists(GetSysDir() + 'vcruntime140.dll');;
if RegQueryDWordValue(HKLM64, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Installed', Installed) then
Result := Installed = 1
else if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Installed', Installed) then
Result := Installed = 1;
end;
procedure UpdateVCRedistComponentState;
var
I: Integer;
Installed: Boolean;
begin
Installed := CheckVCInstall();
for I := 0 to WizardForm.ComponentsList.Items.Count - 1 do
begin
if WizardForm.ComponentsList.ItemCaption[I] = 'Visual C++ Redistributable 2015' then
begin
WizardForm.ComponentsList.Checked[I] := not Installed;
WizardForm.ComponentsList.ItemEnabled[I] := not Installed;
end;
end;
end; end;
@@ -329,9 +268,6 @@ var
PY3: String; PY3: String;
SPELL: String; SPELL: String;
begin begin
if (CurPageID = wpSelectComponents) then
UpdateVCRedistComponentState();
if(CurPageID = wpReady) then if(CurPageID = wpReady) then
begin begin
idpClearFiles; idpClearFiles;
@@ -339,12 +275,12 @@ begin
if not IsTaskSelected('portable') then if not IsTaskSelected('portable') then
begin begin
REDIST := 'https://github.com/ZoiteChat/gvsbuild/releases/download/zoitechat-2.18.0-pre4/vc_redist.x64.exe'; REDIST := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/vcredist_2015_x64.exe';
PERL := 'https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54201_64bit/strawberry-perl-5.42.0.1-64bit.msi'; PERL := 'https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54201_64bit/strawberry-perl-5.42.0.1-64bit.msi';
PY3 := 'https://www.python.org/ftp/python/3.14.3/python-3.14.3-amd64.exe'; PY3 := 'https://www.python.org/ftp/python/3.14.3/python-3.14.3-amd64.exe';
SPELL := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/ZoiteChat.Spelling.Dictionaries.r2.exe'; SPELL := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/ZoiteChat.Spelling.Dictionaries.r2.exe';
if IsComponentSelected('deps\vcredist2015') and not CheckVCInstall() then if not CheckVCInstall() then
idpAddFile(REDIST, ExpandConstant('{tmp}\vcredist.exe')); idpAddFile(REDIST, ExpandConstant('{tmp}\vcredist.exe'));
if IsComponentSelected('spell') and not CheckSpellInstall() then if IsComponentSelected('spell') and not CheckSpellInstall() then
@@ -369,17 +305,6 @@ end;
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
function NextButtonClick(CurPageID: Integer): Boolean; function NextButtonClick(CurPageID: Integer): Boolean;
begin begin
Result := True;
#ifndef USE_INNO_DOWNLOAD_PLUGIN
if CurPageID = wpReady then
if not idpDownloadQueuedFiles() then
begin
Result := False;
Exit;
end;
#endif
if (CurPageID = wpSelectTasks) then if (CurPageID = wpSelectTasks) then
if (WizardForm.TasksList.Checked[1] = True) then if (WizardForm.TasksList.Checked[1] = True) then
if (WizardDirValue() = ExpandConstant('{pf64}\ZoiteChat')) then if (WizardDirValue() = ExpandConstant('{pf64}\ZoiteChat')) then
@@ -387,6 +312,8 @@ begin
WizardForm.TasksList.Checked[1] := False WizardForm.TasksList.Checked[1] := False
MsgBox('Portable mode is only intended for use on portable drives and has been disabled.', mbInformation, MB_OK) MsgBox('Portable mode is only intended for use on portable drives and has been disabled.', mbInformation, MB_OK)
end; end;
Result := True; // Always continue
end; end;
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////