1
0
Эх сурвалжийг харах

Description of the extension is used as a long hint

Source commit: 50be29d7da2294cab456f2e4a578d7b741d659fe
Martin Prikryl 9 жил өмнө
parent
commit
ae1c1fd130

+ 2 - 1
source/forms/NonVisual.cpp

@@ -1072,7 +1072,8 @@ void __fastcall TNonVisualDataModule::CreateCustomCommandsListMenu(
       }
       UnicodeString Name = StripHotkey(Command->Name);
       UnicodeString ShortHint = FMTLOAD(CUSTOM_COMMAND_HINT, (Name));
-      UnicodeString LongHint = FMTLOAD(CUSTOM_COMMAND_HINT_LONG, (Name, Command->Command));
+      UnicodeString LongHint =
+        !Command->Description.IsEmpty() ? Command->Description : FMTLOAD(CUSTOM_COMMAND_HINT_LONG, (Name, Command->Command));
       Item->Hint = FORMAT(L"%s|%s", (ShortHint, LongHint));
       if (!Both)
       {

+ 6 - 1
source/forms/Preferences.cpp

@@ -2587,7 +2587,12 @@ void __fastcall TPreferencesDialog::CustomCommandsViewMouseMove(TObject * /*Send
     {
       TCustomCommandList * List = GetCommandList(Index);
       const TCustomCommandType * Command = List->Commands[GetCommandIndex(Index)];
-      Hint = Item->Caption + L"\n" + Command->Command;
+      Hint = Item->Caption;
+      if (!Command->Description.IsEmpty())
+      {
+        Hint += L"\n" + Command->Description;
+      }
+      Hint += L"\n" + Command->Command;
       if (List == FExtensionList)
       {
         Hint += L"\n" + Command->FileName;

+ 6 - 3
source/windows/WinConfiguration.cpp

@@ -2602,7 +2602,8 @@ __fastcall TCustomCommandType::TCustomCommandType(const TCustomCommandType & Oth
   FParams(Other.FParams),
   FShortCut(Other.FShortCut),
   FId(Other.FId),
-  FFileName(Other.FFileName)
+  FFileName(Other.FFileName),
+  FDescription(Other.FDescription)
 {
 }
 //---------------------------------------------------------------------------
@@ -2614,6 +2615,7 @@ TCustomCommandType & TCustomCommandType::operator=(const TCustomCommandType & Ot
   FShortCut = Other.FShortCut;
   FId = Other.FId;
   FFileName = Other.FFileName;
+  FDescription = Other.FDescription;
   return *this;
 }
 //---------------------------------------------------------------------------
@@ -2625,7 +2627,8 @@ bool __fastcall TCustomCommandType::Equals(const TCustomCommandType * Other) con
     (FParams == Other->FParams) &&
     (FShortCut == Other->FShortCut) &&
     (FId == Other->FId) &&
-    (FFileName == Other->FFileName);
+    (FFileName == Other->FFileName) &&
+    (FDescription == Other->FDescription);
 }
 //---------------------------------------------------------------------------
 const UnicodeString ExtensionNameDirective(L"name");
@@ -2780,7 +2783,7 @@ void __fastcall TCustomCommandType::LoadExtension(TStrings * Lines)
           }
           else if (Key == L"description")
           {
-            // noop
+            Description = Value;
           }
           else if (Key == L"author")
           {

+ 2 - 0
source/windows/WinConfiguration.h

@@ -719,6 +719,7 @@ public:
   __property TShortCut ShortCut = { read = FShortCut, write = FShortCut };
   __property UnicodeString Id = { read = FId, write = FId };
   __property UnicodeString FileName = { read = FFileName, write = FFileName };
+  __property UnicodeString Description = { read = FDescription, write = FDescription };
 
 private:
   UnicodeString FName;
@@ -727,6 +728,7 @@ private:
   TShortCut FShortCut;
   UnicodeString FId;
   UnicodeString FFileName;
+  UnicodeString FDescription;
 };
 //---------------------------------------------------------------------------
 class TCustomCommandList