diff --git a/far/SDK/sdk.common.h b/far/SDK/sdk.common.h index b6f205fd51..bd3c80c98d 100644 --- a/far/SDK/sdk.common.h +++ b/far/SDK/sdk.common.h @@ -1,9 +1,9 @@ -#pragma once +#pragma once /* sdk.common.h - , SDK. +Типы и определения, отсутствующие в SDK. */ /* Copyright (c) 1996 Eugene Roshal diff --git a/far/SDK/sdk.gcc.h b/far/SDK/sdk.gcc.h index 611d903cc2..d9f5f5415a 100644 --- a/far/SDK/sdk.gcc.h +++ b/far/SDK/sdk.gcc.h @@ -1,9 +1,9 @@ -#pragma once +#pragma once /* sdk.gcc.h - , SDK (GCC). +Типы и определения, отсутствующие в SDK (GCC). */ /* Copyright (c) 1996 Eugene Roshal diff --git a/far/SDK/sdk.vc.h b/far/SDK/sdk.vc.h index 7f2147a420..d5460370ec 100644 --- a/far/SDK/sdk.vc.h +++ b/far/SDK/sdk.vc.h @@ -1,9 +1,9 @@ -#pragma once +#pragma once /* sdk.vc.h - , SDK (Microsoft). +Типы и определения, отсутствующие SDK (Microsoft). */ /* Copyright (c) 1996 Eugene Roshal diff --git a/far/common/rel_ops.hpp b/far/common/rel_ops.hpp index 28625bff68..70ee371bae 100644 --- a/far/common/rel_ops.hpp +++ b/far/common/rel_ops.hpp @@ -1,9 +1,9 @@ -#ifndef REL_OPS_HPP_216C5B74_491D_4AE0_AA85_4A424C1CF3BA +#ifndef REL_OPS_HPP_216C5B74_491D_4AE0_AA85_4A424C1CF3BA #define REL_OPS_HPP_216C5B74_491D_4AE0_AA85_4A424C1CF3BA #pragma once /* -Copyright 2016 Far Group +Copyright © 2016 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/far/common/variadic_emulation_helpers_begin.hpp b/far/common/variadic_emulation_helpers_begin.hpp index 2d25cb1f01..c8d863a134 100644 --- a/far/common/variadic_emulation_helpers_begin.hpp +++ b/far/common/variadic_emulation_helpers_begin.hpp @@ -1,5 +1,5 @@ -/* -Copyright 2014 Far Group +/* +Copyright © 2014 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/far/common/variadic_emulation_helpers_end.hpp b/far/common/variadic_emulation_helpers_end.hpp index 5c003d76d6..a099c79da5 100644 --- a/far/common/variadic_emulation_helpers_end.hpp +++ b/far/common/variadic_emulation_helpers_end.hpp @@ -1,5 +1,5 @@ -/* -Copyright 2014 Far Group +/* +Copyright © 2014 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/far/disable_warnings_in_std_begin.hpp b/far/disable_warnings_in_std_begin.hpp index 30321bc081..78b7d9895e 100644 --- a/far/disable_warnings_in_std_begin.hpp +++ b/far/disable_warnings_in_std_begin.hpp @@ -1,5 +1,5 @@ -/* -Copyright 2015 Far Group +/* +Copyright © 2015 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/far/disable_warnings_in_std_end.hpp b/far/disable_warnings_in_std_end.hpp index 2497c9e5a1..5099f91eeb 100644 --- a/far/disable_warnings_in_std_end.hpp +++ b/far/disable_warnings_in_std_end.hpp @@ -1,5 +1,5 @@ -/* -Copyright 2015 Far Group +/* +Copyright © 2015 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/far/disabled_warnings.hpp b/far/disabled_warnings.hpp index 8749cd8a9b..d285720be0 100644 --- a/far/disabled_warnings.hpp +++ b/far/disabled_warnings.hpp @@ -1,5 +1,5 @@ -/* -Copyright 2015 Far Group +/* +Copyright © 2015 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without @@ -73,7 +73,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma warning(disable: 4738) // https://msdn.microsoft.com/en-us/library/c24hdbz6.aspx storing 32-bit float result in memory, possible loss of performance #pragma warning(disable: 4820) // https://msdn.microsoft.com/en-us/library/t7khkyth.aspx 'bytes' bytes padding added after construct 'member_name' #pragma warning(disable: 4836) // https://msdn.microsoft.com/en-us/library/ms173717.aspx nonstandard extension used : 'type' : local types or unnamed types cannot be used as template arguments -#pragma warning(disable: 4986) // https://msdn.microsoft.com/en-us/library/jj620898.aspx 'function': exception specification does not match previous declaration +#pragma warning(disable: 4986) // https://msdn.microsoft.com/en-us/library/jj620898.aspx 'function': exception specification does not match previous declaration #pragma warning(disable: 5025) // no page 'class': move assignment operator was implicitly defined as deleted #pragma warning(disable: 5026) // no page 'class': move constructor was implicitly defined as deleted because a base class move constructor is inaccessible or deleted #pragma warning(disable: 5027) // no page 'class': move assignment operator was implicitly defined as deleted because a base class move assignment operator is inaccessible or deleted diff --git a/far/diskmenu.cpp b/far/diskmenu.cpp index d6322a2e91..aa1b7f9d31 100644 --- a/far/diskmenu.cpp +++ b/far/diskmenu.cpp @@ -1,8 +1,8 @@ -/* +/* diskmenu.cpp */ /* -Copyright 2016 Far Group +Copyright © 2016 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without @@ -272,14 +272,14 @@ static int MessageRemoveConnection(wchar_t Letter, int &UpdateProfile) 0 1 2 3 4 5 6 7 0123456789012345678901234567890123456789012345678901234567890123456789012345 0 - 1 +-------- --------+ - 2 | C:? | - 3 | %c: | + 1 +-------- Отключение сетевого устройства --------+ + 2 | Вы хотите удалить соединение с устройством C:? | + 3 | На устройство %c: отображен каталог | 4 | \\host\share | 6 +------------------------------------------------+ - 7 | [ ] | + 7 | [ ] Восстанавливать при входе в систему | 8 +------------------------------------------------+ - 9 | [ ] [ ] | + 9 | [ Да ] [ Отмена ] | 10 +------------------------------------------------+ 11 */ @@ -308,9 +308,9 @@ static int MessageRemoveConnection(wchar_t Letter, int &UpdateProfile) string strMsgText; DriveLocalToRemoteName(DRIVE_REMOTE, Letter, strMsgText); DCDlg[3].strData = TruncPathStr(strMsgText, static_cast(Len1)); - // - ? - // HKCU\Network\ - - // . + // проверяем - это было постоянное соединение или нет? + // Если ветка в реестре HKCU\Network\БукваДиска есть - это + // есть постоянное подключение. bool IsPersistent = true; const wchar_t KeyName[] = { L'N', L'e', L't', L'w', L'o', L'r', L'k', L'\\', Letter, L'\0' }; @@ -326,7 +326,7 @@ static int MessageRemoveConnection(wchar_t Letter, int &UpdateProfile) IsPersistent = false; } - // - + // скорректируем размеры диалога - для дизайнУ DCDlg[0].X2 = DCDlg[0].X1 + Len1 + 3; int ExitCode = 7; @@ -403,7 +403,7 @@ static int ProcessDelDisk(panel_ptr Owner, wchar_t Drive, int DriveType) make_vector(MSG(MOk)), nullptr, nullptr, &SUBSTDisconnectDriveError2Id); } - return DRIVE_DEL_FAIL; // . ... + return DRIVE_DEL_FAIL; // блин. в прошлый раз забыл про это дело... } break; @@ -413,14 +413,14 @@ static int ProcessDelDisk(panel_ptr Owner, wchar_t Drive, int DriveType) int UpdateProfile = CONNECT_UPDATE_PROFILE; if (MessageRemoveConnection(Drive, UpdateProfile)) { - // <> + // <КОСТЫЛЬ> SCOPED_ACTION(LockScreen); - // - , - // + // если мы находимся на удаляемом диске - уходим с него, чтобы не мешать + // удалению Owner->IfGoHome(Drive); Global->WindowManager->ResizeAllWindows(); Global->WindowManager->GetCurrentWindow()->Show(); - // + // if (WNetCancelConnection2(DiskLetter.data(), UpdateProfile, FALSE) == NO_ERROR) { @@ -516,36 +516,36 @@ static int DisconnectDrive(panel_ptr Owner, const PanelMenuItem *item, VMenu2 &C if ((item->nDriveType == DRIVE_REMOVABLE) && !IsEjectableMedia(item->cDrive)) return -1; - // + // первая попытка извлечь диск if (!EjectVolume(item->cDrive, EJECT_NO_MESSAGE)) { - // + // запоминаем состояние панелей const auto CMode = Owner->GetMode(); const auto AMode = Owner->Parent()->GetAnotherPanel(Owner)->GetMode(); string strTmpCDir(Owner->GetCurDir()), strTmpADir(Owner->Parent()->GetAnotherPanel(Owner)->GetCurDir()); - // " " + // "цикл до умопомрачения" int DoneEject = FALSE; while (!DoneEject) { - // " " - - // TODO: - CD? ;-) + // "освободим диск" - перейдем при необходимости в домашний каталог + // TODO: А если домашний каталог - CD? ;-) Owner->IfGoHome(item->cDrive); - // + // очередная попытка извлечения без вывода сообщения int ResEject = EjectVolume(item->cDrive, EJECT_NO_MESSAGE); if (!ResEject) { - // - . + // восстановим пути - это избавит нас от левых данных в панели. if (AMode != panel_mode::PLUGIN_PANEL) Owner->Parent()->GetAnotherPanel(Owner)->SetCurDir(strTmpADir, false); if (CMode != panel_mode::PLUGIN_PANEL) Owner->SetCurDir(strTmpCDir, false); - // ... ... - SetLastError(ERROR_DRIVE_LOCKED); // ... "The disk is in use or locked by another process." + // ... и выведем месаг о... + SetLastError(ERROR_DRIVE_LOCKED); // ...о "The disk is in use or locked by another process." Global->CatchError(); wchar_t Drive[] = { item->cDrive, L':', L'\\', 0 }; DoneEject = OperationFailed(Drive, MError, string_format(MChangeCouldNotEjectMedia, item->cDrive), false); @@ -568,32 +568,32 @@ static void RemoveHotplugDevice(panel_ptr Owner, const PanelMenuItem *item, VMen if (!Code) { - // + // запоминаем состояние панелей const auto CMode = Owner->GetMode(); const auto AMode = Owner->Parent()->GetAnotherPanel(Owner)->GetMode(); string strTmpCDir(Owner->GetCurDir()), strTmpADir(Owner->Parent()->GetAnotherPanel(Owner)->GetCurDir()); - // " " + // "цикл до умопомрачения" int DoneEject = FALSE; while (!DoneEject) { - // " " - - // TODO: - USB? ;-) + // "освободим диск" - перейдем при необходимости в домашний каталог + // TODO: А если домашний каталог - USB? ;-) Owner->IfGoHome(item->cDrive); - // + // очередная попытка извлечения без вывода сообщения Code = RemoveHotplugDisk(item->cDrive, EJECT_NO_MESSAGE | EJECT_NOTIFY_AFTERREMOVE); if (!Code) { - // - . + // восстановим пути - это избавит нас от левых данных в панели. if (AMode != panel_mode::PLUGIN_PANEL) Owner->Parent()->GetAnotherPanel(Owner)->SetCurDir(strTmpADir, false); if (CMode != panel_mode::PLUGIN_PANEL) Owner->SetCurDir(strTmpCDir, false); - // ... ... - SetLastError(ERROR_DRIVE_LOCKED); // ... "The disk is in use or locked by another process." + // ... и выведем месаг о... + SetLastError(ERROR_DRIVE_LOCKED); // ...о "The disk is in use or locked by another process." Global->CatchError(); DoneEject = Message(MSG_WARNING | MSG_ERRORTYPE, MSG(MError), @@ -612,7 +612,7 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) int Panel_X1, Panel_X2, Panel_Y1, Panel_Y2; Owner->GetPosition(Panel_X1, Panel_Y1, Panel_X2, Panel_Y2); - class Guard_Macro_DskShowPosType // - + class Guard_Macro_DskShowPosType //фигня какая-то { public: Guard_Macro_DskShowPosType(panel_ptr curPanel) { Global->Macro_DskShowPosType = curPanel->Parent()->IsLeft(curPanel)? 1 : 2; } @@ -625,7 +625,7 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) const auto DiskCount = Mask.count(); PanelMenuItem Item, *mitem = nullptr; - { // , . M#605 + { // эта скобка надо, см. M#605 const auto ChDisk = VMenu2::create(MSG(MChangeDriveTitle), nullptr, 0, ScrY - Panel_Y1 - 3); ChDisk->SetBottomTitle(MSG(MChangeDriveMenuFooter)); ChDisk->SetHelp(L"DriveDlg"); @@ -651,10 +651,10 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) auto DE = std::make_unique(); /* $ 02.04.2001 VVM - ! ... */ + ! Попытка не будить спящие диски... */ for (size_t i = 0; i < Mask.size(); ++i) { - if (!Mask[i]) // + if (!Mask[i]) //нету диска continue; DiskMenuItem NewItem; @@ -744,13 +744,13 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) { if (Global->Opt->ChangeDriveMode & DRIVE_SHOW_SIZE) { - // + //размер как минимум в мегабайтах FileSizeToStr(NewItem.TotalSize, TotalSize, 9, COLUMN_COMMAS | COLUMN_MINSIZEINDEX | 1); FileSizeToStr(NewItem.FreeSize, UserFree, 9, COLUMN_COMMAS | COLUMN_MINSIZEINDEX | 1); } else { - // 0 (B) + //размер с точкой и для 0 добавляем букву размера (B) FileSizeToStr(NewItem.TotalSize, TotalSize, 9, COLUMN_FLOATSIZE | COLUMN_SHOWBYTESINDEX); FileSizeToStr(NewItem.FreeSize, UserFree, 9, COLUMN_FLOATSIZE | COLUMN_SHOWBYTESINDEX); } @@ -886,7 +886,7 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) switch (Key) { - // Shift-Enter + // Shift-Enter в меню выбора дисков вызывает проводник для данного диска case KEY_SHIFTNUMENTER: case KEY_SHIFTENTER: { @@ -907,8 +907,8 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) ChDisk->Close(-1); } break; - // .. "" , - // Ins CD - " " + // Т.к. нет способа получить состояние "открытости" устройства, + // то добавим обработку Ins для CD - "закрыть диск" case KEY_INS: case KEY_NUMPAD0: { @@ -931,10 +931,10 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) int Code = DisconnectDrive(Owner, item, *ChDisk); if (Code != DRIVE_DEL_FAIL && Code != DRIVE_DEL_NONE) { - Global->ScrBuf->Lock(); // + Global->ScrBuf->Lock(); // отменяем всякую прорисовку Global->WindowManager->ResizeAllWindows(); - Global->WindowManager->PluginCommit(); // . - Global->ScrBuf->Unlock(); // + Global->WindowManager->PluginCommit(); // коммитим. + Global->ScrBuf->Unlock(); // разрешаем прорисовку RetCode = (((DiskCount - SelPos) == 1) && (SelPos > 0) && (Code != DRIVE_DEL_EJECT))?SelPos - 1:SelPos; } } @@ -973,7 +973,7 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) case KEY_SHIFTAPPS: case KEY_MSRCLICK: { - // EMenu + //вызовем EMenu если он есть if (item && !item->bIsPlugin && Global->CtrlObject->Plugins->FindPlugin(Global->Opt->KnownIDs.Emenu.Id)) { const wchar_t DeviceName[] = { item->cDrive, L':', L'\\', 0 }; @@ -1061,7 +1061,7 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) { if (item && item->bIsPlugin) { - // , CommandsMenu() + // Вызываем нужный топик, который передали в CommandsMenu() pluginapi::apiShowHelp( item->pPlugin->GetModuleName().data(), nullptr, @@ -1105,7 +1105,7 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) return RetCode; const auto& CurDir = Owner->GetCurDir(); - + if (ChDisk->GetExitCode() < 0 && CurDir.size() > 2 && !(IsSlash(CurDir[0]) && IsSlash(CurDir[1]))) { const wchar_t RootDir[] = { CurDir[0], L':', L'\\', L'\0' }; @@ -1124,7 +1124,7 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) Item = *mitem; mitem = &Item; } - } // , . M#605 + } // эта скобка надо, см. M#605 if (Global->Opt->CloseCDGate && mitem && !mitem->bIsPlugin && IsDriveTypeCDROM(mitem->nDriveType)) { @@ -1211,7 +1211,7 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) !StrCmpI(Owner->GetCurDir(), strNewCurDir) && Owner->IsVisible()) { - // Update???? + // А нужно ли делать здесь Update???? Owner->Update(UPDATE_KEEP_SELECTION); } else @@ -1228,7 +1228,7 @@ static int ChangeDiskMenu(panel_ptr Owner, int Pos, bool FirstCall) NewPanel->Parent()->GetAnotherPanel(NewPanel)->UpdateKeyBar(); } } - else // , + else //эта плагин, да { const auto hPlugin = Global->CtrlObject->Plugins->Open( mitem->pPlugin, diff --git a/far/diskmenu.hpp b/far/diskmenu.hpp index 6284f88c93..0e1e62ffeb 100644 --- a/far/diskmenu.hpp +++ b/far/diskmenu.hpp @@ -1,4 +1,4 @@ -#ifndef DISKMENU_HPP_E2359220_8A28_4DC8_B460_79B1A15CDB89 +#ifndef DISKMENU_HPP_E2359220_8A28_4DC8_B460_79B1A15CDB89 #define DISKMENU_HPP_E2359220_8A28_4DC8_B460_79B1A15CDB89 #pragma once @@ -6,7 +6,7 @@ diskmenu.cpp */ /* -Copyright 2016 Far Group +Copyright © 2016 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without