Kaynağa Gözat

Merge pull request #899 from sabrogden/plain-text-position

Added keyboard shortcuts to paste position as plain text
sabrogden 2 ay önce
ebeveyn
işleme
6ce6b488d3
5 değiştirilmiş dosya ile 87 ekleme ve 2 silme
  1. 14 0
      .gitignore
  2. 30 0
      src/ActionEnums.cpp
  3. 10 0
      src/ActionEnums.h
  4. 32 1
      src/QPasteWnd.cpp
  5. 1 1
      src/QPasteWnd.h

+ 14 - 0
.gitignore

@@ -36,3 +36,17 @@
 *.exe
 *.out
 *.app
+/.vs
+/packages
+/Debug64
+*.log
+*.recipe
+*.ilk
+*.res
+/enc_temp_folder
+/focusdll/Debug64
+CP_Main.vcxproj.user
+CP_Main_i.c
+CP_Main_i.h
+*.idb
+*.lnk

+ 30 - 0
src/ActionEnums.cpp

@@ -392,6 +392,36 @@ CString ActionEnums::EnumDescription(ActionEnumValues value)
 	case PASTE_MULTI_IMAGE_VERTICAL:
 		val = "Paste Muliple Images Vertically";
 		break;
+	case PASTE_POSITION_1_PLAIN_TEXT:
+		val = "Paste Position 1 Plain Text Only";
+		break;
+	case PASTE_POSITION_2_PLAIN_TEXT:
+		val = "Paste Position 2 Plain Text Only";
+		break;
+	case PASTE_POSITION_3_PLAIN_TEXT:
+		val = "Paste Position 3 Plain Text Only";
+		break;
+	case PASTE_POSITION_4_PLAIN_TEXT:
+		val = "Paste Position 4 Plain Text Only";
+		break;
+	case PASTE_POSITION_5_PLAIN_TEXT:
+		val = "Paste Position 5 Plain Text Only";
+		break;
+	case PASTE_POSITION_6_PLAIN_TEXT:
+		val = "Paste Position 6 Plain Text Only";
+		break;
+	case PASTE_POSITION_7_PLAIN_TEXT:
+		val = "Paste Position 7 Plain Text Only";
+		break;
+	case PASTE_POSITION_8_PLAIN_TEXT:
+		val = "Paste Position 8 Plain Text Only";
+		break;
+	case PASTE_POSITION_9_PLAIN_TEXT:
+		val = "Paste Position 9 Plain Text Only";
+		break;
+	case PASTE_POSITION_10_PLAIN_TEXT:
+		val = "Paste Position 10 Plain Text Only";
+		break;
 	}
 
 	CString translatedValue = theApp.m_Language.GetQuickPasteKeyboardString(value, val);

+ 10 - 0
src/ActionEnums.h

@@ -134,6 +134,16 @@ public:
 		PASTE_MULTI_IMAGE_HORIZONTAL,
 		PASTE_MULTI_IMAGE_VERTICAL,
 		ASCII_TEXT_ONLY,
+		PASTE_POSITION_1_PLAIN_TEXT,
+		PASTE_POSITION_2_PLAIN_TEXT,
+		PASTE_POSITION_3_PLAIN_TEXT,
+		PASTE_POSITION_4_PLAIN_TEXT,
+		PASTE_POSITION_5_PLAIN_TEXT,
+		PASTE_POSITION_6_PLAIN_TEXT,
+		PASTE_POSITION_7_PLAIN_TEXT,
+		PASTE_POSITION_8_PLAIN_TEXT,
+		PASTE_POSITION_9_PLAIN_TEXT,
+		PASTE_POSITION_10_PLAIN_TEXT,
 
 		LAST_ACTION
 	};

+ 32 - 1
src/QPasteWnd.cpp

@@ -1074,7 +1074,7 @@ BOOL CQPasteWnd::OpenSelection(CSpecialPasteOptions pasteOptions)
 	return TRUE;
 }
 
-BOOL CQPasteWnd::OpenIndex(int item)
+BOOL CQPasteWnd::OpenIndex(int item, bool plainTextOnly)
 {
 	if (item >= m_lstHeader.GetItemCount())
 	{
@@ -1082,6 +1082,7 @@ BOOL CQPasteWnd::OpenIndex(int item)
 	}
 
 	CSpecialPasteOptions pasteOptions;
+	pasteOptions.m_pasteAsPlainText = plainTextOnly;
 	return OpenID(m_lstHeader.GetItemData(item), pasteOptions);
 }
 
@@ -3244,6 +3245,36 @@ bool CQPasteWnd::DoAction(CAccel a)
 	case ActionEnums::PASTE_POSITION_10:
 		ret = OpenIndex(9);
 		break;
+	case ActionEnums::PASTE_POSITION_1_PLAIN_TEXT:
+		ret = OpenIndex(0, true);
+		break;
+	case ActionEnums::PASTE_POSITION_2_PLAIN_TEXT:
+		ret = OpenIndex(1, true);
+		break;
+	case ActionEnums::PASTE_POSITION_3_PLAIN_TEXT:
+		ret = OpenIndex(2, true);
+		break;
+	case ActionEnums::PASTE_POSITION_4_PLAIN_TEXT:
+		ret = OpenIndex(3, true);
+		break;
+	case ActionEnums::PASTE_POSITION_5_PLAIN_TEXT:
+		ret = OpenIndex(4, true);
+		break;
+	case ActionEnums::PASTE_POSITION_6_PLAIN_TEXT:
+		ret = OpenIndex(5, true);
+		break;
+	case ActionEnums::PASTE_POSITION_7_PLAIN_TEXT:
+		ret = OpenIndex(6, true);
+		break;
+	case ActionEnums::PASTE_POSITION_8_PLAIN_TEXT:
+		ret = OpenIndex(7, true);
+		break;
+	case ActionEnums::PASTE_POSITION_9_PLAIN_TEXT:
+		ret = OpenIndex(8, true);
+		break;
+	case ActionEnums::PASTE_POSITION_10_PLAIN_TEXT:
+		ret = OpenIndex(9, true);
+		break;
 	case ActionEnums::CONFIG_SHOW_FIRST_TEN_TEXT:
 		ret = OnShowFirstTenText();
 		break;

+ 1 - 1
src/QPasteWnd.h

@@ -186,7 +186,7 @@ public:
 
 	BOOL OpenID(int id, CSpecialPasteOptions pasteOptions);
 	BOOL OpenSelection(CSpecialPasteOptions pasteOptions);
-    BOOL OpenIndex(int item);
+    BOOL OpenIndex(int item, bool plainTextOnly = false);
 	BOOL NewGroup(bool bGroupSelection = true, int parentId = -1);
 
     CString LoadDescription(int nItem);