Ver código fonte

Fixed issue with global shortcuts window not showing the clip description

Scott Brogden 3 anos atrás
pai
commit
eb4aed6d3f
4 arquivos alterados com 10 adições e 5 exclusões
  1. 4 3
      CP_Main.cpp
  2. 2 0
      GlobalClips.cpp
  3. 2 1
      HotKeys.cpp
  4. 2 1
      HotKeys.h

+ 4 - 3
CP_Main.cpp

@@ -482,15 +482,16 @@ void CCP_MainApp::LoadGlobalClips()
 	try
 	{
 		{
-			CppSQLite3Query q = m_db.execQuery(_T("SELECT lID, lShortCut FROM Main WHERE lShortCut > 0 AND globalShortCut = 1"));
+			CppSQLite3Query q = m_db.execQuery(_T("SELECT lID, lShortCut, mText FROM Main WHERE lShortCut > 0 AND globalShortCut = 1"));
 
 			while(q.eof() == false)
 			{
 				int id = q.getIntField(_T("lID"));
 				int shortcut = q.getIntField(_T("lShortCut"));
+				CString desc = q.getStringField(_T("mText"));
 
 				//Constructor will add to a global list and free
-				CHotKey* globalHotKey = new CHotKey(StrF(_T("GlobalClip: %d"), id), shortcut, true, CHotKey::PASTE_OPEN_CLIP);
+				CHotKey* globalHotKey = new CHotKey(StrF(_T("GlobalClip: %d"), id), shortcut, true, CHotKey::PASTE_OPEN_CLIP, desc);
 				if(globalHotKey != NULL)
 				{
 					globalHotKey->m_clipId = id;
@@ -510,7 +511,7 @@ void CCP_MainApp::LoadGlobalClips()
 				CString desc = q2.getStringField(_T("mText"));
 
 				//Constructor will add to a global list and free
-				CHotKey* globalHotKey = new CHotKey(desc, shortcut, true, CHotKey::MOVE_TO_GROUP);
+				CHotKey* globalHotKey = new CHotKey(StrF(_T("MoveToGroup: %d"), id), shortcut, true, CHotKey::MOVE_TO_GROUP, desc);
 				if(globalHotKey != NULL)
 				{
 					globalHotKey->m_clipId = id;

+ 2 - 0
GlobalClips.cpp

@@ -79,6 +79,8 @@ void GlobalClips::LoadItems()
 
 		if(pHotKey->m_clipId > 0)
 		{
+			strItem = pHotKey->m_description;
+
 			if(pHotKey->m_hkType == CHotKey::PASTE_OPEN_CLIP)
 			{
 				strItem.Insert(0, theApp.m_Language.GetGlobalHotKeyString("(Clip)", "(Clip) "));

+ 2 - 1
HotKeys.cpp

@@ -9,8 +9,9 @@ CHotKeys g_HotKeys;
 
 int CHotKey::m_nextId = 0;
 
-CHotKey::CHotKey(CString name, DWORD defKey, bool bUnregOnShowDitto, HotKeyType hkType) 
+CHotKey::CHotKey(CString name, DWORD defKey, bool bUnregOnShowDitto, HotKeyType hkType, CString description) 
 	: m_Name(name), 
+	m_description(description),
 	m_bIsRegistered(false), 
 	m_bUnRegisterOnShowDitto(bUnregOnShowDitto),
 	m_clipId(0)

+ 2 - 1
HotKeys.h

@@ -12,6 +12,7 @@ public:
 	};
 
 	CString	m_Name;
+	CString m_description;
 	ATOM	m_Atom;
 	DWORD	m_Key; //704 is ctrl-tilda
 	bool	m_bIsRegistered;
@@ -21,7 +22,7 @@ public:
 	HotKeyType m_hkType;
 	static int m_nextId;
 	
-	CHotKey( CString name, DWORD defKey = 0, bool bUnregOnShowDitto = false, HotKeyType hkType = PASTE_OPEN_CLIP );
+	CHotKey( CString name, DWORD defKey = 0, bool bUnregOnShowDitto = false, HotKeyType hkType = PASTE_OPEN_CLIP, CString description = _T(""));
 	~CHotKey();
 
 	bool	IsRegistered() { return m_bIsRegistered; }