Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ src/plugins/zip/vcxproj/salamander/Debug_x64
src/vcxproj/salamander/Debug_x64
src/vcxproj/salmon/salamander/Debug_x64
src/vcxproj/sqlite/salamander/Debug_x64
src/vcxproj/salamander/Release_x64
src/vcxproj/salmon/salamander/Release_x64
src/vcxproj/sqlite/salamander/Release_x64
**/Intermediate/
*.obj
*.pdb
*.exe
*.res
*.tlog
*.recipe
*.iobj
*.ipdb
*.log
*.err
rebuild_times.log
src/vcxproj/rebuild_debug_x86.log
src/vcxproj/rebuild_debug_x86.log.err
Expand All @@ -69,3 +83,7 @@ nul
tmpclaude*
*.bak
*.backup

# Wyjątek dla gotowego instalatora

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no folder "instalator" or it should have been empty. Files should be part of release (see GitHub project releases). There should be no Polish titles or comments because it is very expensive to locate them and remove.

!Instalator/
!Instalator/**
67 changes: 67 additions & 0 deletions Instalator/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Software License Agreement for Taskscape Ltd Salamander.

This is a legal agreement ("Agreement") between you (either an individual or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to Taskscape Ltd instead of "ALTAP"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

an entity) and Taskscape Ltd, spol. s r.o. ("Taskscape Ltd") for the Taskscape Ltd software product
("Software") with which this Agreement is provided, including associated
media, printed materials, and "online" or electronic documentation. The
term "Software" also shall include any updates or modified versions of the
Software provided to you by Taskscape Ltd.

The Software is protected by copyright and other intellectual property
laws and by international treaties. The Software is licensed, not sold.
The Software is designed and provided to you as a single product to be
used as a single product on computers. You are not required to use all
component parts of the Software, but you may not unbundle the component
parts of the Software for use on different computers.

By copying, installing or using all or any portion of the Software you
accept all the terms and conditions of this agreement. If you do not
agree to the terms of this Agreement, do not use the Software.

ADD-ON COMPONENTS
Taskscape Ltd Salamander may contain certain add-on components ("Plugins"),
e.g. PictView, FTP Client, or WinSCP plugin. You may install and use
Plugins solely as part of, and in conjunction with, the Software. You
may not use Plugins in any other manner, including using Plugins with
any other application.

LICENSE
The Software including all plugins can be used free of charge for both
commercial and non-commercial purposes. Software can be installed on one
or multiple computers, including virtual machines, and used by one or
multiple users.

ADDITIONAL LICENSE TERMS
Software may be freely distributed, provided the distribution package is
not modified. You may not charge any fee for the copy or use of the Software.
You must not represent in any way that you are licensing or selling the
Software itself. Your distribution of the evaluation Software will not
entitle you to any compensation from Taskscape Ltd.

The software may contain also several third party components, including open
source components, which are provided and licensed to you under the terms
and conditions of the respective third party licenses (see Third Party
Software Notices in thirdpty.txt).

RESTRICTIONS ON USE
You may not use, copy, emulate, clone, lease, sell, rent, sublicense, lend,
modify, decompile, disassemble, otherwise reverse engineer, or transfer the
Software, or any subset of the Software, except as provided for in this
Agreement.

EXCLUSION OF OTHER WARRANTIES
The software is provided "as is" without any express or implied warranty of
any kind, including warranties of merchantability, noninfringement, or
fitness for a particular purpose. You acknowledge that software cannot be
completely error-free.

LIMITATION OF LIABILITY
In no event shall Taskscape Ltd or its suppliers be liable for any damages whatsoever
(including, without limitation, lost profits, business interruption or lost
information) arising out of the use of or inability to use the Software, even
if Taskscape Ltd has been advised of the possibility of such damages. Taskscape Ltd's or its
suppliers' total cumulative liability to you arising from this agreement is
void. Some jurisdictions prohibit exclusion or limitation of liability for
implied warranties or consequential or incidental damages, so the above
limitation may not apply to you. You may also have other legal rights that
vary from jurisdiction to jurisdiction.
Binary file added Instalator/lang/english.slg
Binary file not shown.
Binary file added Instalator/salamand.exe

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should never commit binary files. These should go to release (see github project releases)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh okey

Binary file not shown.
Binary file added Instalator/salmon.exe
Binary file not shown.
Binary file added Instalator/setup.exe
Binary file not shown.
15 changes: 15 additions & 0 deletions Instalator/setup.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Private]
ApplicationName=Salamander 5.0
ApplicationNameVer=Salamander 5.0
DefaultDirectory=C:\Program Files\Salamander 5.0
LicenseFile=LICENSE
SkipChooseDirectory=0

[CopyFiles]
salamand.exe,%1\salamand.exe,0
salmon.exe,%1\salmon.exe,0
lang\english.slg,%1\lang\english.slg,0

[CreateShortcuts]
0,Altap Salamander 5.0,%1\salamand.exe,
1,Altap Salamander 5.0,%1\salamand.exe,
1 change: 1 addition & 0 deletions Instalator/x64
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a marker file for x64 installation.
6 changes: 4 additions & 2 deletions src/consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,8 @@ BOOL LookForSubTexts(char* text, DWORD* varPlacements, int* varPlacementsCount);
void MinimizeApp(HWND mainWnd); // app minimization
void RestoreApp(HWND mainWnd, HWND dlgWnd); // restore from minimized state of app.
// changes the name format (letter case), filename must always be terminated with null character
void AlterFileName(char* tgtName, char* filename, int filenameLen, int format, int change, BOOL dir);
void AlterFileName(WCHAR* tgtName, const WCHAR* filename, int filenameLen, int format, int change, BOOL dir);
void AlterFileName(char* tgtName, const char* filename, int filenameLen, int format, int change, BOOL dir);

// returns string with file size and times; returns time in 'fileTime', variable can be NULL;
// if 'getTimeFailed' is not NULL, TRUE is written to it on error getting file time
Expand Down Expand Up @@ -1380,7 +1381,8 @@ extern HFONT EnvFontUL; // listbox font underlined
extern int EnvFontCharHeight; // font height
extern HFONT TooltipFont; // font for tooltips (and statusbars, but we don't use it there)

BOOL GetSystemGUIFont(LOGFONT* lf); // returns font used for Salamander main window
BOOL GetSystemGUIFontW(LOGFONTW* lf); // returns font used for Salamander main window (Unicode)
BOOL GetSystemGUIFont(LOGFONT* lf); // returns font used for Salamander main window (ANSI)
BOOL CreateEnvFonts(); // fills EnvFont, EnvFontUL, EnvFontCharHeight, TooltipFont based on metrics

extern DWORD MouseHoverTime; // after what time should highlighting occur
Expand Down
91 changes: 91 additions & 0 deletions src/debug_move.cpp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this debug file is part of the installer task

Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#include "precomp.h"
#include <iostream>
#include <fstream>

// Forward declarations
void SalLog(const std::string& message);

// Dummy implementations of dependencies
// This is a simplified version of the actual classes and functions
// to allow the debug program to compile.

class CFilesWindow {
public:
BOOL BuildScriptDir(COperations* script, CActionType type, char* sourcePath,
BOOL sourcePathSupADS, char* targetPath,
CTargetPathState targetPathState, BOOL targetPathSupADS,
BOOL targetPathIsFAT32, char* mask, char* dirName,
char* dirDOSName, CAttrsData* attrsData, char* mapName,
DWORD sourceDirAttr, CChangeCaseData* chCaseData, BOOL firstLevelDir,
BOOL onlySize, BOOL fastDirectoryMove, CCriteriaData* filterCriteria,
BOOL* canDelUpperDirAfterMove, FILETIME* sourceDirTime,
DWORD srcAndTgtPathsFlags);
};

// ... (other dummy implementations)

// Logging function
void SalLog(const std::string& message) {
std::ofstream logfile("move_debug_log.txt", std::ios_base::app);
if (logfile.is_open()) {
logfile << message << std::endl;
}
}

// Modified BuildScriptDir with logging
BOOL CFilesWindow::BuildScriptDir(COperations* script, CActionType type, char* sourcePath,
BOOL sourcePathSupADS, char* targetPath,
CTargetPathState targetPathState, BOOL targetPathSupADS,
BOOL targetPathIsFAT32, char* mask, char* dirName,
char* dirDOSName, CAttrsData* attrsData, char* mapName,
DWORD sourceDirAttr, CChangeCaseData* chCaseData, BOOL firstLevelDir,
BOOL onlySize, BOOL fastDirectoryMove, CCriteriaData* filterCriteria,
BOOL* canDelUpperDirAfterMove, FILETIME* sourceDirTime,
DWORD srcAndTgtPathsFlags)
{
std::string log_msg = "BuildScriptDir START: sourcePath=" + std::string(sourcePath) + ", targetPath=" + (targetPath ? std::string(targetPath) : "NULL") + ", dirName=" + std::string(dirName);
SalLog(log_msg);

// ... (original code from fileswn6.cpp)

// In a real implementation, you would copy the body of the function here.
// For this example, we will just simulate a recursive call.

// ...

log_msg = "BuildScriptDir END: sourcePath=" + std::string(sourcePath) + ", targetPath=" + (targetPath ? std::string(targetPath) : "NULL");
SalLog(log_msg);

return TRUE;
}

int main(int argc, char* argv[]) {
if (argc != 3) {
std::cerr << "Usage: debug_move.exe <source_dir> <target_dir>" << std::endl;
return 1;
}

std::string source_dir = argv[1];
std::string target_dir = argv[2];

SalLog("Starting move operation from " + source_dir + " to " + target_dir);

// This is a simplified simulation of the file move process.
// In a real implementation, you would need to initialize the necessary
// objects and call the functions in the correct order.

CFilesWindow files_window;
COperations script;
// ... initialize script ...

char source_path[MAX_PATH * 2];
char target_path[MAX_PATH * 2];
strcpy_s(source_path, source_dir.c_str());
strcpy_s(target_path, target_dir.c_str());

files_window.BuildScriptDir(&script, atMove, source_path, FALSE, target_path, tpsUnknown, FALSE, FALSE, NULL, (char*)"test_dir", NULL, NULL, NULL, FILE_ATTRIBUTE_DIRECTORY, NULL, TRUE, FALSE, TRUE, NULL, NULL, NULL, 0);

SalLog("Move operation finished.");

return 0;
}
20 changes: 12 additions & 8 deletions src/dialogs5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2893,28 +2893,32 @@ void CCfgPageAppearance::LoadControls()
{
CALL_STACK_MESSAGE1("CCfgPageAppearance::LoadControls()");

LOGFONT logFont;
LOGFONTW logFont; // Use LOGFONTW for Unicode compatibility

if (LocalUseCustomPanelFont)
logFont = LocalPanelLogFont;
{
// Convert LocalPanelLogFont (LOGFONTA) to LOGFONTW
memcpy(&logFont, &LocalPanelLogFont, sizeof(LOGFONTA) - LF_FACESIZE);
ConvertA2U(LocalPanelLogFont.lfFaceName, -1, logFont.lfFaceName, LF_FACESIZE);
}
else
GetSystemGUIFont(&logFont);
GetSystemGUIFontW(&logFont); // Use the Unicode version

HWND hEdit = GetDlgItem(HWindow, IDE_PANELFONT);
int origHeight = logFont.lfHeight;
logFont.lfHeight = GetWindowFontHeight(hEdit); // use the edit line's font size for font preview
if (HPanelFont != NULL)
HANDLES(DeleteObject(HPanelFont));
HPanelFont = HANDLES(CreateFontIndirect(&logFont));
HPanelFont = HANDLES(CreateFontIndirectW(&logFont)); // Use CreateFontIndirectW

HDC hDC = HANDLES(GetDC(HWindow));
SendMessage(hEdit, WM_SETFONT, (WPARAM)HPanelFont, MAKELPARAM(TRUE, 0));
char buf[LF_FACESIZE + 200];
_snprintf_s(buf, _TRUNCATE, LoadStr(IDS_FONTDESCRIPTION),
WCHAR wbuf[LF_FACESIZE + 200]; // Use WCHAR buffer
_snwprintf_s(wbuf, _TRUNCATE, LoadStrW(IDS_FONTDESCRIPTION), // Use _snwprintf_s and LoadStrW
MulDiv(-origHeight, 72, GetDeviceCaps(hDC, LOGPIXELSY)),
logFont.lfFaceName,
LoadStr(LocalUseCustomPanelFont ? IDS_FONTDESCRIPTION_CST : IDS_FONTDESCRIPTION_DEF));
SetWindowText(hEdit, buf);
LoadStrW(LocalUseCustomPanelFont ? IDS_FONTDESCRIPTION_CST : IDS_FONTDESCRIPTION_DEF));
SetWindowTextW(hEdit, wbuf); // Use SetWindowTextW

HANDLES(ReleaseDC(HWindow, hDC));
}
Expand Down
28 changes: 21 additions & 7 deletions src/fileswn2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ BOOL CFilesWindow::ChangeToFixedDrive(HWND parent, BOOL* noChange, BOOL refreshL
if (noChange != NULL)
*noChange = TRUE;
char sysDir[MAX_PATH];
char root[4] = " :\\";
char root[5] = " :\\";
if (GetWindowsDirectory(sysDir, MAX_PATH) != 0 && sysDir[0] != 0 && sysDir[1] == ':')
{
root[0] = sysDir[0];
Expand Down Expand Up @@ -787,7 +787,7 @@ void CFilesWindow::ConnectNet(BOOL readOnlyUNC, const char* netRootPath, BOOL ch
*newlyMappedDrive = d;
if (changeToNewDrive)
{
char root[4] = " :\\";
char root[5] = " :\\";
root[0] = d;
ChangePathToDisk(HWindow, root, -1, NULL, NULL, TRUE, FALSE, FALSE, NULL, FALSE);
}
Expand Down Expand Up @@ -1833,7 +1833,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested

// cannot shorten, we find the system or first fixed-drive (our "escape drive")
char sysDir[MAX_PATH];
char root[4] = " :\\";
char root[5] = " :\\";
BOOL done = FALSE;
if (GetWindowsDirectory(sysDir, MAX_PATH) != 0 && sysDir[0] != 0 && sysDir[1] == ':')
{
Expand Down Expand Up @@ -3523,7 +3523,7 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset,
HFONT of = (HFONT)SelectObject(dc, Font);
SIZE act;

char formatedFileName[MAX_PATH];
char formatedFileName[2 * MAX_PATH];
switch (GetViewMode())
{
case vmBrief:
Expand All @@ -3537,7 +3537,11 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset,
CFileData* f = &Dirs->At(i);
AlterFileName(formatedFileName, f->Name, f->NameLen,
Configuration.FileNameFormat, 0, TRUE);
GetTextExtentPoint32(dc, formatedFileName, f->NameLen, &act);
CStrP wName(ConvertAllocUtf8ToWide(formatedFileName, -1));
if (wName != NULL)
GetTextExtentPoint32W(dc, wName, lstrlenW(wName), &act);
else
GetTextExtentPoint32(dc, formatedFileName, (int)strlen(formatedFileName), &act);
if (max.cx < act.cx)
max.cx = act.cx;
}
Expand All @@ -3546,7 +3550,11 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset,
CFileData* f = &Files->At(i);
AlterFileName(formatedFileName, f->Name, f->NameLen,
Configuration.FileNameFormat, 0, FALSE);
GetTextExtentPoint32(dc, formatedFileName, f->NameLen, &act);
CStrP wName(ConvertAllocUtf8ToWide(formatedFileName, -1));
if (wName != NULL)
GetTextExtentPoint32W(dc, wName, lstrlenW(wName), &act);
else
GetTextExtentPoint32(dc, formatedFileName, (int)strlen(formatedFileName), &act);
if (max.cx < act.cx)
max.cx = act.cx;
}
Expand Down Expand Up @@ -3737,7 +3745,13 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset,
//--- extension
if ((autoWidthColumns & VIEW_SHOW_EXTENSION) && extIsInExtColumn)
{
GetTextExtentPoint32(dc, formatedFileName + (int)(f->Ext - f->Name), (int)(f->NameLen - (f->Ext - f->Name)), &act);
const char* pExt = formatedFileName + (int)(f->Ext - f->Name);
CStrP wExt(ConvertAllocUtf8ToWide(pExt, -1));
if (wExt != NULL)
GetTextExtentPoint32W(dc, wExt, lstrlenW(wExt), &act);
else
GetTextExtentPoint32(dc, pExt, (int)strlen(pExt), &act);

act.cx += SPACE_WIDTH;
if (columnWidthExt < act.cx)
columnWidthExt = act.cx;
Expand Down
44 changes: 27 additions & 17 deletions src/fileswn4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,23 +749,33 @@ void CFilesWindow::DrawBriefDetailedItem(HDC hTgtDC, int itemIndex, RECT* itemRe
// search from the end for the character after which we can copy "..." and it fits in the column
while (fitChars > 0 && DrawItemAlpDx[fitChars - 1] + TextEllipsisWidth > textWidth)
fitChars--;
// copy a part of the original string to another buffer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think removing those lines should be part of adding or updating the installer

int totalCount;
if (fitChars > 0)
{
memmove(DrawItemBuff, TransferBuffer, fitChars);
// and append "..."
memmove(DrawItemBuff + fitChars, "...", 3);
totalCount = fitChars + 3;
}
else
{
DrawItemBuff[0] = TransferBuffer[0];
DrawItemBuff[1] = '.';
totalCount = 2;
}

// DRAWFLAG_MASK: hack, under XP some stuff is added in font of the text in the mask while drawing short texts; not an issue if text is not drawn
// copy a part of the original string to another buffer
int totalCount;
CStrP wName(ConvertAllocUtf8ToWide(TransferBuffer, -1));
if (wName != NULL)
{
if (fitChars > (int)wcslen(wName)) fitChars = (int)wcslen(wName);
wName[fitChars] = 0;
wcscat_s(wName, lstrlenW(wName) + 4, L"...");
ConvertWideToUtf8(wName, -1, DrawItemBuff, 1024);
totalCount = (int)strlen(DrawItemBuff);
}
else
{
if (fitChars > 0)
{
memmove(DrawItemBuff, TransferBuffer, fitChars);
memmove(DrawItemBuff + fitChars, "...", 3);
totalCount = fitChars + 3;
}
else
{
DrawItemBuff[0] = TransferBuffer[0];
DrawItemBuff[1] = '.';
totalCount = 2;
}
}
// DRAWFLAG_MASK: hack, under XP some stuff is added in font of the text in the mask while drawing short texts; not an issue if text is not drawn
ExtTextOutUtf8(hDC, r.left + 2, y, ETO_OPAQUE, &adjR, DrawItemBuff, (drawFlags & DRAWFLAG_MASK) ? 0 : totalCount, NULL);
goto SKIP1;
}
Expand Down
Loading