Explorar el Código

replaced g_opt with CGetSetOptions:: for getting all settings (#759)

sabrogden hace 11 meses
padre
commit
2ee24aa936

+ 5 - 5
AdvGeneral.cpp

@@ -187,7 +187,7 @@ BOOL CAdvGeneral::OnInitDialog()
 	AddTrueFalse(pGroupTest, _T("Allow back to back duplicates (if allowing duplicates)"), CGetSetOptions::GetAllowBackToBackDuplicates(), SETTING_ALOW_BACK_TO_BACK_DUPLICATES);
 
 	AddTrueFalse(pGroupTest, _T("Always show scroll bar"), CGetSetOptions::GetShowScrollBar(), SETTING_ALWAYS_SHOW_SCROLL_BAR);
-	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Amount of text to save for description"), g_Opt.m_bDescTextSize, _T(""), SETTING_DESC_SIZE));
+	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Amount of text to save for description"), CGetSetOptions::m_bDescTextSize, _T(""), SETTING_DESC_SIZE));
 	AddTrueFalse(pGroupTest, _T("Center window below cursor or caret"), CGetSetOptions::GetCenterWindowBelowCursorOrCaret(), SETTING_CENTER_WINDOW_BELOW_CURSOR_CARET);
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Copy and save clipboard delay (ms)"), (long)CGetSetOptions::GetCopyAndSveDelay(), _T(""), SETTING_COPY_SAVE_DELAY));
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Clipboard restore delay after copy buffer sent paste (ms, default: 750)"), (long)(CGetSetOptions::GetDittoRestoreClipboardDelay()), _T(""), SETTING_CLIPBOARD_RESTORE_AFTER_COPY_BUFFER_DELAY));
@@ -226,15 +226,15 @@ BOOL CAdvGeneral::OnInitDialog()
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Ignore copies faster than (ms) (default: 500)"), (long)CGetSetOptions::GetSaveClipDelay(), _T(""), SETTING_IGNORE_FALSE_COPIES_DELAY));
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Ignore annoying CF_DIB when a clip is detected as text content"), CGetSetOptions::GetIgnoreAnnoyingCFDIB(), _T("Case insensitive. Recommended option is \"excel.exe; onenote.exe; powerpnt.exe\" "), SETTING_IGNORE_ANNOYING_CF_DIB));
 
-	pGroupTest->AddSubItem( new CMFCPropertyGridProperty(_T("Maximum clip size in bytes (0 for no limit)"), g_Opt.m_lMaxClipSizeInBytes, _T(""), SETTING_MAX_CLIP_SIZE));
+	pGroupTest->AddSubItem( new CMFCPropertyGridProperty(_T("Maximum clip size in bytes (0 for no limit)"), CGetSetOptions::m_lMaxClipSizeInBytes, _T(""), SETTING_MAX_CLIP_SIZE));
 		
 	AddTrueFalse(pGroupTest, _T("Maintain search view"), CGetSetOptions::GetMaintainSearchView(), SETTING_MAINTAIN_SEARCH_VIEW);
 
 	AddTrueFalse(pGroupTest, _T("Move selection on open hot key"), CGetSetOptions::GetMoveSelectionOnOpenHotkey(), SETTING_MOVE_SELECTION_ON_OPEN_HOTKEY);
 	
-	pGroupTest->AddSubItem( new CMFCPropertyGridProperty(_T("Multi-paste clip separator ([LF] = line feed)"), g_Opt.GetMultiPasteSeparator(false), _T(""), SETTING_CLIP_SEPARATOR));
+	pGroupTest->AddSubItem( new CMFCPropertyGridProperty(_T("Multi-paste clip separator ([LF] = line feed)"), CGetSetOptions::GetMultiPasteSeparator(false), _T(""), SETTING_CLIP_SEPARATOR));
 
-	AddTrueFalse(pGroupTest, _T("Multi-paste in reverse order"), g_Opt.m_bMultiPasteReverse, SETTING_MULTIPASTE_REVERSE_ORDER);
+	AddTrueFalse(pGroupTest, _T("Multi-paste in reverse order"), CGetSetOptions::m_bMultiPasteReverse, SETTING_MULTIPASTE_REVERSE_ORDER);
 
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Network send receive port (default: 23443)"), (long)CGetSetOptions::GetPort(), _T(""), SETTING_SEND_RECV_PORT));
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Network server bind IP (default: *)"), CGetSetOptions::GetNetworkBindIPAddress(), _T(""), SETTING_NETWORK_BIND_IP_ADDRESS));
@@ -291,7 +291,7 @@ BOOL CAdvGeneral::OnInitDialog()
 
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Text lines per clip"), CGetSetOptions::GetLinesPerRow(), _T(""), SETTING_LINES_PER_ROW));
 
-	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Tooltip display time(ms) max of 32000 (-1 default (5 seconds), 0 to turn off)"), g_Opt.m_tooltipTimeout, _T(""), SETTING_TOOLTIP_TIMEOUT));
+	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Tooltip display time(ms) max of 32000 (-1 default (5 seconds), 0 to turn off)"), CGetSetOptions::m_tooltipTimeout, _T(""), SETTING_TOOLTIP_TIMEOUT));
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Tooltip maximum display lines"), (long)CGetSetOptions::GetMaxToolTipLines(), _T(""), SETTING_TOOLTIP_LINES));
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Tooltip display characters"), (long)CGetSetOptions::GetMaxToolTipCharacters(), _T(""), SETTING_TOOLTIP_CHARACTERS));
 

+ 10 - 10
AutoSendToClientThread.cpp

@@ -105,29 +105,29 @@ bool CAutoSendToClientThread::SendToClient(CClipList *pClipList)
 
 	for(int nClient = 0; nClient < MAX_SEND_CLIENTS; nClient++)
 	{
-		if(g_Opt.m_SendClients[nClient].bSendAll && 
-			g_Opt.m_SendClients[nClient].csIP.GetLength() > 0)
+		if(CGetSetOptions::m_SendClients[nClient].bSendAll && 
+			CGetSetOptions::m_SendClients[nClient].csIP.GetLength() > 0)
 		{
 			CClient client;
-			if(client.OpenConnection(g_Opt.m_SendClients[nClient].csIP) == FALSE)
+			if(client.OpenConnection(CGetSetOptions::m_SendClients[nClient].csIP) == FALSE)
 			{
-				LogSendRecieveInfo(StrF(_T("ERROR opening connection to %s"), g_Opt.m_SendClients[nClient].csIP));
+				LogSendRecieveInfo(StrF(_T("ERROR opening connection to %s"), CGetSetOptions::m_SendClients[nClient].csIP));
 
-				if(g_Opt.m_SendClients[nClient].bShownFirstError == FALSE)
+				if(CGetSetOptions::m_SendClients[nClient].bShownFirstError == FALSE)
 				{
 					CString cs;
-					cs.Format(_T("Error opening connection to %s"), g_Opt.m_SendClients[nClient].csIP);
+					cs.Format(_T("Error opening connection to %s"), CGetSetOptions::m_SendClients[nClient].csIP);
 					::SendMessage(theApp.m_MainhWnd, WM_SEND_RECIEVE_ERROR, (WPARAM)cs.GetBuffer(cs.GetLength()), 0);
 					cs.ReleaseBuffer();
 
-					g_Opt.m_SendClients[nClient].bShownFirstError = TRUE;
+					CGetSetOptions::m_SendClients[nClient].bShownFirstError = TRUE;
 				}
 
 				continue;
 			}
 
 			//We were connected successfully show an error next time we can't connect
-			g_Opt.m_SendClients[nClient].bShownFirstError = FALSE;
+			CGetSetOptions::m_SendClients[nClient].bShownFirstError = FALSE;
 
 			CClip* pClip;
 			POSITION pos;
@@ -142,12 +142,12 @@ bool CAutoSendToClientThread::SendToClient(CClipList *pClipList)
 					break;
 				}
 
-				LogSendRecieveInfo(StrF(_T("Sending clip to %s"), g_Opt.m_SendClients[nClient].csIP));
+				LogSendRecieveInfo(StrF(_T("Sending clip to %s"), CGetSetOptions::m_SendClients[nClient].csIP));
 
 				if(client.SendItem(pClip, false) == FALSE)
 				{
 					CString cs;
-					cs.Format(_T("Error sending clip to %s"), g_Opt.m_SendClients[nClient].csIP);
+					cs.Format(_T("Error sending clip to %s"), CGetSetOptions::m_SendClients[nClient].csIP);
 					::SendMessage(theApp.m_MainhWnd, WM_SEND_RECIEVE_ERROR, (WPARAM)cs.GetBuffer(cs.GetLength()), 0);
 					cs.ReleaseBuffer();
 					break;

+ 12 - 12
CP_Main.cpp

@@ -211,7 +211,7 @@ BOOL CCP_MainApp::InitInstance()
 	DittoCommandLineInfo cmdInfo;
 	ParseCommandLine(cmdInfo);
 
-	g_Opt.LoadSettings();
+	CGetSetOptions::LoadSettings();
 
 	theApp.m_activeWnd.TrackActiveWnd(false);
 
@@ -238,7 +238,7 @@ BOOL CCP_MainApp::InitInstance()
 	{
 		try
 		{
-			g_Opt.m_bEnableDebugLogging = g_Opt.GetEnableDebugLogging();
+			CGetSetOptions::m_bEnableDebugLogging = CGetSetOptions::GetEnableDebugLogging();
 
 			CClip_ImportExport Clip;
 			CppSQLite3DB db;
@@ -368,10 +368,10 @@ BOOL CCP_MainApp::InitInstance()
 	Log(cs);
 
 	CString csMutex("Ditto Is Now Running");
-	if(g_Opt.GetIsPortableDitto() || g_Opt.GetIsWindowsApp() || g_Opt.GetIsChocolateyApp())
+	if(CGetSetOptions::GetIsPortableDitto() || CGetSetOptions::GetIsWindowsApp() || CGetSetOptions::GetIsChocolateyApp())
 	{
 		csMutex += " ";
-		csMutex += g_Opt.GetExeFileName();
+		csMutex += CGetSetOptions::GetExeFileName();
 	}
 
 	CWinApp::RegisterWithRestartManager(false, csMutex);
@@ -452,7 +452,7 @@ void CCP_MainApp::AfterMainCreate()
 {
 	m_MainhWnd = m_pMainFrame->m_hWnd;
 	ASSERT( ::IsWindow(m_MainhWnd) );
-	g_Opt.SetMainHWND((long)(LONG_PTR)m_MainhWnd);
+	CGetSetOptions::SetMainHWND((long)(LONG_PTR)m_MainhWnd);
 
 	g_HotKeys.Init(m_MainhWnd);
 
@@ -562,7 +562,7 @@ void CCP_MainApp::LoadGlobalClips()
 
 void CCP_MainApp::StartStopServerThread()
 {
-	if(CGetSetOptions::GetDisableRecieve() == FALSE && g_Opt.GetAllowFriends())
+	if(CGetSetOptions::GetDisableRecieve() == FALSE && CGetSetOptions::GetAllowFriends())
 	{
 		AfxBeginThread(MTServerThread, m_MainhWnd);
 	}
@@ -600,10 +600,10 @@ void CCP_MainApp::StartCopyThread()
 	// - pTypes = the supported types to use
 	m_CopyThread.Init(CCopyConfig(m_MainhWnd, true, true, pTypes));
 	
-	if(m_connectOnStartup == FALSE || g_Opt.GetConnectedToClipboard() == FALSE)
+	if(m_connectOnStartup == FALSE || CGetSetOptions::GetConnectedToClipboard() == FALSE)
 	{
 		m_CopyThread.m_connectOnStartup = false;
-		Log(StrF(_T("Starting Ditto up disconnected from the clipboard, commandLine: %d, saved value: %d"), m_connectOnStartup, g_Opt.GetConnectedToClipboard()));
+		Log(StrF(_T("Starting Ditto up disconnected from the clipboard, commandLine: %d, saved value: %d"), m_connectOnStartup, CGetSetOptions::GetConnectedToClipboard()));
 		SetConnectCV(false);
 	}
 	else if(m_connectOnStartup == TRUE)
@@ -893,13 +893,13 @@ void CCP_MainApp::SetStatus(const TCHAR* status, bool bRepaintImmediately)
 
 void CCP_MainApp::ShowPersistent(bool bVal)
 {
-	g_Opt.SetShowPersistent(bVal);
+	CGetSetOptions::SetShowPersistent(bVal);
 
 	// give some visual indication
 	if(m_bShowingQuickPaste)
 	{
 		ASSERT(QPasteWnd());
-		QPasteWnd()->SetCaptionColorActive(g_Opt.m_bShowPersistent, theApp.GetConnectCV());
+		QPasteWnd()->SetCaptionColorActive(CGetSetOptions::m_bShowPersistent, theApp.GetConnectCV());
 		QPasteWnd()->RefreshNc();
 	}
 }
@@ -942,7 +942,7 @@ BOOL CCP_MainApp::OnIdle(LONG lCount)
 void CCP_MainApp::SetConnectCV(bool bConnect)
 { 
 	m_CopyThread.SetConnectCV(bConnect); 
-	g_Opt.SetConnectedToClipboard(bConnect == true);
+	CGetSetOptions::SetConnectedToClipboard(bConnect == true);
 
 	if(bConnect)
 	{
@@ -960,7 +960,7 @@ void CCP_MainApp::SetConnectCV(bool bConnect)
 
 	if(QPasteWnd())
 	{
-		QPasteWnd()->SetCaptionColorActive(g_Opt.m_bShowPersistent, theApp.GetConnectCV());
+		QPasteWnd()->SetCaptionColorActive(CGetSetOptions::m_bShowPersistent, theApp.GetConnectCV());
 		QPasteWnd()->RefreshNc();
 	}
 }

+ 5 - 5
Client.cpp

@@ -137,7 +137,7 @@ BOOL CClient::OpenConnection(const TCHAR* servername)
 	}
 
 	CString parsedServerName = servername;
-	m_connectionPort = g_Opt.m_lPort;
+	m_connectionPort = CGetSetOptions::m_lPort;
 
 	CTokenizer tokenizer(servername, ":");
 	CString token;
@@ -202,9 +202,9 @@ BOOL CClient::SendItem(CClip *pClip, bool manualSend)
 	Info.m_manualSend = manualSend;
 
 	////only send a response port if it's different than the default
-	if (g_Opt.m_lPort != 23443 || m_connectionPort != 23443)
+	if (CGetSetOptions::m_lPort != 23443 || m_connectionPort != 23443)
 	{
-		Info.m_respondPort = g_Opt.m_lPort;
+		Info.m_respondPort = CGetSetOptions::m_lPort;
 	}
 
 	//Send all text over as UTF-8
@@ -261,7 +261,7 @@ BOOL CClient::SendClipFormat(CClipFormat* pCF)
 
 	if(m_SendSocket.m_pEncryptor)
 	{
-		if(m_SendSocket.m_pEncryptor->Encrypt((UCHAR*)pvData, (int)length, g_Opt.m_csPassword, pOutput, nLenOutput))
+		if(m_SendSocket.m_pEncryptor->Encrypt((UCHAR*)pvData, (int)length, CGetSetOptions::m_csPassword, pOutput, nLenOutput))
 		{
 			LogSendRecieveInfo(StrF(_T("AFTER Encrypt clip data %d"), nLenOutput));
 
@@ -320,7 +320,7 @@ HGLOBAL CClient::RequestCopiedFiles(CClipFormat &HDropFormat, CString csIP, CStr
 	pProgress->PumpMessages();
 
 	CString requestFrom;
-	if(g_Opt.GetRequestFilesUsingIP())
+	if(CGetSetOptions::GetRequestFilesUsingIP())
 	{
 		requestFrom = csIP;
 	}

+ 15 - 15
Clip.cpp

@@ -454,7 +454,7 @@ int CClip::LoadFromClipboard(CClipTypes* pClipTypes, bool checkClipboardIgnore,
 
 		if (cf.m_cfType == CF_DIB &&
 			oleData.IsDataAvailable(CF_TEXT) &&
-			g_Opt.GetIgnoreAnnoyingCFDIBSet(TRUE).count(activeApp.MakeLower()))
+			CGetSetOptions::GetIgnoreAnnoyingCFDIBSet(TRUE).count(activeApp.MakeLower()))
 		{
 			Log(StrF(_T("Ignore CF_DIB from %s"), activeApp));
 			continue;
@@ -492,10 +492,10 @@ int CClip::LoadFromClipboard(CClipTypes* pClipTypes, bool checkClipboardIgnore,
 			nSize = GlobalSize(cf.m_hgData);
 			if(nSize > 0)
 			{
-				if(g_Opt.m_lMaxClipSizeInBytes > 0 && (int)nSize > g_Opt.m_lMaxClipSizeInBytes)
+				if(CGetSetOptions::m_lMaxClipSizeInBytes > 0 && (int)nSize > CGetSetOptions::m_lMaxClipSizeInBytes)
 				{
 					CString cs;
-					cs.Format(_T("Maximum clip size reached max size = %d, clip size = %d"), g_Opt.m_lMaxClipSizeInBytes, nSize);
+					cs.Format(_T("Maximum clip size reached max size = %d, clip size = %d"), CGetSetOptions::m_lMaxClipSizeInBytes, nSize);
 					Log(cs);
 
 					oleData.Release();
@@ -548,7 +548,7 @@ int CClip::LoadFromClipboard(CClipTypes* pClipTypes, bool checkClipboardIgnore,
 	bool calledOnCopyScript = false;
 	try
 	{
-		for (auto & listItem : g_Opt.m_copyScripts.m_list)
+		for (auto & listItem : CGetSetOptions::m_copyScripts.m_list)
 		{
 			if (listItem.m_active)
 			{
@@ -592,9 +592,9 @@ int CClip::LoadFromClipboard(CClipTypes* pClipTypes, bool checkClipboardIgnore,
 		auto uString = this->GetUnicodeTextFormat();
 		if (uString != _T(""))
 		{
-			if (uString.GetLength() > g_Opt.m_bDescTextSize)
+			if (uString.GetLength() > CGetSetOptions::m_bDescTextSize)
 			{
-				m_Desc = uString.Left(g_Opt.m_bDescTextSize);
+				m_Desc = uString.Left(CGetSetOptions::m_bDescTextSize);
 			}
 			else
 			{
@@ -606,9 +606,9 @@ int CClip::LoadFromClipboard(CClipTypes* pClipTypes, bool checkClipboardIgnore,
 			auto aString = this->GetCFTextTextFormat();
 			if (aString != "")
 			{
-				if (aString.GetLength() > g_Opt.m_bDescTextSize)
+				if (aString.GetLength() > CGetSetOptions::m_bDescTextSize)
 				{
-					m_Desc = aString.Left(g_Opt.m_bDescTextSize);
+					m_Desc = aString.Left(CGetSetOptions::m_bDescTextSize);
 				}
 				else
 				{
@@ -627,7 +627,7 @@ int CClip::LoadFromClipboard(CClipTypes* pClipTypes, bool checkClipboardIgnore,
 	if (this->m_Desc != _T(""))
 	{
 		std::wstring stringData(this->m_Desc);
-		if (g_Opt.m_regexHelper.TextMatchFilters(activeApp, stringData))
+		if (CGetSetOptions::m_regexHelper.TextMatchFilters(activeApp, stringData))
 		{
 			return -1;
 		}
@@ -661,9 +661,9 @@ bool CClip::SetDescFromText(HGLOBAL hgData, bool unicode)
 		bRet = true;
 	}
 		
-	if(bufLen > g_Opt.m_bDescTextSize)
+	if(bufLen > CGetSetOptions::m_bDescTextSize)
 	{
-		m_Desc = m_Desc.Left(g_Opt.m_bDescTextSize);
+		m_Desc = m_Desc.Left(CGetSetOptions::m_bDescTextSize);
 	}
 	
 	//Unlock the data
@@ -796,8 +796,8 @@ bool CClip::AddToDB(bool bCheckForDuplicates)
 
 	if(bResult)
 	{
-		if(g_Opt.m_csPlaySoundOnCopy.IsEmpty() == FALSE)
-			PlaySound(g_Opt.m_csPlaySoundOnCopy, NULL, SND_FILENAME|SND_ASYNC);
+		if(CGetSetOptions::m_csPlaySoundOnCopy.IsEmpty() == FALSE)
+			PlaySound(CGetSetOptions::m_csPlaySoundOnCopy, NULL, SND_FILENAME|SND_ASYNC);
 
 		if (removeStickySettingClipId > 0)
 		{
@@ -818,9 +818,9 @@ int CClip::FindDuplicate()
 	{
 		//If they are allowing duplicates still check 
 		//the last copied item
-		if(g_Opt.m_bAllowDuplicates)
+		if(CGetSetOptions::m_bAllowDuplicates)
 		{
-			if (g_Opt.m_allowBackToBackDuplicates == FALSE)
+			if (CGetSetOptions::m_allowBackToBackDuplicates == FALSE)
 			{
 				if (m_CRC == m_LastAddedCRC)
 					return m_lastAddedID;

+ 7 - 7
ClipIds.cpp

@@ -25,13 +25,13 @@ HGLOBAL CClipIDs::Render(UINT cfType)
 		return CClip::LoadFormat(ElementAt(0), cfType);
 	}
 
-	CStringA SepA = CTextConvert::UnicodeToAnsi(g_Opt.GetMultiPasteSeparator());
-	CStringW SepW = g_Opt.GetMultiPasteSeparator();
+	CStringA SepA = CTextConvert::UnicodeToAnsi(CGetSetOptions::GetMultiPasteSeparator());
+	CStringW SepW = CGetSetOptions::GetMultiPasteSeparator();
 
 	if(cfType == CF_TEXT)
 	{
 		CCF_TextAggregator CFText(SepA);
-		if(AggregateData(CFText, CF_TEXT, g_Opt.m_bMultiPasteReverse, false))
+		if(AggregateData(CFText, CF_TEXT, CGetSetOptions::m_bMultiPasteReverse, false))
 		{
 			return CFText.GetHGlobal();
 		}
@@ -39,7 +39,7 @@ HGLOBAL CClipIDs::Render(UINT cfType)
 	else if(cfType == CF_UNICODETEXT)
 	{
 		CCF_UnicodeTextAggregator CFUnicodeText(SepW);
-		if(AggregateData(CFUnicodeText, CF_UNICODETEXT, g_Opt.m_bMultiPasteReverse, false))
+		if(AggregateData(CFUnicodeText, CF_UNICODETEXT, CGetSetOptions::m_bMultiPasteReverse, false))
 		{
 			return CFUnicodeText.GetHGlobal();
 		}
@@ -47,7 +47,7 @@ HGLOBAL CClipIDs::Render(UINT cfType)
 	else if(cfType == CF_HDROP)
 	{
 		CCF_HDropAggregator HDrop;
-		if(AggregateData(HDrop, CF_HDROP, g_Opt.m_bMultiPasteReverse, false))
+		if(AggregateData(HDrop, CF_HDROP, CGetSetOptions::m_bMultiPasteReverse, false))
 		{
 			return HDrop.GetHGlobal();
 		}
@@ -55,7 +55,7 @@ HGLOBAL CClipIDs::Render(UINT cfType)
 	else if(cfType == theApp.m_HTML_Format)
 	{
 		CHTMLFormatAggregator Html(SepA);
-		if(AggregateData(Html, theApp.m_HTML_Format, g_Opt.m_bMultiPasteReverse, false))
+		if(AggregateData(Html, theApp.m_HTML_Format, CGetSetOptions::m_bMultiPasteReverse, false))
 		{
 			return Html.GetHGlobal();
 		}
@@ -63,7 +63,7 @@ HGLOBAL CClipIDs::Render(UINT cfType)
 	else if(cfType == theApp.m_RTFFormat)
 	{
 		CRichTextAggregator RichText(SepA);
-		if(AggregateData(RichText, theApp.m_RTFFormat, g_Opt.m_bMultiPasteReverse, false))
+		if(AggregateData(RichText, theApp.m_RTFFormat, CGetSetOptions::m_bMultiPasteReverse, false))
 		{
 			return RichText.GetHGlobal();
 		}

+ 3 - 3
ClipboardViewer.cpp

@@ -157,7 +157,7 @@ void CClipboardViewer::Disconnect(bool bSendPing)
 
 void CClipboardViewer::SendPing()
 {
-	if(g_Opt.m_bEnsureConnectToClipboard)
+	if(CGetSetOptions::m_bEnsureConnectToClipboard)
 	{
 		if(OpenClipboard())
 		{
@@ -267,7 +267,7 @@ void CClipboardViewer::OnDrawClipboard()
 					Log(StrF(_T("OnDrawClipboard:: *** SetTimer *** %d"), GetTickCount()));
 
 					KillTimer(TIMER_DRAW_CLIPBOARD);
-					SetTimer(TIMER_DRAW_CLIPBOARD, g_Opt.m_lProcessDrawClipboardDelay, NULL);		
+					SetTimer(TIMER_DRAW_CLIPBOARD, CGetSetOptions::m_lProcessDrawClipboardDelay, NULL);		
 				}
 			}
 		}
@@ -389,7 +389,7 @@ void CClipboardViewer::OnTimer(UINT_PTR nIDEvent)
 		
 			DWORD dwNow = GetTickCount();
 
-			if(dwNow - m_dwLastCopy > g_Opt.m_dwSaveClipDelay || m_dwLastCopy > dwNow)
+			if(dwNow - m_dwLastCopy > CGetSetOptions::m_dwSaveClipDelay || m_dwLastCopy > dwNow)
 			{
 				if(!::IsClipboardFormatAvailable(theApp.m_cfIgnoreClipboard))
 				{

+ 1 - 1
DatabaseUtilities.cpp

@@ -1117,7 +1117,7 @@ BOOL EnsureDirectory(CString csPath)
 // 		Log(_T("Failed to copy files from device zip file"));
 // 	}
 // 
-// 	g_Opt.nLastDbWriteTime = GetLastWriteTime(csLocalPath);
+// 	CGetSetOptions::nLastDbWriteTime = GetLastWriteTime(csLocalPath);
 // 
 // 	return bRet;
 // }

+ 2 - 2
DittoCopyBuffer.cpp

@@ -125,7 +125,7 @@ bool CDittoCopyBuffer::PutClipOnDittoCopyBuffer(long lClipId, long lBuffer)
 		theApp.m_db.execDMLEx(_T("UPDATE CopyBuffers SET lClipID = %d WHERE lCopyBuffer = %d"), lClipId, lBuffer);
 
 		CCopyBufferItem Item;
-		g_Opt.GetCopyBufferItem(lBuffer, Item);
+		CGetSetOptions::GetCopyBufferItem(lBuffer, Item);
 		if(Item.m_bPlaySoundOnCopy)
 		{
 			PlaySound(_T("ding.wav"), NULL, SND_FILENAME|SND_ASYNC);
@@ -172,7 +172,7 @@ bool CDittoCopyBuffer::PastCopyBuffer(long lCopyBuffer)
 				{
 					theApp.m_pMainFrame->PasteOrShowGroup(q.getIntField(_T("lID")), -1, FALSE, TRUE, false);
 
-					m_pClipboard->m_lRestoreDelay = g_Opt.GetDittoRestoreClipboardDelay();
+					m_pClipboard->m_lRestoreDelay = CGetSetOptions::GetDittoRestoreClipboardDelay();
 
 					Log(StrF(_T("PastCopyBuffer sent paste, starting thread to restore clipboard, Delay = %d"), m_pClipboard->m_lRestoreDelay));
 

+ 1 - 1
DittoPopupWindow.cpp

@@ -27,7 +27,7 @@ int CDittoPopupWindow::OnCreate(LPCREATESTRUCT lpCreateStruct)
 		return -1;
 	}
 
-	CWndEx::SetCaptionOn(CAPTION_TOP, false, g_Opt.m_Theme.GetCaptionSize(), g_Opt.m_Theme.GetCaptionFontSize());
+	CWndEx::SetCaptionOn(CAPTION_TOP, false, CGetSetOptions::m_Theme.GetCaptionSize(), CGetSetOptions::m_Theme.GetCaptionFontSize());
 		
 	m_font.CreateFont(-m_DittoWindow.m_dpi.Scale(12), 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 3, 2, 1, 34, _T("MS Sans Serif"));
 	m_textLabel.Create(_T("test"), WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this);

+ 1 - 1
EditWithButton.cpp

@@ -89,7 +89,7 @@ BOOL CEditWithButton::PreTranslateMessage(MSG* pMsg)
 				CWnd *pWnd = GetParent();
 				if(pWnd)
 				{
-					if(g_Opt.m_bFindAsYouType)
+					if(CGetSetOptions::m_bFindAsYouType)
 					{
 						pWnd->SendMessage(NM_SEARCH_ENTER_PRESSED, 0, 0);
 					}

+ 14 - 14
ExternalWindowTracker.cpp

@@ -224,7 +224,7 @@ bool ExternalWindowTracker::ActivateTarget()
 	//check to see if this app should set focus
 	//this is off by default
 	CString csApp = GetProcessName(m_activeWnd);
-	if(g_Opt.GetSetFocusToApp(csApp))
+	if(CGetSetOptions::GetSetFocusToApp(csApp))
 	{
 		ActivateFocus(m_activeWnd, m_focusWnd);
 	}
@@ -249,7 +249,7 @@ void ExternalWindowTracker::SendPaste(bool activateTarget)
 
 		ActivateTarget();
 		theApp.PumpMessageEx();
-		WaitForActiveWnd(activeWnd, max(25, g_Opt.WaitForActiveWndTimeout()));
+		WaitForActiveWnd(activeWnd, max(25, CGetSetOptions::WaitForActiveWndTimeout()));
 	
 		DWORD endTick = GetTickCount();
 		if((endTick-startTick) > 150)
@@ -261,16 +261,16 @@ void ExternalWindowTracker::SendPaste(bool activateTarget)
 	}
 
 	CString csPasteToApp = GetProcessName(activeWnd);
-	CString csPasteString = g_Opt.GetPasteString(csPasteToApp);
-	DWORD delay = g_Opt.SendKeysDelay();
-	DWORD sendKeysDelay = g_Opt.RealSendKeysDelay();
+	CString csPasteString = CGetSetOptions::GetPasteString(csPasteToApp);
+	DWORD delay = CGetSetOptions::SendKeysDelay();
+	DWORD sendKeysDelay = CGetSetOptions::RealSendKeysDelay();
 
 	m_dittoHasFocus = false;
 	Log(StrF(_T("Sending paste to app %s key stroke: %s, SeDelay: %d"), csPasteToApp, csPasteString, delay));
 
 	bool pasteAsAdmin = false;
 
-	if (g_Opt.GetPasteAsAdmin())
+	if (CGetSetOptions::GetPasteAsAdmin())
 	{
 		pasteAsAdmin = CUAC_Helper::PasteAsAdmin(activeWnd);
 	}
@@ -308,9 +308,9 @@ void ExternalWindowTracker::SendCopy(CopyReasonEnum::CopyReason copyReason)
 	HWND activeWnd = GetForegroundWindow();
 
 	CString csToApp = GetProcessName(activeWnd);
-	CString csString = g_Opt.GetCopyString(csToApp);
-	DWORD delay = g_Opt.SendKeysDelay();
-	DWORD SendKeysDelay = g_Opt.RealSendKeysDelay();
+	CString csString = CGetSetOptions::GetCopyString(csToApp);
+	DWORD delay = CGetSetOptions::SendKeysDelay();
+	DWORD SendKeysDelay = CGetSetOptions::RealSendKeysDelay();
 
 	Sleep(delay);
 
@@ -320,7 +320,7 @@ void ExternalWindowTracker::SendCopy(CopyReasonEnum::CopyReason copyReason)
 
 	bool pasteAsAdmin = false;
 
-	if (g_Opt.GetPasteAsAdmin())
+	if (CGetSetOptions::GetPasteAsAdmin())
 	{
 		pasteAsAdmin = CUAC_Helper::PasteAsAdmin(activeWnd);
 	}
@@ -358,9 +358,9 @@ void ExternalWindowTracker::SendCut()
 	send.AllKeysUp();
 
 	CString csToApp = GetProcessName(m_activeWnd);
-	CString csString = g_Opt.GetCutString(csToApp);
-	DWORD delay = g_Opt.SendKeysDelay();
-	DWORD sendKeysDelay = g_Opt.RealSendKeysDelay();
+	CString csString = CGetSetOptions::GetCutString(csToApp);
+	DWORD delay = CGetSetOptions::SendKeysDelay();
+	DWORD sendKeysDelay = CGetSetOptions::RealSendKeysDelay();
 
 	Sleep(delay);
 
@@ -371,7 +371,7 @@ void ExternalWindowTracker::SendCut()
 
 	bool pasteAsAdmin = false;
 
-	if (g_Opt.GetPasteAsAdmin())
+	if (CGetSetOptions::GetPasteAsAdmin())
 	{
 		pasteAsAdmin = CUAC_Helper::PasteAsAdmin(m_activeWnd);
 	}

+ 2 - 2
GroupTree.cpp

@@ -175,8 +175,8 @@ bool CGroupTree::DoActionClipProperties()
 
 void CGroupTree::FillTree()
 {	
-	this->SetBkColor(g_Opt.m_Theme.GroupTreeBG());
-	this->SetTextColor(g_Opt.m_Theme.GroupTreeText());
+	this->SetBkColor(CGetSetOptions::m_Theme.GroupTreeBG());
+	this->SetTextColor(CGetSetOptions::m_Theme.GroupTreeText());
 
 	DeleteAllItems();
 	m_bSendAllready = false;

+ 3 - 3
HotKeys.cpp

@@ -18,7 +18,7 @@ CHotKey::CHotKey(CString name, DWORD defKey, bool bUnregOnShowDitto, HotKeyType
 {
 	m_Atom = ::GlobalAddAtom(StrF(_T("%s_%d"), m_Name, hkType));
 	ASSERT(m_Atom);
-	m_Key = (DWORD)g_Opt.GetProfileLong(m_Name, (long) defKey);
+	m_Key = (DWORD)CGetSetOptions::GetProfileLong(m_Name, (long) defKey);
 	m_globalId = m_nextId;
 	m_nextId++;
 	m_hkType = hkType;
@@ -152,14 +152,14 @@ void CHotKey::SetKey( DWORD key, bool bSave )
 
 void CHotKey::LoadKey()
 {
-	SetKey((DWORD) g_Opt.GetProfileLong(m_Name, 0));
+	SetKey((DWORD) CGetSetOptions::GetProfileLong(m_Name, 0));
 }
 
 bool CHotKey::SaveKey()
 {
 	if(m_clipId <= 0)
 	{
-		return g_Opt.SetProfileLong( m_Name, (long) m_Key ) != FALSE;
+		return CGetSetOptions::SetProfileLong( m_Name, (long) m_Key ) != FALSE;
 	}
 
 

+ 1 - 1
ImageViewer.cpp

@@ -125,7 +125,7 @@ void CImageViewer::OnPaint()
 	GetClientRect(rect);	
 
 	CBrush  Brush, *pOldBrush;
-	Brush.CreateSolidBrush(g_Opt.m_Theme.DescriptionWindowBG());
+	Brush.CreateSolidBrush(CGetSetOptions::m_Theme.DescriptionWindowBG());
 
 	pOldBrush = memDC.SelectObject(&Brush);
 

+ 20 - 20
MainFrm.cpp

@@ -136,9 +136,9 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
     SetWindowText(_T(""));
 
     Log(_T("Setting polling timer to track focus"));
-    SetTimer(ACTIVE_WINDOW_TIMER, g_Opt.FocusWndTimerTimeout(), 0);
+    SetTimer(ACTIVE_WINDOW_TIMER, CGetSetOptions::FocusWndTimerTimeout(), 0);
 
-	SetTimer(READ_RANDOM_DB_FILE, g_Opt.ReadRandomFileInterval() * 1000, 0);
+	SetTimer(READ_RANDOM_DB_FILE, CGetSetOptions::ReadRandomFileInterval() * 1000, 0);
 
     SetWindowText(_T("Ditto"));
 	
@@ -291,7 +291,7 @@ LRESULT CMainFrame::OnHotKey(WPARAM wParam, LPARAM lParam)
             m_quickPaste.MoveSelection(true);
             m_bMovedSelectionMoveKeyState = true;
         }
-        else if(g_Opt.m_HideDittoOnHotKeyIfAlreadyShown && m_quickPaste.IsWindowTopLevel() && g_Opt.GetShowPersistent() == FALSE)
+        else if(CGetSetOptions::m_HideDittoOnHotKeyIfAlreadyShown && m_quickPaste.IsWindowTopLevel() && CGetSetOptions::GetShowPersistent() == FALSE)
         {
             Log(_T("On Show Ditto HotKey, window is already visible, hiding window"));
             m_quickPaste.HideQPasteWnd();
@@ -447,7 +447,7 @@ LRESULT CMainFrame::OnHotKey(WPARAM wParam, LPARAM lParam)
 
 		theApp.m_activeWnd.SendCopy(CopyReasonEnum::COPY_TO_UNKOWN);
 
-		int delay = g_Opt.GetCopyAndSveDelay();
+		int delay = CGetSetOptions::GetCopyAndSveDelay();
 		Log(StrF(_T("Copy and save clipboard, sending copy, delaying %dms before saving clipboard"), delay));
 		Sleep(delay);
 
@@ -531,7 +531,7 @@ void CMainFrame::DoTextOnlyPaste()
 	Log(_T("Text Only paste, Add cf_text or cf_unicodetext to clipboard"));
 	textOnlyPaste.RestoreTextOnly();
 
-	DWORD pasteDelay = g_Opt.GetTextOnlyPasteDelay();
+	DWORD pasteDelay = CGetSetOptions::GetTextOnlyPasteDelay();
 
 	Log(StrF(_T("Text Only paste, delaying %d ms before sending paste"), pasteDelay));
 
@@ -559,7 +559,7 @@ void CMainFrame::DoFirstTenPositionsPaste(int nPos)
 				"Main.stickyClipOrder DESC, "
 				"Main.clipOrder DESC";
 
-			if (g_Opt.m_bShowAllClipsInMainList)
+			if (CGetSetOptions::m_bShowAllClipsInMainList)
 			{
 				if (CGetSetOptions::GetShowGroupsInMainList())
 				{
@@ -599,7 +599,7 @@ void CMainFrame::DoFirstTenPositionsPaste(int nPos)
 
         if(q.eof() == false)
         {
-			PasteOrShowGroup(q.getIntField(_T("lID")), CGetSetOptions::GetMoveClipsOnGlobal10(), false, g_Opt.m_bSendPasteOnFirstTenHotKeys, pastedFromGroup);
+			PasteOrShowGroup(q.getIntField(_T("lID")), CGetSetOptions::GetMoveClipsOnGlobal10(), false, CGetSetOptions::m_bSendPasteOnFirstTenHotKeys, pastedFromGroup);
         }
     }
     CATCH_SQLITE_EXCEPTION
@@ -607,7 +607,7 @@ void CMainFrame::DoFirstTenPositionsPaste(int nPos)
 
 void CMainFrame::StartKeyModifierTimer()
 {
-	if (g_Opt.m_moveSelectionOnOpenHotkey)
+	if (CGetSetOptions::m_moveSelectionOnOpenHotkey)
 	{
 		m_keyModifiersTimerCount = 0;
 		m_bMovedSelectionMoveKeyState = false;
@@ -666,10 +666,10 @@ void CMainFrame::PasteOrShowGroup(int dbId, BOOL updateClipTime, BOOL activeTarg
 			m_doubleClickGroupId = -1;
 			m_doubleClickGroupStartTime = 0;
 
-			BOOL bItWas = g_Opt.m_bUpdateTimeOnPaste;
+			BOOL bItWas = CGetSetOptions::m_bUpdateTimeOnPaste;
 			if (updateClipTime != -1)
 			{				
-				g_Opt.m_bUpdateTimeOnPaste = updateClipTime;
+				CGetSetOptions::m_bUpdateTimeOnPaste = updateClipTime;
 			}
 
 			CProcessPaste paste;
@@ -690,7 +690,7 @@ void CMainFrame::PasteOrShowGroup(int dbId, BOOL updateClipTime, BOOL activeTarg
 
 			if (updateClipTime != -1)
 			{
-				g_Opt.m_bUpdateTimeOnPaste = bItWas;
+				CGetSetOptions::m_bUpdateTimeOnPaste = bItWas;
 			}
 		}
 	}
@@ -706,8 +706,8 @@ void CMainFrame::DoDittoCopyBufferPaste(int nCopyBuffer)
         if(q.eof() == false)
         {
             //Don't move these to the top
-            BOOL bItWas = g_Opt.m_bUpdateTimeOnPaste;
-            g_Opt.m_bUpdateTimeOnPaste = FALSE;
+            BOOL bItWas = CGetSetOptions::m_bUpdateTimeOnPaste;
+            CGetSetOptions::m_bUpdateTimeOnPaste = FALSE;
 
             CProcessPaste paste;
             paste.GetClipIDs().Add(q.getIntField(_T("lID")));
@@ -715,7 +715,7 @@ void CMainFrame::DoDittoCopyBufferPaste(int nCopyBuffer)
             paste.DoPaste();
             theApp.OnPasteCompleted();
 
-            g_Opt.m_bUpdateTimeOnPaste = bItWas;
+            CGetSetOptions::m_bUpdateTimeOnPaste = bItWas;
         }
     }
     CATCH_SQLITE_EXCEPTION
@@ -761,14 +761,14 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent)
                     KillTimer(KEY_STATE_MODIFIERS);
                     long waitTime = (long)(GetTickCount() - m_startKeyStateTime);
 
-                    if(m_bMovedSelectionMoveKeyState || m_keyModifiersTimerCount > g_Opt.GetKeyStateWaitTimerCount())
+                    if(m_bMovedSelectionMoveKeyState || m_keyModifiersTimerCount > CGetSetOptions::GetKeyStateWaitTimerCount())
                     {
-                        Log(StrF(_T("Timer KEY_STATE_MODIFIERS timeout count hit(%d), count (%d), time (%d), Move Selection from Modifer (%d) sending paste"), g_Opt.GetKeyStateWaitTimerCount(), m_keyModifiersTimerCount, waitTime, m_bMovedSelectionMoveKeyState));
+                        Log(StrF(_T("Timer KEY_STATE_MODIFIERS timeout count hit(%d), count (%d), time (%d), Move Selection from Modifer (%d) sending paste"), CGetSetOptions::GetKeyStateWaitTimerCount(), m_keyModifiersTimerCount, waitTime, m_bMovedSelectionMoveKeyState));
                         m_quickPaste.OnKeyStateUp();
                     }
                     else
                     {
-                        Log(StrF(_T("Timer KEY_STATE_MODIFIERS count NOT hit(%d), count (%d) time (%d)"), g_Opt.GetKeyStateWaitTimerCount(), m_keyModifiersTimerCount, waitTime));
+                        Log(StrF(_T("Timer KEY_STATE_MODIFIERS count NOT hit(%d), count (%d) time (%d)"), CGetSetOptions::GetKeyStateWaitTimerCount(), m_keyModifiersTimerCount, waitTime));
                         m_quickPaste.SetKeyModiferState(false);
                     }
 
@@ -845,10 +845,10 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent)
 		case SET_WINDOWS_THEME_TIMER:
 		{
 			KillTimer(SET_WINDOWS_THEME_TIMER);
-			auto theme = g_Opt.GetTheme();
+			auto theme = CGetSetOptions::GetTheme();
 			if (theme == _T(""))
 			{
-				g_Opt.m_Theme.Load(theme);
+				CGetSetOptions::m_Theme.Load(theme);
 
 				auto visible = m_quickPaste.IsWindowVisibleEx();
 				m_quickPaste.CloseQPasteWnd();
@@ -1242,7 +1242,7 @@ LRESULT CMainFrame::OnOptionsClosed(WPARAM wParam, LPARAM lParam)
 
 	if (themeChanged)
 	{
-		g_Opt.m_Theme.Load(g_Opt.GetTheme());
+		CGetSetOptions::m_Theme.Load(CGetSetOptions::GetTheme());
 
 		m_quickPaste.CloseQPasteWnd();
 	}

+ 1 - 1
MainFrmThread.cpp

@@ -163,7 +163,7 @@ void CMainFrmThread::OnSaveClips()
 			theApp.m_pMainFrame->PostMessageW(WM_SHOW_MSG_WINDOW, (WPARAM) pMsg, pLocalClips->GetTail()->m_parentId);
 		}
 	
-		if(g_Opt.m_lAutoSendClientCount > 0)
+		if(CGetSetOptions::m_lAutoSendClientCount > 0)
 		{
 			m_sendToClientThread.FireSendToClient(pLocalClips);
 		}		

+ 1 - 1
MainTableFunctions.cpp

@@ -72,7 +72,7 @@ CString CMainTableFunctions::GetDisplayText(int nMaxLines, const CString &OrigTe
 	// assign tabs to 2 spaces (rather than the default 8)
 	text.Replace(_T("\t"), _T("  "));
 
-	if(g_Opt.m_bDescShowLeadingWhiteSpace)
+	if(CGetSetOptions::m_bDescShowLeadingWhiteSpace)
 		return text;
 	// else, remove the leading indent from every line.
 

+ 2 - 2
Misc.cpp

@@ -100,7 +100,7 @@ void log(const TCHAR* msg, bool bFromSendRecieve, CString csFile, long lLine)
 #ifndef _DEBUG
 	if(!bFromSendRecieve)
 	{
-		if(!g_Opt.m_bEnableDebugLogging)
+		if(!CGetSetOptions::m_bEnableDebugLogging)
 			return;
 	}
 #endif
@@ -113,7 +113,7 @@ void log(const TCHAR* msg, bool bFromSendRecieve, CString csFile, long lLine)
 
 void logsendrecieveinfo(CString cs, CString csFile, long lLine)
 {
-	if(g_Opt.m_bLogSendReceiveErrors)
+	if(CGetSetOptions::m_bLogSendReceiveErrors)
 		log(cs, true, csFile, lLine);
 }
 

+ 11 - 11
OleClipSource.cpp

@@ -94,7 +94,7 @@ BOOL COleClipSource::DoImmediateRender()
 			m_pasteOptions.m_pasteImagesVertically)
 		{
 			CImageFormatAggregator bigImage(m_pasteOptions.m_pasteImagesHorizontal);
-			if (m_ClipIDs.AggregateData(bigImage, CF_DIB, g_Opt.m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
+			if (m_ClipIDs.AggregateData(bigImage, CF_DIB, CGetSetOptions::m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
 			{
 				CClipFormat cf(CF_DIB, bigImage.GetHGlobal());
 				clip.m_Formats.Add(cf);
@@ -104,9 +104,9 @@ BOOL COleClipSource::DoImmediateRender()
 		}
 		else
 		{
-			CStringA SepA = CTextConvert::UnicodeToAnsi(g_Opt.GetMultiPasteSeparator());
+			CStringA SepA = CTextConvert::UnicodeToAnsi(CGetSetOptions::GetMultiPasteSeparator());
 			CCF_TextAggregator CFText(SepA);
-			if (m_ClipIDs.AggregateData(CFText, CF_TEXT, g_Opt.m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
+			if (m_ClipIDs.AggregateData(CFText, CF_TEXT, CGetSetOptions::m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
 			{
 				CClipFormat cf(CF_TEXT, CFText.GetHGlobal());
 				clip.m_Formats.Add(cf);
@@ -114,9 +114,9 @@ BOOL COleClipSource::DoImmediateRender()
 				cf.m_autoDeleteData = false;
 			}
 
-			CStringW SepW = g_Opt.GetMultiPasteSeparator();
+			CStringW SepW = CGetSetOptions::GetMultiPasteSeparator();
 			CCF_UnicodeTextAggregator CFUnicodeText(SepW);
-			if (m_ClipIDs.AggregateData(CFUnicodeText, CF_UNICODETEXT, g_Opt.m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
+			if (m_ClipIDs.AggregateData(CFUnicodeText, CF_UNICODETEXT, CGetSetOptions::m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
 			{
 				CClipFormat cf(CF_UNICODETEXT, CFUnicodeText.GetHGlobal());
 				clip.m_Formats.Add(cf);
@@ -127,7 +127,7 @@ BOOL COleClipSource::DoImmediateRender()
 			if (m_pasteOptions.LimitFormatsToText() == false)
 			{
 				CCF_HDropAggregator HDrop;
-				if (m_ClipIDs.AggregateData(HDrop, CF_HDROP, g_Opt.m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
+				if (m_ClipIDs.AggregateData(HDrop, CF_HDROP, CGetSetOptions::m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
 				{
 					CClipFormat cf(CF_HDROP, HDrop.GetHGlobal());
 					clip.m_Formats.Add(cf);
@@ -136,7 +136,7 @@ BOOL COleClipSource::DoImmediateRender()
 				}
 
 				CRichTextAggregator RichText(SepA);
-				if (m_ClipIDs.AggregateData(RichText, theApp.m_RTFFormat, g_Opt.m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
+				if (m_ClipIDs.AggregateData(RichText, theApp.m_RTFFormat, CGetSetOptions::m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
 				{
 					CClipFormat cf(theApp.m_RTFFormat, RichText.GetHGlobal());
 					clip.m_Formats.Add(cf);
@@ -145,7 +145,7 @@ BOOL COleClipSource::DoImmediateRender()
 				}
 
 				CHTMLFormatAggregator Html(SepA);
-				if (m_ClipIDs.AggregateData(Html, theApp.m_HTML_Format, g_Opt.m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
+				if (m_ClipIDs.AggregateData(Html, theApp.m_HTML_Format, CGetSetOptions::m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
 				{
 					CClipFormat cf(theApp.m_HTML_Format, Html.GetHGlobal());
 					clip.m_Formats.Add(cf);
@@ -224,7 +224,7 @@ BOOL COleClipSource::DoImmediateRender()
 
 	if (m_pasteOptions.m_pasteScriptGuid != _T(""))
 	{
-		for (auto & element : g_Opt.m_pasteScripts.m_list)
+		for (auto & element : CGetSetOptions::m_pasteScripts.m_list)
 		{
 			if (element.m_guid == m_pasteOptions.m_pasteScriptGuid)
 			{
@@ -745,7 +745,7 @@ void COleClipSource::PlainTextFilter(CClip &clip)
 		hDropIndex > -1)
 	{
 		CCF_HDropAggregator HDrop;
-		if (m_ClipIDs.AggregateData(HDrop, CF_HDROP, g_Opt.m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
+		if (m_ClipIDs.AggregateData(HDrop, CF_HDROP, CGetSetOptions::m_bMultiPasteReverse, m_pasteOptions.LimitFormatsToText()))
 		{
 			clip.m_Formats.RemoveAt(hDropIndex);
 
@@ -1318,7 +1318,7 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
 	int dragId = CGetSetOptions::GetDragId();
 	int origDragId = dragId;
 
-	auto customDragName = g_Opt.GetTempDragFileName();
+	auto customDragName = CGetSetOptions::GetTempDragFileName();
 	if (customDragName != _T(""))
 	{
 		dragId = 1;

+ 16 - 16
OptionFriends.cpp

@@ -77,11 +77,11 @@ BOOL COptionFriends::OnInitDialog()
 	m_SendRecieve.SetCheck(CGetSetOptions::GetLogSendReceiveErrors());
 	m_bDisableRecieve.SetCheck(CGetSetOptions::GetDisableRecieve());
 
-	m_PlaceOnClipboard = g_Opt.m_csIPListToPutOnClipboard;
-	m_csPassword = g_Opt.m_csPassword;
+	m_PlaceOnClipboard = CGetSetOptions::m_csIPListToPutOnClipboard;
+	m_csPassword = CGetSetOptions::m_csPassword;
 	m_csAdditionalPasswords = CGetSetOptions::GetExtraNetworkPassword(false);
 
-	if(g_Opt.GetRequestFilesUsingIP())
+	if(CGetSetOptions::GetRequestFilesUsingIP())
 	{
 		::CheckDlgButton(m_hWnd, IDC_RADIO_USE_IP, BST_CHECKED);
 	}
@@ -115,7 +115,7 @@ BOOL COptionFriends::OnApply()
 		if(client.csDescription == EMPTRY_STRING)
 			client.csDescription = "";
 
-		g_Opt.SetSendClients(client, i);
+		CGetSetOptions::SetSendClients(client, i);
 	}
 
 	CGetSetOptions::SetNetworkPassword(m_csPassword);
@@ -126,21 +126,21 @@ BOOL COptionFriends::OnApply()
 
 	UpdateData();
 
-	g_Opt.SetListToPutOnClipboard(m_PlaceOnClipboard);
-	g_Opt.SetNetworkPassword(m_csPassword);
-	g_Opt.GetClientSendCount();
+	CGetSetOptions::SetListToPutOnClipboard(m_PlaceOnClipboard);
+	CGetSetOptions::SetNetworkPassword(m_csPassword);
+	CGetSetOptions::GetClientSendCount();
 
-	g_Opt.SetExtraNetworkPassword(m_csAdditionalPasswords);
+	CGetSetOptions::SetExtraNetworkPassword(m_csAdditionalPasswords);
 	//get get to refill the array extra passwords
-	g_Opt.GetExtraNetworkPassword(true);
+	CGetSetOptions::GetExtraNetworkPassword(true);
 
 	if(::IsDlgButtonChecked(m_hWnd, IDC_RADIO_USE_IP) == BST_CHECKED)
 	{
-		g_Opt.SetRequestFilesUsingIP(TRUE);
+		CGetSetOptions::SetRequestFilesUsingIP(TRUE);
 	}
 	else if(::IsDlgButtonChecked(m_hWnd, IDC_RADIO_USE_HOST_NAME) == BST_CHECKED)
 	{
-		g_Opt.SetRequestFilesUsingIP(FALSE);
+		CGetSetOptions::SetRequestFilesUsingIP(FALSE);
 	}
 	
 	return CPropertyPage::OnApply();
@@ -181,7 +181,7 @@ void COptionFriends::InsertItems()
 		m_List.InsertItem(&lvi);
 
 //-------------------------------------------------------------------
-		if(g_Opt.m_SendClients[i].bSendAll)
+		if(CGetSetOptions::m_SendClients[i].bSendAll)
 			strItem = "X";
 		else
 			strItem = EMPTRY_STRING;
@@ -190,8 +190,8 @@ void COptionFriends::InsertItems()
 
 //-------------------------------------------------------------------
 
-		strItem = g_Opt.m_SendClients[i].csIP;
-		if(g_Opt.m_SendClients[i].csIP.GetLength() <= 0)
+		strItem = CGetSetOptions::m_SendClients[i].csIP;
+		if(CGetSetOptions::m_SendClients[i].csIP.GetLength() <= 0)
 		{
 			strItem = EMPTRY_STRING;
 		}
@@ -200,8 +200,8 @@ void COptionFriends::InsertItems()
 
 //-------------------------------------------------------------------
 
-		strItem = g_Opt.m_SendClients[i].csDescription;
-		if(g_Opt.m_SendClients[i].csDescription.GetLength() <= 0)
+		strItem = CGetSetOptions::m_SendClients[i].csDescription;
+		if(CGetSetOptions::m_SendClients[i].csDescription.GetLength() <= 0)
 		{
 			strItem = EMPTRY_STRING;
 		}

+ 0 - 1
Options.cpp

@@ -71,7 +71,6 @@ CString CGetSetOptions::m_csIniFileName;
 __int64 CGetSetOptions::nLastDbWriteTime = 0;
 CTheme CGetSetOptions::m_Theme;
 BOOL CGetSetOptions::m_showScrollBar = false;
-CGetSetOptions g_Opt;
 BOOL CGetSetOptions::m_bShowAlwaysOnTopWarning = TRUE;
 CRegExFilterHelper CGetSetOptions::m_regexHelper;
 CString CGetSetOptions::m_ignoreAnnoyingCFDIB = "";

+ 15 - 15
OptionsCopyBuffers.cpp

@@ -53,31 +53,31 @@ BOOL COptionsCopyBuffers::OnInitDialog()
 
 	CCopyBufferItem Item;
 	
-	g_Opt.GetCopyBufferItem(0, Item);
+	CGetSetOptions::GetCopyBufferItem(0, Item);
 	theApp.m_pCopyBuffer1->CopyToCtrl(m_CopyBuffer1, m_hWnd, IDC_WIN_COPY_1);
 	theApp.m_pPasteBuffer1->CopyToCtrl(m_PasteBuffer1, m_hWnd, IDC_WIN_PASTE_1);
 	theApp.m_pCutBuffer1->CopyToCtrl(m_CutBuffer1, m_hWnd, IDC_WIN_CUT_1);
 	CheckDlgButton(IDC_PLAY_SOUND_1, Item.m_bPlaySoundOnCopy);
 
-	g_Opt.GetCopyBufferItem(1, Item);
+	CGetSetOptions::GetCopyBufferItem(1, Item);
 	theApp.m_pCopyBuffer2->CopyToCtrl(m_CopyBuffer2, m_hWnd, IDC_WIN_COPY_2);
 	theApp.m_pPasteBuffer2->CopyToCtrl(m_PasteBuffer2, m_hWnd, IDC_WIN_PASTE_2);
 	theApp.m_pCutBuffer2->CopyToCtrl(m_CutBuffer2, m_hWnd, IDC_WIN_CUT_2);
 	CheckDlgButton(IDC_PLAY_SOUND_2, Item.m_bPlaySoundOnCopy);
 
-	g_Opt.GetCopyBufferItem(2, Item);
+	CGetSetOptions::GetCopyBufferItem(2, Item);
 	theApp.m_pCopyBuffer3->CopyToCtrl(m_CopyBuffer3, m_hWnd, IDC_WIN_COPY_3);
 	theApp.m_pPasteBuffer3->CopyToCtrl(m_PasteBuffer3, m_hWnd, IDC_WIN_PASTE_3);
 	theApp.m_pCutBuffer3->CopyToCtrl(m_CutBuffer3, m_hWnd, IDC_WIN_CUT_3);
 	CheckDlgButton(IDC_PLAY_SOUND_3, Item.m_bPlaySoundOnCopy);
 
-	g_Opt.GetCopyBufferItem(3, Item);
+	CGetSetOptions::GetCopyBufferItem(3, Item);
 	theApp.m_pCopyBuffer4->CopyToCtrl(m_CopyBuffer4, m_hWnd, IDC_WIN_COPY_4);
 	theApp.m_pPasteBuffer4->CopyToCtrl(m_PasteBuffer4, m_hWnd, IDC_WIN_PASTE_4);
 	theApp.m_pCutBuffer4->CopyToCtrl(m_CutBuffer4, m_hWnd, IDC_WIN_CUT_4);
 	CheckDlgButton(IDC_PLAY_SOUND_4, Item.m_bPlaySoundOnCopy);
 
-	g_Opt.GetCopyBufferItem(4, Item);
+	CGetSetOptions::GetCopyBufferItem(4, Item);
 	theApp.m_pCopyBuffer5->CopyToCtrl(m_CopyBuffer5, m_hWnd, IDC_WIN_COPY_5);
 	theApp.m_pPasteBuffer5->CopyToCtrl(m_PasteBuffer5, m_hWnd, IDC_WIN_PASTE_5);
 	theApp.m_pCutBuffer5->CopyToCtrl(m_CutBuffer5, m_hWnd, IDC_WIN_CUT_5);
@@ -114,25 +114,25 @@ BOOL COptionsCopyBuffers::OnApply()
 	theApp.m_pCutBuffer5->CopyFromCtrl(m_CutBuffer5, m_hWnd, IDC_WIN_CUT_5);
 
 	CCopyBufferItem Item;
-	g_Opt.GetCopyBufferItem(0, Item);
+	CGetSetOptions::GetCopyBufferItem(0, Item);
 	Item.m_bPlaySoundOnCopy = IsDlgButtonChecked(IDC_PLAY_SOUND_1);
-	g_Opt.SetCopyBufferItem(0, Item);
+	CGetSetOptions::SetCopyBufferItem(0, Item);
 
-	g_Opt.GetCopyBufferItem(1, Item);
+	CGetSetOptions::GetCopyBufferItem(1, Item);
 	Item.m_bPlaySoundOnCopy = IsDlgButtonChecked(IDC_PLAY_SOUND_2);
-	g_Opt.SetCopyBufferItem(1, Item);
+	CGetSetOptions::SetCopyBufferItem(1, Item);
 
-	g_Opt.GetCopyBufferItem(2, Item);
+	CGetSetOptions::GetCopyBufferItem(2, Item);
 	Item.m_bPlaySoundOnCopy = IsDlgButtonChecked(IDC_PLAY_SOUND_3);
-	g_Opt.SetCopyBufferItem(2, Item);
+	CGetSetOptions::SetCopyBufferItem(2, Item);
 
-	g_Opt.GetCopyBufferItem(3, Item);
+	CGetSetOptions::GetCopyBufferItem(3, Item);
 	Item.m_bPlaySoundOnCopy = IsDlgButtonChecked(IDC_PLAY_SOUND_4);
-	g_Opt.SetCopyBufferItem(3, Item);
+	CGetSetOptions::SetCopyBufferItem(3, Item);
 
-	g_Opt.GetCopyBufferItem(4, Item);
+	CGetSetOptions::GetCopyBufferItem(4, Item);
 	Item.m_bPlaySoundOnCopy = IsDlgButtonChecked(IDC_PLAY_SOUND_5);
-	g_Opt.SetCopyBufferItem(4, Item);
+	CGetSetOptions::SetCopyBufferItem(4, Item);
 
 	INT_PTR x;
 	INT_PTR y;

+ 9 - 9
OptionsGeneral.cpp

@@ -129,8 +129,8 @@ BOOL COptionsGeneral::OnInitDialog()
 		m_eMaxSavedCopies.EnableWindow(FALSE);
 	}
 
-	m_copyAppInclude.SetWindowText(g_Opt.GetCopyAppInclude());
-	m_copyAppExclude.SetWindowText(g_Opt.GetCopyAppExclude());
+	m_copyAppInclude.SetWindowText(CGetSetOptions::GetCopyAppInclude());
+	m_copyAppExclude.SetWindowText(CGetSetOptions::GetCopyAppExclude());
 
 	
 	CGetSetOptions::GetFont(m_LogFont);	
@@ -234,15 +234,15 @@ BOOL COptionsGeneral::OnApply()
 	CString stringVal;
 
 	m_copyAppInclude.GetWindowText(stringVal);
-	g_Opt.SetCopyAppInclude(stringVal);
+	CGetSetOptions::SetCopyAppInclude(stringVal);
 	m_copyAppExclude.GetWindowText(stringVal);
-	g_Opt.SetCopyAppExclude(stringVal);
+	CGetSetOptions::SetCopyAppExclude(stringVal);
 
 	CString csLanguage;
 	if(m_cbLanguage.GetCurSel() >= 0)
 	{
 		m_cbLanguage.GetLBText(m_cbLanguage.GetCurSel(), csLanguage);
-		g_Opt.SetLanguageFile(csLanguage);
+		CGetSetOptions::SetLanguageFile(csLanguage);
 	}
 	
 	if(csLanguage.IsEmpty() == FALSE)
@@ -320,7 +320,7 @@ BOOL COptionsGeneral::OnApply()
 		CGetSetOptions::SetFont(m_LogFont);
 	}
 
-	CString currentTheme = g_Opt.GetTheme();
+	CString currentTheme = CGetSetOptions::GetTheme();
 
 	CString csTheme = _T("");
 	if (m_cbTheme.GetCurSel() >= 0)
@@ -328,16 +328,16 @@ BOOL COptionsGeneral::OnApply()
 		if (m_cbTheme.GetItemData(m_cbTheme.GetCurSel()) == 1)
 		{
 			m_cbTheme.GetLBText(m_cbTheme.GetCurSel(), csTheme);			
-			g_Opt.SetTheme(csTheme);
+			CGetSetOptions::SetTheme(csTheme);
 		}
 		else
 		{
-			g_Opt.SetTheme("");
+			CGetSetOptions::SetTheme("");
 		}
 	}
 	else
 	{
-		g_Opt.SetTheme("");
+		CGetSetOptions::SetTheme("");
 	}
 
 	if (currentTheme != csTheme)

+ 3 - 3
OptionsKeyBoard.cpp

@@ -95,10 +95,10 @@ BOOL COptionsKeyBoard::OnInitDialog()
 	//Unregister hotkeys and Reregister them on cancel or ok
 	g_HotKeys.UnregisterAll();
 
-	m_btSendPaste.SetCheck(g_Opt.m_bSendPasteOnFirstTenHotKeys);
-	m_UseUiGroupForLastTen.SetCheck(g_Opt.GetUseUISelectedGroupForLastTenCopies());
+	m_btSendPaste.SetCheck(CGetSetOptions::m_bSendPasteOnFirstTenHotKeys);
+	m_UseUiGroupForLastTen.SetCheck(CGetSetOptions::GetUseUISelectedGroupForLastTenCopies());
 
-	m_btMoveClipOnGlobal10.SetCheck(g_Opt.GetMoveClipsOnGlobal10());
+	m_btMoveClipOnGlobal10.SetCheck(CGetSetOptions::GetMoveClipsOnGlobal10());
 
 	m_HotKey.SetFocus();
 

+ 12 - 12
OptionsQuickPaste.cpp

@@ -85,12 +85,12 @@ BOOL COptionsQuickPaste::OnInitDialog()
 	m_eTransparencyPercent.SetNumber(CGetSetOptions::GetTransparencyPercent());
 	m_eLinesPerRow.SetNumber(CGetSetOptions::GetLinesPerRow());
 	m_alwaysShowScrollBar.SetCheck(CGetSetOptions::GetShowScrollBar());
-	m_btShowThumbnails.SetCheck(g_Opt.m_bDrawThumbnail);
-	m_btDrawRTF.SetCheck(g_Opt.m_bDrawRTF);
+	m_btShowThumbnails.SetCheck(CGetSetOptions::m_bDrawThumbnail);
+	m_btDrawRTF.SetCheck(CGetSetOptions::m_bDrawRTF);
 
-	m_EnsureEntireWindowVisible.SetCheck(g_Opt.m_bEnsureEntireWindowCanBeSeen);
-	m_ShowAllInMainList.SetCheck(g_Opt.m_bShowAllClipsInMainList);
-	m_FindAsYouType.SetCheck(g_Opt.m_bFindAsYouType);
+	m_EnsureEntireWindowVisible.SetCheck(CGetSetOptions::m_bEnsureEntireWindowCanBeSeen);
+	m_ShowAllInMainList.SetCheck(CGetSetOptions::m_bShowAllClipsInMainList);
+	m_FindAsYouType.SetCheck(CGetSetOptions::m_bFindAsYouType);
 
 	if(CGetSetOptions::GetQuickPastePosition() == POS_AT_CARET)
 		CheckDlgButton(IDC_AT_CARET, BST_CHECKED);
@@ -99,7 +99,7 @@ BOOL COptionsQuickPaste::OnInitDialog()
 	else if(CGetSetOptions::GetQuickPastePosition() == POS_AT_PREVIOUS)
 		CheckDlgButton(IDC_AT_PREVIOUS, BST_CHECKED);
 
-	m_btDescShowLeadingWhiteSpace.SetCheck(g_Opt.m_bDescShowLeadingWhiteSpace);
+	m_btDescShowLeadingWhiteSpace.SetCheck(CGetSetOptions::m_bDescShowLeadingWhiteSpace);
 
 	m_btShowText.SetCheck(CGetSetOptions::GetShowTextForFirstTenHotKeys());
 	m_PromptForDelete.SetCheck(CGetSetOptions::GetPromptWhenDeletingClips());
@@ -147,7 +147,7 @@ BOOL COptionsQuickPaste::OnApply()
 	else if(IsDlgButtonChecked(IDC_AT_PREVIOUS))
 		CGetSetOptions::SetQuickPastePosition(POS_AT_PREVIOUS);
 
-	g_Opt.SetDescShowLeadingWhiteSpace(m_btDescShowLeadingWhiteSpace.GetCheck());
+	CGetSetOptions::SetDescShowLeadingWhiteSpace(m_btDescShowLeadingWhiteSpace.GetCheck());
 	CGetSetOptions::SetShowTextForFirstTenHotKeys(m_btShowText.GetCheck());
 	CGetSetOptions::SetDrawThumbnail(m_btShowThumbnails.GetCheck());
 	CGetSetOptions::SetDrawRTF(m_btDrawRTF.GetCheck());
@@ -169,7 +169,7 @@ BOOL COptionsQuickPaste::OnApply()
 		CGetSetOptions::SetFont(m_LogFont);
 	}
 
-	CString currentTheme = g_Opt.GetTheme();
+	CString currentTheme = CGetSetOptions::GetTheme();
 
 	CString csTheme;
 	if(m_cbTheme.GetCurSel() >= 0)
@@ -177,15 +177,15 @@ BOOL COptionsQuickPaste::OnApply()
 		m_cbTheme.GetLBText(m_cbTheme.GetCurSel(), csTheme);
 		if (csTheme == DEFAULT_THEME)
 		{
-			g_Opt.SetTheme("");
+			CGetSetOptions::SetTheme("");
 			csTheme = _T("");
 		}
 		else
-			g_Opt.SetTheme(csTheme);
+			CGetSetOptions::SetTheme(csTheme);
 	}
 	else
 	{
-		g_Opt.SetTheme("");
+		CGetSetOptions::SetTheme("");
 	}
 
 	if (currentTheme != csTheme)
@@ -195,7 +195,7 @@ BOOL COptionsQuickPaste::OnApply()
 
 	CString diffPath;
 	m_diffPathEditBox.GetWindowText(diffPath);
-	g_Opt.SetDiffApp(diffPath);
+	CGetSetOptions::SetDiffApp(diffPath);
 
 	if (IsDlgButtonChecked(IDC_CHECK_SHOW_CLIP_WAS_PASTED))
 		CGetSetOptions::SetShowIfClipWasPasted(TRUE);

+ 1 - 1
OptionsSheet.cpp

@@ -63,7 +63,7 @@ COptionsSheet::COptionsSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectP
 	AddPage(m_pCopyBuffers);
 	//AddPage(m_pQuickPasteOptions);
 	AddPage(m_pQuickPasteShortCuts);
-	if(g_Opt.GetAllowFriends())
+	if(CGetSetOptions::GetAllowFriends())
 	{
 		m_pFriends = new COptionFriends;
 		AddPage(m_pFriends);

+ 3 - 3
ProcessPaste.cpp

@@ -43,8 +43,8 @@ BOOL CProcessPaste::DoPaste()
 		// 1) we are pasting a single element, since the element is already
 		//    in the db and its lDate was updated by MarkAsPasted().
 		// OR
-		// 2) we are pasting multiple, but g_Opt.m_bSaveMultiPaste is false
-		if (GetClipIDs().GetSize() == 1 || !g_Opt.m_bSaveMultiPaste)
+		// 2) we are pasting multiple, but CGetSetOptions::m_bSaveMultiPaste is false
+		if (GetClipIDs().GetSize() == 1 || !CGetSetOptions::m_bSaveMultiPaste)
 		{
 			m_pOle->CacheGlobalData(theApp.m_cfIgnoreClipboard, NewGlobalP("Ignore", sizeof("Ignore")));
 		}
@@ -189,7 +189,7 @@ UINT CProcessPaste::MarkAsPastedThread(LPVOID pParam)
 		{
 			int clipCount = (int)pData->ids.GetCount();
 
-			if(g_Opt.m_bUpdateTimeOnPaste && 
+			if(CGetSetOptions::m_bUpdateTimeOnPaste && 
 				pData->updateClipOrder &&
 				clipCount == 1)
 			{

+ 30 - 30
QListCtrl.cpp

@@ -83,7 +83,7 @@ int CQListCtrl::GetFirstTenNum(int index)
 
 	if (0 <= index && index <= 9)
 	{
-		firstTenNum = index + g_Opt.m_firstTenHotKeysStart;
+		firstTenNum = index + CGetSetOptions::m_firstTenHotKeysStart;
 		firstTenNum = firstTenNum % 10;
 	}
 
@@ -301,8 +301,8 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 		int nOldBKMode = -1;
 
 		CString csText;
-		LPTSTR lpszText = csText.GetBufferSetLength(g_Opt.m_bDescTextSize);
-		GetItemText(nItem, 0, lpszText, g_Opt.m_bDescTextSize);
+		LPTSTR lpszText = csText.GetBufferSetLength(CGetSetOptions::m_bDescTextSize);
+		GetItemText(nItem, 0, lpszText, CGetSetOptions::m_bDescTextSize);
 		csText.ReleaseBuffer();
 
 		// extract symbols
@@ -320,13 +320,13 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 		{
 			if (bListHasFocus)
 			{
-				crBkgnd = g_Opt.m_Theme.ListBoxSelectedBG();
-				OldColor = pDC->SetTextColor(g_Opt.m_Theme.ListBoxSelectedText());
+				crBkgnd = CGetSetOptions::m_Theme.ListBoxSelectedBG();
+				OldColor = pDC->SetTextColor(CGetSetOptions::m_Theme.ListBoxSelectedText());
 			}
 			else
 			{
-				crBkgnd = g_Opt.m_Theme.ListBoxSelectedNoFocusBG();
-				OldColor = pDC->SetTextColor(g_Opt.m_Theme.ListBoxSelectedNoFocusText());
+				crBkgnd = CGetSetOptions::m_Theme.ListBoxSelectedNoFocusBG();
+				OldColor = pDC->SetTextColor(CGetSetOptions::m_Theme.ListBoxSelectedNoFocusText());
 			}
 		}
 		else
@@ -334,13 +334,13 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 			//Shade alternating Rows
 			if ((nItem % 2) == 0)
 			{
-				crBkgnd = g_Opt.m_Theme.ListBoxOddRowsBG();
-				OldColor = pDC->SetTextColor(g_Opt.m_Theme.ListBoxOddRowsText());
+				crBkgnd = CGetSetOptions::m_Theme.ListBoxOddRowsBG();
+				OldColor = pDC->SetTextColor(CGetSetOptions::m_Theme.ListBoxOddRowsText());
 			}
 			else
 			{
-				crBkgnd = g_Opt.m_Theme.ListBoxEvenRowsBG();
-				OldColor = pDC->SetTextColor(g_Opt.m_Theme.ListBoxEvenRowsText());
+				crBkgnd = CGetSetOptions::m_Theme.ListBoxEvenRowsBG();
+				OldColor = pDC->SetTextColor(CGetSetOptions::m_Theme.ListBoxEvenRowsText());
 			}
 		}
 
@@ -360,7 +360,7 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 			pastedRect.left++;
 			pastedRect.right = pastedRect.left + m_windowDpi->Scale(2);
 
-			pDC->FillSolidRect(pastedRect, g_Opt.m_Theme.ClipPastedColor());
+			pDC->FillSolidRect(pastedRect, CGetSetOptions::m_Theme.ClipPastedColor());
 		}
 
 		// set firstTenNum to the first ten number (1-10) corresponding to
@@ -426,7 +426,7 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 
 		if (DrawRtfText(nItem, rcText, pDC) == FALSE)
 		{
-			auto highlightColor = g_Opt.m_Theme.SearchTextHighlight();
+			auto highlightColor = CGetSetOptions::m_Theme.SearchTextHighlight();
 			//use unprintable characters so it doesn't find copied html to convert
 			if (m_searchText.GetLength() > 0 &&
 				FindNoCaseAndInsert(csText, m_searchText, StrF(_T("\x01\x04 color='#%02x%02x%02x'\x02"), GetRValue(highlightColor), GetGValue(highlightColor), GetBValue(highlightColor)), _T("\x01\x03\x04\x02"), m_linesPerRow) > 0)
@@ -467,9 +467,9 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 			crHotKey.top += m_windowDpi->Scale(1 + extraFromClipWasPaste);
 
 			HFONT hOldFont = (HFONT)pDC->SelectObject(m_SmallFont);
-			COLORREF localOldTextColor = pDC->SetTextColor(g_Opt.m_Theme.ListSmallQuickPasteIndexColor());
+			COLORREF localOldTextColor = pDC->SetTextColor(CGetSetOptions::m_Theme.ListSmallQuickPasteIndexColor());
 
-			CPen pen(PS_SOLID, 0, g_Opt.m_Theme.ListSmallQuickPasteIndexColor());
+			CPen pen(PS_SOLID, 0, CGetSetOptions::m_Theme.ListSmallQuickPasteIndexColor());
 			CPen* pOldPen = pDC->SelectObject(&pen);
 
 			pDC->DrawText(cs, crHotKey, DT_BOTTOM);
@@ -495,7 +495,7 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 
 void CQListCtrl::DrawCopiedColorCode(CString& csText, CRect& rcText, CDC* pDC)
 {
-	if (g_Opt.m_bDrawCopiedColorCode == FALSE)
+	if (CGetSetOptions::m_bDrawCopiedColorCode == FALSE)
 		return;
 
 	CString trimmedText = CString(csText).Trim(L'»').Trim().Trim('#');
@@ -549,7 +549,7 @@ void CQListCtrl::DrawCopiedColorCode(CString& csText, CRect& rcText, CDC* pDC)
 
 BOOL CQListCtrl::DrawRtfText(int nItem, CRect &crRect, CDC *pDC)
 {
-	if (g_Opt.m_bDrawRTF == FALSE)
+	if (CGetSetOptions::m_bDrawRTF == FALSE)
 		return FALSE;
 
 	BOOL bRet = FALSE;
@@ -598,7 +598,7 @@ BOOL CQListCtrl::DrawRtfText(int nItem, CRect &crRect, CDC *pDC)
 // ALL items are cached in m_ThumbNails (those without images are cached with NULL m_hgData)
 BOOL CQListCtrl::DrawBitMap(int nItem, CRect &crRect, CDC *pDC, const CString &csDescription)
 {
-	if (g_Opt.m_bDrawThumbnail == FALSE)
+	if (CGetSetOptions::m_bDrawThumbnail == FALSE)
 		return FALSE;
 
 	CClipFormatQListCtrl *format = GetItem_CF_DIB_ClipFormat(nItem);
@@ -646,7 +646,7 @@ BOOL CQListCtrl::OnEraseBkgnd(CDC* pDC)
 
 	CRect rect;
 	GetClientRect(&rect);
-	CBrush myBrush(g_Opt.m_Theme.MainWindowBG());    // dialog background color
+	CBrush myBrush(CGetSetOptions::m_Theme.MainWindowBG());    // dialog background color
 	CBrush *pOld = pDC->SelectObject(&myBrush);
 	BOOL bRes = pDC->PatBlt(0, 0, rect.Width(), rect.Height(), PATCOPY);
 	pDC->SelectObject(pOld);    // restore old brush
@@ -682,9 +682,9 @@ BOOL CQListCtrl::OnToolTipText(UINT id, NMHDR * pNMHDR, LRESULT * pResult)
 
 	::SendMessage(pNMHDR->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 500);
 
-	if (g_Opt.m_tooltipTimeout > 0)
+	if (CGetSetOptions::m_tooltipTimeout > 0)
 	{
-		::SendMessage(pNMHDR->hwndFrom, TTM_SETDELAYTIME, TTDT_AUTOPOP, MAKELPARAM(g_Opt.m_tooltipTimeout, 0));
+		::SendMessage(pNMHDR->hwndFrom, TTM_SETDELAYTIME, TTDT_AUTOPOP, MAKELPARAM(CGetSetOptions::m_tooltipTimeout, 0));
 	}
 
 	// Use Item's name as the tool tip. Change this for something different.
@@ -779,8 +779,8 @@ int CQListCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
 	if (CListCtrl::OnCreate(lpCreateStruct) == -1)
 		return -1;
 
-	if (g_Opt.m_tooltipTimeout > 0 ||
-		g_Opt.m_tooltipTimeout == -1)
+	if (CGetSetOptions::m_tooltipTimeout > 0 ||
+		CGetSetOptions::m_tooltipTimeout == -1)
 	{
 		EnableToolTips();
 	}
@@ -1174,7 +1174,7 @@ void CQListCtrl::GetToolTipText(int nItem, CString &csText)
 		info.lItem = nItem;
 		//plus 100 for extra info - shortcut and such
 		int maxCharacters = CGetSetOptions::GetMaxToolTipCharacters();
-		info.cchTextMax = min(maxCharacters, g_Opt.m_bDescTextSize) + 200;
+		info.cchTextMax = min(maxCharacters, CGetSetOptions::m_bDescTextSize) + 200;
 		info.pszText = csText.GetBufferSetLength(info.cchTextMax);
 
 		pParent->SendMessage(WM_NOTIFY, (WPARAM)info.hdr.idFrom, (LPARAM)&info);
@@ -1292,7 +1292,7 @@ void CQListCtrl::LoadDittoCopyBufferHotkeys()
 	CCopyBufferItem Item;
 	CAccel a;
 
-	g_Opt.GetCopyBufferItem(0, Item);
+	CGetSetOptions::GetCopyBufferItem(0, Item);
 	if (Item.m_lCopyHotKey > 0)
 	{
 		a.Cmd = COPY_BUFFER_HOT_KEY_1_ID;
@@ -1300,7 +1300,7 @@ void CQListCtrl::LoadDittoCopyBufferHotkeys()
 		m_Accels.AddAccel(a);
 	}
 
-	g_Opt.GetCopyBufferItem(1, Item);
+	CGetSetOptions::GetCopyBufferItem(1, Item);
 	if (Item.m_lCopyHotKey > 0)
 	{
 		a.Cmd = COPY_BUFFER_HOT_KEY_2_ID;
@@ -1308,7 +1308,7 @@ void CQListCtrl::LoadDittoCopyBufferHotkeys()
 		m_Accels.AddAccel(a);
 	}
 
-	g_Opt.GetCopyBufferItem(2, Item);
+	CGetSetOptions::GetCopyBufferItem(2, Item);
 	if (Item.m_lCopyHotKey > 0)
 	{
 		a.Cmd = COPY_BUFFER_HOT_KEY_3_ID;
@@ -1350,7 +1350,7 @@ void CQListCtrl::OnSelectionChange(NMHDR* pNMHDR, LRESULT* pResult)
 		{
 			this->ShowFullDescription(false, true);
 		}
-		if (g_Opt.m_bAllwaysShowDescription)
+		if (CGetSetOptions::m_bAllwaysShowDescription)
 		{
 			KillTimer(TIMER_SHOW_PROPERTIES);
 			SetTimer(TIMER_SHOW_PROPERTIES, 300, NULL);
@@ -1497,7 +1497,7 @@ BOOL CQListCtrl::OnItemDeleted(long lID)
 
 void CQListCtrl::OnMouseMove(UINT nFlags, CPoint point)
 {
-	if (g_Opt.m_showScrollBar == FALSE)
+	if (CGetSetOptions::m_showScrollBar == FALSE)
 	{
 		CPoint cursorPos;
 		GetCursorPos(&cursorPos);
@@ -1676,7 +1676,7 @@ void CQListCtrl::CreateSmallFont()
 {
 	LOGFONT lf;
 
-	lf.lfHeight = -MulDiv(g_Opt.GetFirstTenHotKeysFontSize(), m_windowDpi->GetDPI(), 72);
+	lf.lfHeight = -MulDiv(CGetSetOptions::GetFirstTenHotKeysFontSize(), m_windowDpi->GetDPI(), 72);
 	lf.lfWidth = 0;
 	lf.lfEscapement = 0;
 	lf.lfOrientation = 0;

+ 115 - 115
QPasteWnd.cpp

@@ -528,10 +528,10 @@ void CQPasteWnd::LoadShortcuts()
 		{
 			for (int i = 0; i < 10; i++)
 			{
-				int a = g_Opt.GetActionShortCutA(action, i);
+				int a = CGetSetOptions::GetActionShortCutA(action, i);
 				if (a > 0)
 				{
-					int b = g_Opt.GetActionShortCutB(action, i);
+					int b = CGetSetOptions::GetActionShortCutB(action, i);
 					m_actions.AddAccel(action, a, b);
 
 					//always add a shift variation to show description F3 so it will search backwards in the text search
@@ -570,14 +570,14 @@ void CQPasteWnd::LoadShortcuts()
 		}
 	}
 
-	for (auto & element : g_Opt.m_pasteScripts.m_list)
+	for (auto & element : CGetSetOptions::m_pasteScripts.m_list)
 	{
 		for (int i = 0; i < 10; i++)
 		{
-			int a = g_Opt.GetActionShortCutA(ActionEnums::PASTE_SCRIPT, i, element.m_guid);
+			int a = CGetSetOptions::GetActionShortCutA(ActionEnums::PASTE_SCRIPT, i, element.m_guid);
 			if (a > 0)
 			{
-				int b = g_Opt.GetActionShortCutB(ActionEnums::PASTE_SCRIPT, i, element.m_guid);
+				int b = CGetSetOptions::GetActionShortCutB(ActionEnums::PASTE_SCRIPT, i, element.m_guid);
 				m_actions.AddAccel(ActionEnums::PASTE_SCRIPT, a, b, element.m_guid);
 			}
 		}
@@ -660,7 +660,7 @@ void CQPasteWnd::MoveControls()
 
 	int searchRowStart = 33;
 
-	/*if(g_Opt.m_bShowPersistent)
+	/*if(CGetSetOptions::m_bShowPersistent)
 	{
 		searchRowStart = 41;
 	}*/
@@ -671,7 +671,7 @@ void CQPasteWnd::MoveControls()
 	int extraSize = 0;
 
 	if (m_showScrollBars == false &&
-		g_Opt.m_showScrollBar == false)
+		CGetSetOptions::m_showScrollBar == false)
 	{
 		extraSize = m_DittoWindow.m_dpi.Scale(::GetSystemMetrics(SM_CXVSCROLL));
 
@@ -707,8 +707,8 @@ void CQPasteWnd::MoveControls()
 
 	m_ShowGroupsFolderBottom.MoveWindow(m_DittoWindow.m_dpi.Scale(4), cy - m_DittoWindow.m_dpi.Scale(28), m_DittoWindow.m_dpi.Scale(24), m_DittoWindow.m_dpi.Scale(24));
 
-	/*if (g_Opt.m_bShowPersistent &&
-		g_Opt.m_bShowAlwaysOnTopWarning)
+	/*if (CGetSetOptions::m_bShowPersistent &&
+		CGetSetOptions::m_bShowAlwaysOnTopWarning)
 	{
 		m_alwaysOnToWarningStatic.ShowWindow(SW_SHOW);
 		m_alwaysOnToWarningStatic.MoveWindow(m_DittoWindow.m_dpi.Scale(2), cy - m_DittoWindow.m_dpi.Scale(18), cx - m_DittoWindow.m_dpi.Scale(4), m_DittoWindow.m_dpi.Scale(17));
@@ -751,11 +751,11 @@ void CQPasteWnd::OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized)
 
 		m_bModifersMoveActive = false;
 
-		if (!g_Opt.m_bShowPersistent)
+		if (!CGetSetOptions::m_bShowPersistent)
 		{
 			HideQPasteWindow(false);
 		}
-		else if (g_Opt.GetAutoHide())
+		else if (CGetSetOptions::GetAutoHide())
 		{
 			MinMaxWindow(FORCE_MIN);
 		}
@@ -802,7 +802,7 @@ BOOL CQPasteWnd::HideQPasteWindow(bool releaseFocus, BOOL clearSearchData)
 {
 	if (clearSearchData = -1)
 	{
-		if ((g_Opt.m_maintainSearchView || g_Opt.m_refreshViewAfterPasting == false) &&
+		if ((CGetSetOptions::m_maintainSearchView || CGetSetOptions::m_refreshViewAfterPasting == false) &&
 			m_strSearch != _T(""))
 		{
 			Log(_T("Currently searching for something and setting to maintain search view is enabled, not refreshing"));
@@ -922,10 +922,10 @@ BOOL CQPasteWnd::ShowQPasteWindow(BOOL bFillList)
 	Log(StrF(_T("Start - ShowQPasteWindow - Fill List: %d, array count: %d"), bFillList, m_listItems.size()));
 
 	//Ensure we have the latest theme file, this checks the last write time so it doesn't read the file each time
-	g_Opt.m_Theme.Load(g_Opt.GetTheme(), false, true);
+	CGetSetOptions::m_Theme.Load(CGetSetOptions::GetTheme(), false, true);
 
-	SetCaptionColorActive(g_Opt.m_bShowPersistent, theApp.GetConnectCV());
-	SetCaptionOn(CGetSetOptions::GetCaptionPos(), true, g_Opt.m_Theme.GetCaptionSize(), g_Opt.m_Theme.GetCaptionFontSize());
+	SetCaptionColorActive(CGetSetOptions::m_bShowPersistent, theApp.GetConnectCV());
+	SetCaptionOn(CGetSetOptions::GetCaptionPos(), true, CGetSetOptions::m_Theme.GetCaptionSize(), CGetSetOptions::m_Theme.GetCaptionFontSize());
 
 	UpdateStatus();
 
@@ -946,9 +946,9 @@ BOOL CQPasteWnd::ShowQPasteWindow(BOOL bFillList)
 		MoveControls();
 	}
 
-	// always on top... for persistent showing (g_Opt.m_bShowPersistent)
+	// always on top... for persistent showing (CGetSetOptions::m_bShowPersistent)
 	// SHOWWINDOW was also integrated into this function rather than calling it separately
-	if (g_Opt.GetShowPersistent())
+	if (CGetSetOptions::GetShowPersistent())
 	{
 		::SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
 	}
@@ -990,7 +990,7 @@ BOOL CQPasteWnd::OpenID(int id, CSpecialPasteOptions pasteOptions)
 	// else, it is a clip, so paste it
 	CProcessPaste paste;
 
-	paste.m_bSendPaste = g_Opt.m_bSendPasteMessageAfterSelection == TRUE ? true : false;
+	paste.m_bSendPaste = CGetSetOptions::m_bSendPasteMessageAfterSelection == TRUE ? true : false;
 	paste.m_pasteOptions = pasteOptions;
 	paste.m_pastedFromGroup = (theApp.m_GroupID > 0);
 
@@ -1000,12 +1000,12 @@ BOOL CQPasteWnd::OpenID(int id, CSpecialPasteOptions pasteOptions)
 	{
 		theApp.OnPasteCompleted();
 
-		if (g_Opt.m_bSendPasteMessageAfterSelection == FALSE)
+		if (CGetSetOptions::m_bSendPasteMessageAfterSelection == FALSE)
 		{
 			theApp.m_activeWnd.ActivateTarget();
 		}
 
-		if (g_Opt.m_bShowPersistent && g_Opt.GetAutoHide())
+		if (CGetSetOptions::m_bShowPersistent && CGetSetOptions::GetAutoHide())
 		{
 			MinMaxWindow(FORCE_MIN);
 		}
@@ -1043,7 +1043,7 @@ BOOL CQPasteWnd::OpenSelection(CSpecialPasteOptions pasteOptions)
 
 	CProcessPaste paste;
 
-	paste.m_bSendPaste = g_Opt.m_bSendPasteMessageAfterSelection == TRUE ? true : false;
+	paste.m_bSendPaste = CGetSetOptions::m_bSendPasteMessageAfterSelection == TRUE ? true : false;
 	paste.m_pasteOptions = pasteOptions;
 	paste.m_pastedFromGroup = (theApp.m_GroupID > 0);
 
@@ -1053,12 +1053,12 @@ BOOL CQPasteWnd::OpenSelection(CSpecialPasteOptions pasteOptions)
 	{
 		theApp.OnPasteCompleted();
 
-		if (g_Opt.m_bSendPasteMessageAfterSelection == FALSE)
+		if (CGetSetOptions::m_bSendPasteMessageAfterSelection == FALSE)
 		{
 			theApp.m_activeWnd.ActivateTarget();
 		}
 
-		if (g_Opt.m_bShowPersistent && g_Opt.GetAutoHide())
+		if (CGetSetOptions::m_bShowPersistent && CGetSetOptions::GetAutoHide())
 		{
 			MinMaxWindow(FORCE_MIN);
 		}
@@ -1091,7 +1091,7 @@ BOOL CQPasteWnd::NewGroup(bool bGroupSelection, int parentId)
 	CGroupName Name;
 	CString csName("");
 
-	if (g_Opt.m_bPrompForNewGroupName)
+	if (CGetSetOptions::m_bPrompForNewGroupName)
 	{
 		m_bHideWnd = false;
 
@@ -1184,7 +1184,7 @@ LRESULT CQPasteWnd::OnReloadClipInUI(WPARAM wParam, LPARAM lParam)
 	int clipId = (int)wParam;
 	int updateFlags = (int)lParam;
 
-	if (g_Opt.m_maintainSearchView &&
+	if (CGetSetOptions::m_maintainSearchView &&
 		m_strSearch != _T("") &&
 		updateFlags & UPDATE_AFTER_PASTE_SELECT_CLIP)
 	{
@@ -1324,7 +1324,7 @@ void CQPasteWnd::UpdateStatus(bool bRepaintImmediately)
 {
 	CString title = m_Title;
 
-	if (g_Opt.m_bShowPersistent)
+	if (CGetSetOptions::m_bShowPersistent)
 	{
 		title = (StrF(_T("%s %s"), _T(QPASTE_TITLE), theApp.m_Language.GetString("top_window", "[Always on top]")));
 	}
@@ -1363,7 +1363,7 @@ void CQPasteWnd::UpdateStatus(bool bRepaintImmediately)
 
 	CString windowTitle = _T(QPASTE_TITLE);
 
-	if (g_Opt.m_bShowPersistent)
+	if (CGetSetOptions::m_bShowPersistent)
 	{
 		windowTitle += StrF(_T(" %s"), theApp.m_Language.GetString("top_window", "[Always on top]"));
 	}
@@ -1403,7 +1403,7 @@ BOOL CQPasteWnd::FillList(CString csSQLSearch)
 			"Main.bIsGroup ASC, "			
 			"Main.clipOrder DESC";
 
-		if (g_Opt.m_bShowAllClipsInMainList)
+		if (CGetSetOptions::m_bShowAllClipsInMainList)
 		{
 			if (CGetSetOptions::GetShowGroupsInMainList())
 			{
@@ -1630,7 +1630,7 @@ void CQPasteWnd::ShowRightClickMenu()
 		CMenu *sendToMenu = CMultiLanguage::GetMenuPos(cmSubMenu, specialPaste, nPos, TRUE);
 		if (sendToMenu != NULL)
 		{
-			g_Opt.m_pasteScripts.AddToMenu(sendToMenu, &m_actions);
+			CGetSetOptions::m_pasteScripts.AddToMenu(sendToMenu, &m_actions);
 		}
 
 		theApp.m_Language.UpdateRightClickMenu(cmSubMenu);
@@ -1657,7 +1657,7 @@ void CQPasteWnd::SetFriendChecks(CMenu *pMenu)
 	SetSendToMenu(pMenu, ID_MENU_SENTTO_FRIEND_FORETEEN, 13);
 	SetSendToMenu(pMenu, ID_MENU_SENTTO_FRIEND_FIFTEEN, 14);
 
-	if (g_Opt.GetAllowFriends() == false)
+	if (CGetSetOptions::GetAllowFriends() == false)
 	{
 		CString csText("Send To");
 		int nPos = -1;
@@ -1783,7 +1783,7 @@ void CQPasteWnd::SetMenuChecks(CMenu *pMenu)
 		pMenu->CheckMenuItem(ID_MENU_FIRSTTENHOTKEYS_USECTRLNUM, MF_CHECKED);
 	}
 
-	if (g_Opt.m_bShowPersistent)
+	if (CGetSetOptions::m_bShowPersistent)
 	{
 		pMenu->CheckMenuItem(ID_MENU_ALLWAYSONTOP, MF_CHECKED);
 	}
@@ -1832,47 +1832,47 @@ void CQPasteWnd::SetMenuChecks(CMenu *pMenu)
 		pMenu->CheckMenuItem(ID_MENU_QUICKOPTIONS_PROMPTFORNEWGROUPNAMES, MF_CHECKED);
 	}
 
-	if (g_Opt.m_bDrawThumbnail)
+	if (CGetSetOptions::m_bDrawThumbnail)
 	{
 		pMenu->CheckMenuItem(ID_MENU_QUICKOPTIONS_SHOWTHUMBNAILS, MF_CHECKED);
 	}
 
-	if (g_Opt.m_bDrawRTF)
+	if (CGetSetOptions::m_bDrawRTF)
 	{
 		pMenu->CheckMenuItem(ID_MENU_QUICKOPTIONS_DRAWRTFTEXT, MF_CHECKED);
 	}
 
-	if (g_Opt.m_bSendPasteMessageAfterSelection)
+	if (CGetSetOptions::m_bSendPasteMessageAfterSelection)
 	{
 		pMenu->CheckMenuItem(ID_MENU_QUICKOPTIONS_PASTECLIPAFTERSELECTION, MF_CHECKED);
 	}
 
-	if (g_Opt.m_bFindAsYouType)
+	if (CGetSetOptions::m_bFindAsYouType)
 	{
 		pMenu->CheckMenuItem(ID_MENU_QUICKOPTIONS_FINDASYOUTYPE, MF_CHECKED);
 	}
 
-	if (g_Opt.m_bEnsureEntireWindowCanBeSeen)
+	if (CGetSetOptions::m_bEnsureEntireWindowCanBeSeen)
 	{
 		pMenu->CheckMenuItem(ID_MENU_QUICKOPTIONS_ENSUREENTIREWINDOWISVISIBLE, MF_CHECKED);
 	}
 
-	if (g_Opt.m_bShowAllClipsInMainList)
+	if (CGetSetOptions::m_bShowAllClipsInMainList)
 	{
 		pMenu->CheckMenuItem(ID_MENU_QUICKOPTIONS_SHOWCLIPSTHATAREINGROUPSINMAINLIST, MF_CHECKED);
 	}
 
-	if (g_Opt.GetPromptWhenDeletingClips())
+	if (CGetSetOptions::GetPromptWhenDeletingClips())
 	{
 		pMenu->CheckMenuItem(ID_QUICKOPTIONS_PROMPTTODELETECLIP, MF_CHECKED);
 	}
 
-	if (g_Opt.GetPasteAsAdmin())
+	if (CGetSetOptions::GetPasteAsAdmin())
 	{
 		pMenu->CheckMenuItem(ID_QUICKOPTIONS_ELEVATEPREVILEGESTOPASTEINTOELEVATEDAPPS, MF_CHECKED);
 	}
 
-	if (g_Opt.GetShowInTaskBar())
+	if (CGetSetOptions::GetShowInTaskBar())
 	{
 		pMenu->CheckMenuItem(ID_QUICKOPTIONS_SHOWINTASKBAR, MF_CHECKED);
 	}
@@ -1911,16 +1911,16 @@ void CQPasteWnd::SetMenuChecks(CMenu *pMenu)
 
 void CQPasteWnd::SetSendToMenu(CMenu *pMenu, int nMenuID, int nArrayPos)
 {
-	if (g_Opt.m_SendClients[nArrayPos].csIP.GetLength() > 0)
+	if (CGetSetOptions::m_SendClients[nArrayPos].csIP.GetLength() > 0)
 	{
 		CString cs;
-		if (g_Opt.m_SendClients[nArrayPos].csDescription != _T(""))
+		if (CGetSetOptions::m_SendClients[nArrayPos].csDescription != _T(""))
 		{
-			cs.Format(_T("(%s) - %s"), g_Opt.m_SendClients[nArrayPos].csIP, g_Opt.m_SendClients[nArrayPos].csDescription);
+			cs.Format(_T("(%s) - %s"), CGetSetOptions::m_SendClients[nArrayPos].csIP, CGetSetOptions::m_SendClients[nArrayPos].csDescription);
 		}
 		else
 		{
-			cs.Format(_T("%s"), g_Opt.m_SendClients[nArrayPos].csIP);
+			cs.Format(_T("%s"), CGetSetOptions::m_SendClients[nArrayPos].csIP);
 		}
 		pMenu->ModifyMenu(nMenuID, MF_BYCOMMAND, nMenuID, cs);
 	}
@@ -2077,11 +2077,11 @@ void CQPasteWnd::UpdateFont()
 	m_groupFont.DeleteObject();
 	m_groupFont.CreateFont(-m_DittoWindow.m_dpi.Scale(12), 0, 0, 0, 400, 0, 1, 0, DEFAULT_CHARSET, 3, 2, 1, 34, _T("Segoe UI"));
 	m_stGroup.SetFont(&m_groupFont);
-	m_stGroup.SetBkColor(g_Opt.m_Theme.MainWindowBG());
-	m_stGroup.SetTextColor(g_Opt.m_Theme.ListBoxEvenRowsText());
+	m_stGroup.SetBkColor(CGetSetOptions::m_Theme.MainWindowBG());
+	m_stGroup.SetTextColor(CGetSetOptions::m_Theme.ListBoxEvenRowsText());
 
-	m_noSearchResultsStatic.SetBkColor(g_Opt.m_Theme.MainWindowBG());
-	m_noSearchResultsStatic.SetTextColor(g_Opt.m_Theme.ListBoxEvenRowsText());
+	m_noSearchResultsStatic.SetBkColor(CGetSetOptions::m_Theme.MainWindowBG());
+	m_noSearchResultsStatic.SetTextColor(CGetSetOptions::m_Theme.ListBoxEvenRowsText());
 	m_noSearchResultsStatic.SetFont(&m_SearchFont);
 
 	m_lstHeader.CreateSmallFont();
@@ -2103,25 +2103,25 @@ void CQPasteWnd::OnMenuFirsttenhotkeysShowhotkeytext()
 
 void CQPasteWnd::OnViewcaptionbaronRight()
 {
-	SetCaptionOn(CAPTION_RIGHT, false, g_Opt.m_Theme.GetCaptionSize(), g_Opt.m_Theme.GetCaptionFontSize());
+	SetCaptionOn(CAPTION_RIGHT, false, CGetSetOptions::m_Theme.GetCaptionSize(), CGetSetOptions::m_Theme.GetCaptionFontSize());
 	CGetSetOptions::SetCaptionPos(CAPTION_RIGHT);
 }
 
 void CQPasteWnd::OnViewcaptionbaronBottom()
 {
-	SetCaptionOn(CAPTION_BOTTOM, false, g_Opt.m_Theme.GetCaptionSize(), g_Opt.m_Theme.GetCaptionFontSize());
+	SetCaptionOn(CAPTION_BOTTOM, false, CGetSetOptions::m_Theme.GetCaptionSize(), CGetSetOptions::m_Theme.GetCaptionFontSize());
 	CGetSetOptions::SetCaptionPos(CAPTION_BOTTOM);
 }
 
 void CQPasteWnd::OnViewcaptionbaronLeft()
 {
-	SetCaptionOn(CAPTION_LEFT, false, g_Opt.m_Theme.GetCaptionSize(), g_Opt.m_Theme.GetCaptionFontSize());
+	SetCaptionOn(CAPTION_LEFT, false, CGetSetOptions::m_Theme.GetCaptionSize(), CGetSetOptions::m_Theme.GetCaptionFontSize());
 	CGetSetOptions::SetCaptionPos(CAPTION_LEFT);
 }
 
 void CQPasteWnd::OnViewcaptionbaronTop()
 {
-	SetCaptionOn(CAPTION_TOP, false, g_Opt.m_Theme.GetCaptionSize(), g_Opt.m_Theme.GetCaptionFontSize());
+	SetCaptionOn(CAPTION_TOP, false, CGetSetOptions::m_Theme.GetCaptionSize(), CGetSetOptions::m_Theme.GetCaptionFontSize());
 	CGetSetOptions::SetCaptionPos(CAPTION_TOP);
 }
 
@@ -2153,7 +2153,7 @@ void CQPasteWnd::OnMenuNewGroupSelection()
 
 void CQPasteWnd::OnMenuQuickoptionsAllwaysshowdescription()
 {
-	CGetSetOptions::SetAllwaysShowDescription(!g_Opt.m_bAllwaysShowDescription);
+	CGetSetOptions::SetAllwaysShowDescription(!CGetSetOptions::m_bAllwaysShowDescription);
 
 }
 
@@ -2176,7 +2176,7 @@ void CQPasteWnd::OnMenuQuickoptionsDoubleclickingoncaptionTogglesshowdescription
 
 void CQPasteWnd::OnMenuQuickoptionsPromptfornewgroupnames()
 {
-	g_Opt.SetPrompForNewGroupName(!g_Opt.m_bPrompForNewGroupName);
+	CGetSetOptions::SetPrompForNewGroupName(!CGetSetOptions::m_bPrompForNewGroupName);
 }
 
 void CQPasteWnd::OnMenuViewgroups()
@@ -2565,34 +2565,34 @@ void CQPasteWnd::OnMenuQuickoptionsFont()
 
 void CQPasteWnd::OnMenuQuickoptionsShowthumbnails()
 {
-	CGetSetOptions::SetDrawThumbnail(!g_Opt.m_bDrawThumbnail);
+	CGetSetOptions::SetDrawThumbnail(!CGetSetOptions::m_bDrawThumbnail);
 	m_lstHeader.RefreshVisibleRows();
 }
 
 void CQPasteWnd::OnMenuQuickoptionsDrawrtftext()
 {
-	CGetSetOptions::SetDrawRTF(!g_Opt.m_bDrawRTF);
+	CGetSetOptions::SetDrawRTF(!CGetSetOptions::m_bDrawRTF);
 	m_lstHeader.RefreshVisibleRows();
 }
 
 void CQPasteWnd::OnMenuQuickoptionsPasteclipafterselection()
 {
-	CGetSetOptions::SetSendPasteAfterSelection(!g_Opt.m_bSendPasteMessageAfterSelection);
+	CGetSetOptions::SetSendPasteAfterSelection(!CGetSetOptions::m_bSendPasteMessageAfterSelection);
 }
 
 void CQPasteWnd::OnMenuQuickoptionsFindasyoutype()
 {
-	CGetSetOptions::SetFindAsYouType(!g_Opt.m_bFindAsYouType);
+	CGetSetOptions::SetFindAsYouType(!CGetSetOptions::m_bFindAsYouType);
 }
 
 void CQPasteWnd::OnMenuQuickoptionsEnsureentirewindowisvisible()
 {
-	CGetSetOptions::SetEnsureEntireWindowCanBeSeen(!g_Opt.m_bEnsureEntireWindowCanBeSeen);
+	CGetSetOptions::SetEnsureEntireWindowCanBeSeen(!CGetSetOptions::m_bEnsureEntireWindowCanBeSeen);
 }
 
 void CQPasteWnd::OnMenuQuickoptionsShowclipsthatareingroupsinmainlist()
 {
-	CGetSetOptions::SetShowAllClipsInMainList(!g_Opt.m_bShowAllClipsInMainList);
+	CGetSetOptions::SetShowAllClipsInMainList(!CGetSetOptions::m_bShowAllClipsInMainList);
 
 	CString csText;
 	m_search.GetWindowText(csText);
@@ -2617,7 +2617,7 @@ void CQPasteWnd::OnMenuNewclip()
 
 BOOL CQPasteWnd::SendToFriendbyPos(int nPos, CString override_IP_Host)
 {
-	if (g_Opt.GetAllowFriends() == false)
+	if (CGetSetOptions::GetAllowFriends() == false)
 	{
 		return FALSE;
 	}
@@ -2650,7 +2650,7 @@ BOOL CQPasteWnd::SendToFriendbyPos(int nPos, CString override_IP_Host)
 		Info.m_csIP = override_IP_Host;
 		if (Info.m_csIP == _T(""))
 		{
-			Info.m_csIP = g_Opt.m_SendClients[nPos].csIP;
+			Info.m_csIP = CGetSetOptions::m_SendClients[nPos].csIP;
 		}
 
 		if (Info.m_csIP != _T(""))
@@ -2702,7 +2702,7 @@ LRESULT CQPasteWnd::OnDelete(WPARAM wParam, LPARAM lParam)
 
 void CQPasteWnd::DeleteSelectedRows()
 {
-	if (g_Opt.GetPromptWhenDeletingClips())
+	if (CGetSetOptions::GetPromptWhenDeletingClips())
 	{
 		bool bStartValue = m_bHideWnd;
 		m_bHideWnd = false;
@@ -2872,12 +2872,12 @@ void CQPasteWnd::MoveSelection(bool down, bool requireModifersActive)
 
 void CQPasteWnd::OnKeyStateUp()
 {
-	if (g_Opt.m_moveSelectionOnOpenHotkey)
+	if (CGetSetOptions::m_moveSelectionOnOpenHotkey)
 	{
 		if (m_bModifersMoveActive)
 		{
 			Log(_T("OnKeyStateUp"));
-			SetTimer(TIMER_PASTE_FROM_MODIFER, g_Opt.GetKeyStatePasteDelay(), NULL);
+			SetTimer(TIMER_PASTE_FROM_MODIFER, CGetSetOptions::GetKeyStatePasteDelay(), NULL);
 		}
 		else
 		{
@@ -2888,7 +2888,7 @@ void CQPasteWnd::OnKeyStateUp()
 
 void CQPasteWnd::SetKeyModiferState(bool bActive)
 {
-	if (g_Opt.m_moveSelectionOnOpenHotkey)
+	if (CGetSetOptions::m_moveSelectionOnOpenHotkey)
 	{
 		Log(StrF(_T("SetKeyModiferState %d"), bActive));
 		m_bModifersMoveActive = bActive;
@@ -2913,7 +2913,7 @@ BOOL CQPasteWnd::PreTranslateMessage(MSG *pMsg)
 	case WM_NCMOUSEMOVE:
 	case WM_MOUSEMOVE:
 	{
-		if (g_Opt.m_bShowPersistent)
+		if (CGetSetOptions::m_bShowPersistent)
 		{
 			bool hasFocus = ::GetForegroundWindow() == m_hWnd;
 			if (hasFocus == false)
@@ -3394,7 +3394,7 @@ bool CQPasteWnd::DoSetDragFileName()
 	if (nRet == IDOK)
 	{
 		CString csName = Name.m_csName;
-		g_Opt.SetTempDragFileName(csName);
+		CGetSetOptions::SetTempDragFileName(csName);
 	}
 
 	m_bHideWnd = true;
@@ -3505,7 +3505,7 @@ bool CQPasteWnd::DoActionNextDescription()
 	if (m_lstHeader.IsToolTipWindowVisible() == FALSE)
 		return false;
 
-	if (g_Opt.m_bAllwaysShowDescription)
+	if (CGetSetOptions::m_bAllwaysShowDescription)
 		return false;
 
 	m_actions.m_handleRepeatKeys = true;
@@ -3552,7 +3552,7 @@ bool CQPasteWnd::DoActionPrevDescription()
 	if (m_lstHeader.IsToolTipWindowVisible() == FALSE)
 		return false;
 
-	if (g_Opt.m_bAllwaysShowDescription)
+	if (CGetSetOptions::m_bAllwaysShowDescription)
 		return false;
 
 	m_actions.m_handleRepeatKeys = true;
@@ -3690,7 +3690,7 @@ bool CQPasteWnd::DoActionCloseWindow()
 		}
 		else
 		{
-			if (g_Opt.GetShowPersistent() && this->GetMinimized() == false)
+			if (CGetSetOptions::GetShowPersistent() && this->GetMinimized() == false)
 			{
 				MinMaxWindow(FORCE_MIN);
 				theApp.m_activeWnd.ReleaseFocus();
@@ -3893,8 +3893,8 @@ bool CQPasteWnd::DoActionToggleShowPersistant()
 	}
 	else
 	{
-		theApp.ShowPersistent(!g_Opt.m_bShowPersistent);
-		if (g_Opt.m_bShowPersistent)
+		theApp.ShowPersistent(!CGetSetOptions::m_bShowPersistent);
+		if (CGetSetOptions::m_bShowPersistent)
 		{
 			::SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
 		}
@@ -4072,14 +4072,14 @@ bool CQPasteWnd::DoActionMoveClipToGroup()
 
 bool CQPasteWnd::DoActionElevatePrivleges()
 {
-	g_Opt.SetPasteAsAdmin(!g_Opt.GetPasteAsAdmin());
+	CGetSetOptions::SetPasteAsAdmin(!CGetSetOptions::GetPasteAsAdmin());
 
 	return true;
 }
 
 bool CQPasteWnd::DoShowInTaskBar()
 {
-	g_Opt.SetShowInTaskBar(!g_Opt.GetShowInTaskBar());
+	CGetSetOptions::SetShowInTaskBar(!CGetSetOptions::GetShowInTaskBar());
 
 	theApp.RefreshShowInTaskBar();
 
@@ -4093,11 +4093,11 @@ bool CQPasteWnd::DoClipCompare()
 
 	if (IDs.GetCount() > 1)
 	{
-		if (!g_Opt.m_bShowPersistent)
+		if (!CGetSetOptions::m_bShowPersistent)
 		{
 			HideQPasteWindow(false, false);
 		}
-		else if (g_Opt.GetAutoHide())
+		else if (CGetSetOptions::GetAutoHide())
 		{
 			MinMaxWindow(FORCE_MIN);
 		}
@@ -4145,11 +4145,11 @@ bool CQPasteWnd::DoSelectRightSideAndDoCompare()
 		{
 			int rightId = IDs[0];
 
-			if (!g_Opt.m_bShowPersistent)
+			if (!CGetSetOptions::m_bShowPersistent)
 			{
 				HideQPasteWindow(false, false);
 			}
-			else if (g_Opt.GetAutoHide())
+			else if (CGetSetOptions::GetAutoHide())
 			{
 				MinMaxWindow(FORCE_MIN);
 			}
@@ -4294,13 +4294,13 @@ bool CQPasteWnd::DoExportToQRCode()
 				CString qrCodeUrl = CGetSetOptions::GetQRCodeUrl();
 				CString url = StrF(_T("%s%s"), qrCodeUrl, clipTextUrlEncoded);
 
-				Log(StrF(_T("Opening qr code url: %s")), url);
+				Log(StrF(_T("Opening qr code url: %s"), url));
 
-				if (!g_Opt.m_bShowPersistent)
+				if (!CGetSetOptions::m_bShowPersistent)
 				{
 					HideQPasteWindow(false, false);
 				}
-				else if (g_Opt.GetAutoHide())
+				else if (CGetSetOptions::GetAutoHide())
 				{
 					MinMaxWindow(FORCE_MIN);
 				}
@@ -4345,11 +4345,11 @@ bool CQPasteWnd::DoExportToGoogleTranslate()
 					CString url;
 					url.Format(CGetSetOptions::GetTranslateUrl(), clipTextUrlEncoded);
 
-					if (!g_Opt.m_bShowPersistent)
+					if (!CGetSetOptions::m_bShowPersistent)
 					{
 						HideQPasteWindow(false, false);
 					}
-					else if (g_Opt.GetAutoHide())
+					else if (CGetSetOptions::GetAutoHide())
 					{
 						MinMaxWindow(FORCE_MIN);
 					}
@@ -5273,8 +5273,8 @@ LRESULT CQPasteWnd::OnPostOptions(WPARAM wParam, LPARAM lParam)
 
 	SetCurrentTransparency();
 
-	if (g_Opt.m_tooltipTimeout > 0 ||
-		g_Opt.m_tooltipTimeout == -1)
+	if (CGetSetOptions::m_tooltipTimeout > 0 ||
+		CGetSetOptions::m_tooltipTimeout == -1)
 	{
 		m_lstHeader.EnableToolTips();
 	}
@@ -5303,7 +5303,7 @@ void CQPasteWnd::OnBegindrag(NMHDR *pNMHDR, LRESULT *pResult)
 	}
 	else
 	{
-		paste.m_pasteOptions.m_placeCF_HDROP_OnDrag = g_Opt.GetAddCFHDROP_OnDrag();
+		paste.m_pasteOptions.m_placeCF_HDROP_OnDrag = CGetSetOptions::GetAddCFHDROP_OnDrag();
 	}
 
 	CClipIDs &clips = paste.GetClipIDs();
@@ -5323,7 +5323,7 @@ void CQPasteWnd::OnBegindrag(NMHDR *pNMHDR, LRESULT *pResult)
 	KillTimer(TIMER_DRAG_HIDE_WINDOW);
 
 
-	if (g_Opt.m_bShowPersistent)
+	if (CGetSetOptions::m_bShowPersistent)
 	{
 		ShowQPasteWindow(0);
 	}
@@ -5424,7 +5424,7 @@ void CQPasteWnd::GetDispInfo(NMHDR *pNMHDR, LRESULT *pResult)
 					}
 
 					// pipe is the "end of symbols" marker
-					cs += "|" + CMainTableFunctions::GetDisplayText(g_Opt.m_nLinesPerRow, m_listItems[pItem->iItem].m_Desc);
+					cs += "|" + CMainTableFunctions::GetDisplayText(CGetSetOptions::m_nLinesPerRow, m_listItems[pItem->iItem].m_Desc);
 
 					lstrcpyn(pItem->pszText, cs, pItem->cchTextMax);
 					pItem->pszText[pItem->cchTextMax - 1] = '\0';
@@ -5480,7 +5480,7 @@ void CQPasteWnd::GetDispInfo(NMHDR *pNMHDR, LRESULT *pResult)
 		}
 	}
 
-	if (pItem->mask & LVIF_CF_DIB && g_Opt.m_bDrawThumbnail)
+	if (pItem->mask & LVIF_CF_DIB && CGetSetOptions::m_bDrawThumbnail)
 	{
 		ATL::CCritSecLock csLock(m_CritSection.m_sect);
 
@@ -5526,7 +5526,7 @@ void CQPasteWnd::GetDispInfo(NMHDR *pNMHDR, LRESULT *pResult)
 		}
 	}
 
-	if (pItem->mask & LVIF_CF_RICHTEXT && g_Opt.m_bDrawRTF)
+	if (pItem->mask & LVIF_CF_RICHTEXT && CGetSetOptions::m_bDrawRTF)
 	{
 		ATL::CCritSecLock csLock(m_CritSection.m_sect);
 
@@ -5598,7 +5598,7 @@ CString CQPasteWnd::GetDisplayText(int dontAutoDelete, int shortCut, bool isGrou
 	}
 
 	// pipe is the "end of symbols" marker
-	cs += "|" + CMainTableFunctions::GetDisplayText(g_Opt.m_nLinesPerRow, text);
+	cs += "|" + CMainTableFunctions::GetDisplayText(CGetSetOptions::m_nLinesPerRow, text);
 
 	return cs;
 }
@@ -5753,12 +5753,12 @@ void CQPasteWnd::OnNcLButtonDblClk(UINT nHitTest, CPoint point)
 	// toggle ShowPersistent when we double click the caption
 	if (nHitTest == HTCAPTION)
 	{
-		switch (g_Opt.m_bDoubleClickingOnCaptionDoes)
+		switch (CGetSetOptions::m_bDoubleClickingOnCaptionDoes)
 		{
 		case TOGGLES_ALLWAYS_ON_TOP:
 		{
-			theApp.ShowPersistent(!g_Opt.m_bShowPersistent);
-			if (g_Opt.m_bShowPersistent)
+			theApp.ShowPersistent(!CGetSetOptions::m_bShowPersistent);
+			if (CGetSetOptions::m_bShowPersistent)
 			{
 				::SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
 			}
@@ -5928,7 +5928,7 @@ void CQPasteWnd::OnMenuSearchQuickPaste()
 void CQPasteWnd::OnSearchEditChange()
 {
 	m_search.Invalidate();
-	if (g_Opt.m_bFindAsYouType == FALSE)
+	if (CGetSetOptions::m_bFindAsYouType == FALSE)
 	{
 		return;
 	}
@@ -5965,7 +5965,7 @@ LRESULT CQPasteWnd::OnUpDown(WPARAM wParam, LPARAM lParam)
 
 LRESULT CQPasteWnd::OnToolTipWndInactive(WPARAM wParam, LPARAM lParam)
 {
-	if (!g_Opt.m_bShowPersistent)
+	if (!CGetSetOptions::m_bShowPersistent)
 	{
 		CWnd *p = GetFocus();
 		if (p == NULL)
@@ -6165,7 +6165,7 @@ void CQPasteWnd::SelectFocusID()
 	if (selectedItem == false)
 	{
 		m_lstHeader.EnsureVisible(0, FALSE);
-		m_lstHeader.SetListPos(g_Opt.SelectedIndex());
+		m_lstHeader.SetListPos(CGetSetOptions::SelectedIndex());
 	}
 }
 
@@ -6381,7 +6381,7 @@ BOOL CQPasteWnd::OnEraseBkgnd(CDC* pDC)
 {
 	CRect rect;
 	GetClientRect(&rect);
-	CBrush myBrush(g_Opt.m_Theme.MainWindowBG());    // dialog background color
+	CBrush myBrush(CGetSetOptions::m_Theme.MainWindowBG());    // dialog background color
 	CBrush *pOld = pDC->SelectObject(&myBrush);
 	BOOL bRes = pDC->PatBlt(0, 0, rect.Width(), rect.Height(), PATCOPY);
 	pDC->SelectObject(pOld);    // restore old brush
@@ -6468,7 +6468,7 @@ LRESULT CQPasteWnd::OnNewGroup(WPARAM wParam, LPARAM lParam)
 
 LRESULT CQPasteWnd::OnDeleteId(WPARAM wParam, LPARAM lParam)
 {
-	if (g_Opt.GetPromptWhenDeletingClips())
+	if (CGetSetOptions::GetPromptWhenDeletingClips())
 	{
 		bool bStartValue = m_bHideWnd;
 		m_bHideWnd = false;
@@ -7088,7 +7088,7 @@ LRESULT CQPasteWnd::OnDpiChanged(WPARAM wParam, LPARAM lParam)
 
 	//RECT* const prcNewWindow = (RECT*)lParam;
 	CRect r(*(RECT*)lParam);
-	if (g_Opt.m_bEnsureEntireWindowCanBeSeen)
+	if (CGetSetOptions::m_bEnsureEntireWindowCanBeSeen)
 	{
 		EnsureWindowVisible(&r);
 	}
@@ -7192,9 +7192,9 @@ void CQPasteWnd::OnChaiScriptPaste(UINT idIn)
 	int index = idIn - ChaiScriptMenuStartId;
 
 	if (index >= 0 &&
-		index < g_Opt.m_pasteScripts.m_list.size())
+		index < CGetSetOptions::m_pasteScripts.m_list.size())
 	{
-		pasteOptions.m_pasteScriptGuid = g_Opt.m_pasteScripts.m_list[index].m_guid;
+		pasteOptions.m_pasteScriptGuid = CGetSetOptions::m_pasteScripts.m_list[index].m_guid;
 		OpenSelection(pasteOptions);
 	}
 }
@@ -7423,11 +7423,11 @@ bool CQPasteWnd::DoActionEmailTo()
 
 	if (IDs.GetCount() > 1)
 	{
-		CStringA SepA = CTextConvert::UnicodeToAnsi(g_Opt.GetMultiPasteSeparator());
-		CStringW SepW = g_Opt.GetMultiPasteSeparator();
+		CStringA SepA = CTextConvert::UnicodeToAnsi(CGetSetOptions::GetMultiPasteSeparator());
+		CStringW SepW = CGetSetOptions::GetMultiPasteSeparator();
 
 		CHTMLFormatAggregator Html(SepA);
-		if (IDs.AggregateData(Html, theApp.m_HTML_Format, g_Opt.m_bMultiPasteReverse, false))
+		if (IDs.AggregateData(Html, theApp.m_HTML_Format, CGetSetOptions::m_bMultiPasteReverse, false))
 		{
 			CClipFormat cf(theApp.m_HTML_Format, Html.GetHGlobal());
 			clip.m_Formats.Add(cf);
@@ -7436,7 +7436,7 @@ bool CQPasteWnd::DoActionEmailTo()
 		}
 
 		CCF_UnicodeTextAggregator CFUnicodeText(SepW);
-		if (IDs.AggregateData(CFUnicodeText, CF_UNICODETEXT, g_Opt.m_bMultiPasteReverse, false))
+		if (IDs.AggregateData(CFUnicodeText, CF_UNICODETEXT, CGetSetOptions::m_bMultiPasteReverse, false))
 		{
 			CClipFormat cf(CF_UNICODETEXT, CFUnicodeText.GetHGlobal());
 			clip.m_Formats.Add(cf);
@@ -7447,7 +7447,7 @@ bool CQPasteWnd::DoActionEmailTo()
 		{
 
 			CCF_TextAggregator CFText(SepA);
-			if (IDs.AggregateData(CFText, CF_TEXT, g_Opt.m_bMultiPasteReverse, false))
+			if (IDs.AggregateData(CFText, CF_TEXT, CGetSetOptions::m_bMultiPasteReverse, false))
 			{
 				CClipFormat cf(CF_TEXT, CFText.GetHGlobal());
 				clip.m_Formats.Add(cf);
@@ -7556,9 +7556,9 @@ bool CQPasteWnd::DoActionGmail()
 
 	if (IDs.GetCount() > 1)
 	{
-		CStringW SepW = g_Opt.GetMultiPasteSeparator();
+		CStringW SepW = CGetSetOptions::GetMultiPasteSeparator();
 		CCF_UnicodeTextAggregator CFUnicodeText(SepW);
-		if (IDs.AggregateData(CFUnicodeText, CF_UNICODETEXT, g_Opt.m_bMultiPasteReverse, false))
+		if (IDs.AggregateData(CFUnicodeText, CF_UNICODETEXT, CGetSetOptions::m_bMultiPasteReverse, false))
 		{
 			CClipFormat cf(CF_UNICODETEXT, CFUnicodeText.GetHGlobal());
 			clip.m_Formats.Add(cf);
@@ -7567,9 +7567,9 @@ bool CQPasteWnd::DoActionGmail()
 		}
 		else
 		{
-			CStringA SepA = CTextConvert::UnicodeToAnsi(g_Opt.GetMultiPasteSeparator());
+			CStringA SepA = CTextConvert::UnicodeToAnsi(CGetSetOptions::GetMultiPasteSeparator());
 			CCF_TextAggregator CFText(SepA);
-			if (IDs.AggregateData(CFText, CF_TEXT, g_Opt.m_bMultiPasteReverse, false))
+			if (IDs.AggregateData(CFText, CF_TEXT, CGetSetOptions::m_bMultiPasteReverse, false))
 			{
 				CClipFormat cf(CF_TEXT, CFText.GetHGlobal());
 				clip.m_Formats.Add(cf);
@@ -7777,12 +7777,12 @@ bool CQPasteWnd::DoCopySelection()
 		paste.GetClipIDs().Add(IDs[0]);
 
 	//Don't move these to the top
-	BOOL itWas = g_Opt.m_bUpdateTimeOnPaste;
-	g_Opt.m_bUpdateTimeOnPaste = CGetSetOptions::GetUpdateClipOrderOnCtrlC();
+	BOOL itWas = CGetSetOptions::m_bUpdateTimeOnPaste;
+	CGetSetOptions::m_bUpdateTimeOnPaste = CGetSetOptions::GetUpdateClipOrderOnCtrlC();
 
 	paste.DoPaste();
 
-	g_Opt.m_bUpdateTimeOnPaste = itWas;
+	CGetSetOptions::m_bUpdateTimeOnPaste = itWas;
 
 	return TRUE;
 }

+ 3 - 3
QRCodeViewer.cpp

@@ -60,14 +60,14 @@ BOOL QRCodeViewer::CreateEx(CWnd *pParentWnd, unsigned char* bitmapData, int ima
 
 	if(CWnd::CreateEx(0, szClassName, _T(""), WS_POPUP, 0, 0, 0, 0, NULL, 0, NULL))
 	{	
-		BOOL r = m_desc.Create(CMainTableFunctions::GetDisplayText(g_Opt.m_nLinesPerRow, desc), WS_CHILD|WS_VISIBLE, CRect(0,0,0,0), this, 2);
+		BOOL r = m_desc.Create(CMainTableFunctions::GetDisplayText(CGetSetOptions::m_nLinesPerRow, desc), WS_CHILD|WS_VISIBLE, CRect(0,0,0,0), this, 2);
 
 		m_font.CreateFontIndirect(&logFont);
 		m_desc.SetFont(&m_font);	
 
 		m_DittoWindow.DoCreate(this);
-		m_DittoWindow.SetCaptionColors(g_Opt.m_Theme.CaptionLeft(), g_Opt.m_Theme.CaptionRight(), g_Opt.m_Theme.Border());
-		m_DittoWindow.SetCaptionOn(this, CGetSetOptions::GetCaptionPos(), true, g_Opt.m_Theme.GetCaptionSize(), g_Opt.m_Theme.GetCaptionFontSize());
+		m_DittoWindow.SetCaptionColors(CGetSetOptions::m_Theme.CaptionLeft(), CGetSetOptions::m_Theme.CaptionRight(), CGetSetOptions::m_Theme.Border());
+		m_DittoWindow.SetCaptionOn(this, CGetSetOptions::GetCaptionPos(), true, CGetSetOptions::m_Theme.GetCaptionSize(), CGetSetOptions::m_Theme.GetCaptionFontSize());
 		m_DittoWindow.m_bDrawMinimize = false;
 		m_DittoWindow.m_bDrawMaximize = true;
 		m_DittoWindow.m_bDrawChevron = false;

+ 7 - 7
QuickPaste.cpp

@@ -98,7 +98,7 @@ void CQuickPaste::ShowQPasteWnd(CWnd *pParent, bool bAtPrevPos, bool bFromKeyboa
 		return;
 	}
 
-	if(g_Opt.m_bShowPersistent && m_pwndPaste != NULL)
+	if(CGetSetOptions::m_bShowPersistent && m_pwndPaste != NULL)
 	{
 		m_pwndPaste->ShowWindow(SW_SHOW);
 		m_pwndPaste->MinMaxWindow(FORCE_MAX);
@@ -203,7 +203,7 @@ void CQuickPaste::ShowQPasteWnd(CWnd *pParent, bool bAtPrevPos, bool bFromKeyboa
 
 	bool forceMoveWindow = m_forceResizeOnNextShow;
 
-	if(g_Opt.m_bEnsureEntireWindowCanBeSeen)
+	if(CGetSetOptions::m_bEnsureEntireWindowCanBeSeen)
 	{
 		if(EnsureWindowVisible(&crRect))
 		{
@@ -252,7 +252,7 @@ void CQuickPaste::ShowQPasteWnd(CWnd *pParent, bool bAtPrevPos, bool bFromKeyboa
 				crRect.right = crRect.left + m_pwndPaste->m_DittoWindow.m_dpi.Scale(crRect.Width());
 				crRect.bottom = crRect.top + m_pwndPaste->m_DittoWindow.m_dpi.Scale(crRect.Height());
 
-				if (g_Opt.m_bEnsureEntireWindowCanBeSeen)
+				if (CGetSetOptions::m_bEnsureEntireWindowCanBeSeen)
 				{
 					EnsureWindowVisible(&crRect);
 				}
@@ -273,7 +273,7 @@ void CQuickPaste::ShowQPasteWnd(CWnd *pParent, bool bAtPrevPos, bool bFromKeyboa
 				crRect.right = crRect.left + m_pwndPaste->m_DittoWindow.m_dpi.Scale(crRect.Width());
 				crRect.bottom = crRect.top + m_pwndPaste->m_DittoWindow.m_dpi.Scale(crRect.Height());
 
-				if (g_Opt.m_bEnsureEntireWindowCanBeSeen)
+				if (CGetSetOptions::m_bEnsureEntireWindowCanBeSeen)
 				{
 					EnsureWindowVisible(&crRect);
 				}
@@ -301,7 +301,7 @@ void CQuickPaste::ShowQPasteWnd(CWnd *pParent, bool bAtPrevPos, bool bFromKeyboa
 
 void CQuickPaste::MoveSelection(bool down)
 {
-	if(m_pwndPaste && g_Opt.m_moveSelectionOnOpenHotkey)
+	if(m_pwndPaste && CGetSetOptions::m_moveSelectionOnOpenHotkey)
 	{
 		if (IsWindow(m_pwndPaste->m_hWnd))
 		{
@@ -312,7 +312,7 @@ void CQuickPaste::MoveSelection(bool down)
 
 void CQuickPaste::OnKeyStateUp()
 {
-	if(m_pwndPaste && g_Opt.m_moveSelectionOnOpenHotkey)
+	if(m_pwndPaste && CGetSetOptions::m_moveSelectionOnOpenHotkey)
 	{
 		if (IsWindow(m_pwndPaste->m_hWnd))
 		{
@@ -323,7 +323,7 @@ void CQuickPaste::OnKeyStateUp()
 
 void CQuickPaste::SetKeyModiferState(bool bActive)
 {
-	if(m_pwndPaste && g_Opt.m_moveSelectionOnOpenHotkey)
+	if(m_pwndPaste && CGetSetOptions::m_moveSelectionOnOpenHotkey)
 	{
 		if (IsWindow(m_pwndPaste->m_hWnd))
 		{

+ 7 - 7
QuickPasteKeyboard.cpp

@@ -150,8 +150,8 @@ void CQuickPasteKeyboard::LoadItems()
 			KeyboardArray ar;
 			for (int x = 0; x < 10; x++)
 			{
-				ar.Array[x].A = g_Opt.GetActionShortCutA(action, x);
-				ar.Array[x].B = g_Opt.GetActionShortCutB(action, x);
+				ar.Array[x].A = CGetSetOptions::GetActionShortCutA(action, x);
+				ar.Array[x].B = CGetSetOptions::GetActionShortCutB(action, x);
 			}
 
 			CString shortCutText = GetShortCutText(ar);
@@ -172,7 +172,7 @@ void CQuickPasteKeyboard::LoadItems()
 
 	int dummyId = -1;
 
-	for (auto & element : g_Opt.m_pasteScripts.m_list)
+	for (auto & element : CGetSetOptions::m_pasteScripts.m_list)
 	{
 		// Insert the first item
 		lvi.mask = LVIF_TEXT;
@@ -182,8 +182,8 @@ void CQuickPasteKeyboard::LoadItems()
 		ar.m_refData = element.m_guid;
 		for (int x = 0; x < 10; x++)
 		{
-			ar.Array[x].A = g_Opt.GetActionShortCutA(ActionEnums::PASTE_SCRIPT, x, element.m_guid);
-			ar.Array[x].B = g_Opt.GetActionShortCutB(ActionEnums::PASTE_SCRIPT, x, element.m_guid);
+			ar.Array[x].A = CGetSetOptions::GetActionShortCutA(ActionEnums::PASTE_SCRIPT, x, element.m_guid);
+			ar.Array[x].B = CGetSetOptions::GetActionShortCutB(ActionEnums::PASTE_SCRIPT, x, element.m_guid);
 		}
 
 		CString shortCutText = GetShortCutText(ar);
@@ -412,8 +412,8 @@ BOOL CQuickPasteKeyboard::OnApply()
 					actionEnum = ActionEnums::PASTE_SCRIPT;
 				}
 
-				g_Opt.SetActionShortCutA(actionEnum, it->second.Array[i].A, i, it->second.m_refData);
-				g_Opt.SetActionShortCutB(actionEnum, it->second.Array[i].B, i, it->second.m_refData);
+				CGetSetOptions::SetActionShortCutA(actionEnum, it->second.Array[i].A, i, it->second.m_refData);
+				CGetSetOptions::SetActionShortCutB(actionEnum, it->second.Array[i].B, i, it->second.m_refData);
 				it->second.Array[i].Dirty = false;
 			}
 		}

+ 5 - 5
RecieveSocket.cpp

@@ -26,7 +26,7 @@ CRecieveSocket::~CRecieveSocket()
 
 void CRecieveSocket::FreeDecryptedData()
 { 
-	if(g_Opt.m_csPassword == "")
+	if(CGetSetOptions::m_csPassword == "")
 	{
 		delete [] m_pDataReturnedFromDecrypt;
 	}
@@ -59,7 +59,7 @@ LPVOID CRecieveSocket::ReceiveEncryptedData(long lInSize, long &lOutSize)
 		if(RecieveExactSize(pInput, lInSize))
 		{
 			CStringA csPassword;
-			INT_PTR count = g_Opt.m_csNetworkPasswordArray.GetSize();
+			INT_PTR count = CGetSetOptions::m_csNetworkPasswordArray.GetSize();
 			INT_PTR nIndex;
 			for(int i = -2; i < count; i++)
 			{
@@ -76,13 +76,13 @@ LPVOID CRecieveSocket::ReceiveEncryptedData(long lInSize, long &lOutSize)
 
 				if(nIndex == -1)
 				{
-					csPassword = g_Opt.m_csPassword;
+					csPassword = CGetSetOptions::m_csPassword;
 				}
 				else
 				{
 					if(nIndex >= 0 && nIndex < count)
 					{
-						csPassword = CTextConvert::UnicodeToUTF8(g_Opt.m_csNetworkPasswordArray[nIndex]);
+						csPassword = CTextConvert::UnicodeToUTF8(CGetSetOptions::m_csNetworkPasswordArray[nIndex]);
 					}
 					else
 					{
@@ -92,7 +92,7 @@ LPVOID CRecieveSocket::ReceiveEncryptedData(long lInSize, long &lOutSize)
 
 				if(m_pEncryptor->Decrypt((UCHAR*)pInput, lInSize, csPassword, pOutput, nOut) == FALSE)
 				{
-					LogSendRecieveInfo(StrF(_T("ReceiveEncryptedData:: Failed to Decrypt data password = %s"), g_Opt.m_csPassword));
+					LogSendRecieveInfo(StrF(_T("ReceiveEncryptedData:: Failed to Decrypt data password = %s"), CGetSetOptions::m_csPassword));
 				}
 				else
 				{

+ 2 - 2
SearchEditBox.cpp

@@ -43,7 +43,7 @@ BOOL CSearchEditBox::PreTranslateMessage(MSG* pMsg)
 				CWnd *pWnd = GetParent();
 				if(pWnd)
 				{
-					if(g_Opt.m_bFindAsYouType)
+					if(CGetSetOptions::m_bFindAsYouType)
 					{
 						pWnd->SendMessage(NM_SEARCH_ENTER_PRESSED, 0, 0);
 					}
@@ -60,7 +60,7 @@ BOOL CSearchEditBox::PreTranslateMessage(MSG* pMsg)
 						pMsg->wParam == VK_UP ||
 						pMsg->wParam == VK_F3)
 			{
-				if(g_Opt.m_bFindAsYouType)
+				if(CGetSetOptions::m_bFindAsYouType)
 				{
 					CWnd *pWnd = GetParent();
 					if(pWnd)

+ 1 - 1
SendSocket.cpp

@@ -52,7 +52,7 @@ BOOL CSendSocket::SendExactSize(char *pData, long lLength, bool bEncrypt)
 	int nLenOutput = lLength;
 	long lBytesRead = 0;
 
-	if(bEncrypt == false || m_pEncryptor->Encrypt((UCHAR*)pData, lLength, g_Opt.m_csPassword, pOutput, nLenOutput))
+	if(bEncrypt == false || m_pEncryptor->Encrypt((UCHAR*)pData, lLength, CGetSetOptions::m_csPassword, pOutput, nLenOutput))
 	{
 		long lExpected = nLenOutput;
 

+ 3 - 3
Server.cpp

@@ -47,7 +47,7 @@ UINT  MTServerThread(LPVOID pParam)
 	{
 		local.sin_addr.s_addr = inet_addr(CTextConvert::UnicodeToAnsi(bindToIpAddress));
 	}
-	local.sin_port = htons((u_short)g_Opt.m_lPort);
+	local.sin_port = htons((u_short)CGetSetOptions::m_lPort);
 	theApp.m_sSocket = socket(AF_INET, SOCK_STREAM, 0);
 	if(theApp.m_sSocket == INVALID_SOCKET)
 	{
@@ -195,7 +195,7 @@ void CServer::RunThread(SocketParams *pParams)
 void CServer::OnStart(CSendInfo &info)
 {
 	if (m_recieveIP != _T("") &&
-		g_Opt.GetUseIPFromAccept())
+		CGetSetOptions::GetUseIPFromAccept())
 	{
 		LogSendRecieveInfo(StrF(_T("Using ip address from the Accept Call - %s"), m_recieveIP));
 		m_csIP = m_recieveIP;
@@ -228,7 +228,7 @@ void CServer::OnStart(CSendInfo &info)
 	
 	m_bSetToClipBoard = FALSE;
 
-	CTokenizer token(g_Opt.m_csIPListToPutOnClipboard, ",");
+	CTokenizer token(CGetSetOptions::m_csIPListToPutOnClipboard, ",");
 	CString line;
 
 	while(token.Next(line))

+ 17 - 17
SymbolEdit.cpp

@@ -126,7 +126,7 @@ BOOL CSymbolEdit::PreTranslateMessage(MSG* pMsg)
 			CWnd *pWnd = GetParent();
 			if (pWnd)
 			{
-				if (g_Opt.m_bFindAsYouType)
+				if (CGetSetOptions::m_bFindAsYouType)
 				{
 					pWnd->SendMessage(NM_SEARCH_ENTER_PRESSED, 0, 0);
 				}
@@ -507,9 +507,9 @@ void CSymbolEdit::OnPaint()
 
 	if(this == GetFocus() || text.GetLength() > 0)
 	{
-		dc.FillSolidRect(rect, g_Opt.m_Theme.SearchTextBoxFocusBG());
+		dc.FillSolidRect(rect, CGetSetOptions::m_Theme.SearchTextBoxFocusBG());
 
-		//CBrush borderBrush(g_Opt.m_Theme.SearchTextBoxFocusBorder());
+		//CBrush borderBrush(CGetSetOptions::m_Theme.SearchTextBoxFocusBorder());
 		//dc.FrameRect(rect, &borderBrush);
 
 		//rect.DeflateRect(1, 1, 1, 1);
@@ -518,7 +518,7 @@ void CSymbolEdit::OnPaint()
 		oldFont = dc.SelectObject(GetFont());		
 
 		COLORREF oldColor = dc.GetTextColor();
-		dc.SetTextColor(g_Opt.m_Theme.SearchTextBoxFocusText());
+		dc.SetTextColor(CGetSetOptions::m_Theme.SearchTextBoxFocusText());
 			
 		dc.DrawText(text, textRect, DT_SINGLELINE | DT_INTERNAL | DT_EDITCONTROL | DT_NOPREFIX);
 
@@ -527,7 +527,7 @@ void CSymbolEdit::OnPaint()
 	}
 	else
 	{
-		dc.FillSolidRect(rect, g_Opt.m_Theme.MainWindowBG());
+		dc.FillSolidRect(rect, CGetSetOptions::m_Theme.MainWindowBG());
 	}
 
 
@@ -609,14 +609,14 @@ HBRUSH CSymbolEdit::CtlColor(CDC* pDC, UINT n)
 
 	if (::GetFocus() == m_hWnd)
 	{
-		pDC->SetTextColor(g_Opt.m_Theme.SearchTextBoxFocusText());
-		pDC->SetBkColor(g_Opt.m_Theme.SearchTextBoxFocusBG());
-		color = g_Opt.m_Theme.SearchTextBoxFocusBG();
+		pDC->SetTextColor(CGetSetOptions::m_Theme.SearchTextBoxFocusText());
+		pDC->SetBkColor(CGetSetOptions::m_Theme.SearchTextBoxFocusBG());
+		color = CGetSetOptions::m_Theme.SearchTextBoxFocusBG();
 	}
 	else
 	{
-		pDC->SetBkColor(g_Opt.m_Theme.MainWindowBG());
-		color = g_Opt.m_Theme.MainWindowBG();
+		pDC->SetBkColor(CGetSetOptions::m_Theme.MainWindowBG());
+		color = CGetSetOptions::m_Theme.MainWindowBG();
 	}
 
 	if (color != m_lastBrushColor)
@@ -639,7 +639,7 @@ void CSymbolEdit::OnSetFocus(CWnd* pOldWnd)
 	CWnd *pWnd = GetParent();
 	if (pWnd)
 	{
-		if (g_Opt.m_bFindAsYouType)
+		if (CGetSetOptions::m_bFindAsYouType)
 		{
 			pWnd->SendMessage(NM_FOCUS_ON_SEARCH, 0, 0);
 		}
@@ -944,19 +944,19 @@ void CSymbolEdit::OnNcPaint()
 
 	CRect b(0, r.Height() - m_centerTextDiff- m_windowDpi->Scale(1), r.Width(), r.Height());
 
-	COLORREF c = g_Opt.m_Theme.MainWindowBG();
+	COLORREF c = CGetSetOptions::m_Theme.MainWindowBG();
 
 	if (this == GetFocus() || text.GetLength() > 0)
 	{		
-		dc.FillSolidRect(t, g_Opt.m_Theme.SearchTextBoxFocusBG());
-		dc.FillSolidRect(b, g_Opt.m_Theme.SearchTextBoxFocusBG());
+		dc.FillSolidRect(t, CGetSetOptions::m_Theme.SearchTextBoxFocusBG());
+		dc.FillSolidRect(b, CGetSetOptions::m_Theme.SearchTextBoxFocusBG());
 
-		c = g_Opt.m_Theme.SearchTextBoxFocusBorder();
+		c = CGetSetOptions::m_Theme.SearchTextBoxFocusBorder();
 	}
 	else
 	{
-		dc.FillSolidRect(t, g_Opt.m_Theme.MainWindowBG());
-		dc.FillSolidRect(b, g_Opt.m_Theme.MainWindowBG());
+		dc.FillSolidRect(t, CGetSetOptions::m_Theme.MainWindowBG());
+		dc.FillSolidRect(b, CGetSetOptions::m_Theme.MainWindowBG());
 	}	
 
 	//if ((text.GetLength() > 0 || this == GetFocus()) && m_windowDpi)

+ 10 - 10
ToolTipEx.cpp

@@ -106,8 +106,8 @@ BOOL CToolTipEx::Create(CWnd *pParentWnd)
 	
 	
 	m_DittoWindow.DoCreate(this);
-	m_DittoWindow.SetCaptionColors(g_Opt.m_Theme.CaptionLeft(), g_Opt.m_Theme.CaptionRight(), g_Opt.m_Theme.Border());
-	m_DittoWindow.SetCaptionOn(this, CGetSetOptions::GetCaptionPos(), true, g_Opt.m_Theme.GetCaptionSize(), g_Opt.m_Theme.GetCaptionFontSize());
+	m_DittoWindow.SetCaptionColors(CGetSetOptions::m_Theme.CaptionLeft(), CGetSetOptions::m_Theme.CaptionRight(), CGetSetOptions::m_Theme.Border());
+	m_DittoWindow.SetCaptionOn(this, CGetSetOptions::GetCaptionPos(), true, CGetSetOptions::m_Theme.GetCaptionSize(), CGetSetOptions::m_Theme.GetCaptionFontSize());
 	m_DittoWindow.m_bDrawMaximize = false;
 	m_DittoWindow.m_bDrawMinimize = false;
 	m_DittoWindow.m_bDrawChevron = true;
@@ -118,7 +118,7 @@ BOOL CToolTipEx::Create(CWnd *pParentWnd)
                       ES_AUTOHSCROLL, CRect(10, 10, 100, 200), this, 1);
 
     m_RichEdit.SetReadOnly();
-    m_RichEdit.SetBackgroundColor(FALSE, g_Opt.m_Theme.DescriptionWindowBG());
+    m_RichEdit.SetBackgroundColor(FALSE, CGetSetOptions::m_Theme.DescriptionWindowBG());
 
 	m_RichEdit.SetEventMask(m_RichEdit.GetEventMask() | ENM_SELCHANGE | ENM_LINK | ENM_MOUSEEVENTS | ENM_SCROLLEVENTS);
 	m_RichEdit.SetAutoURLDetect(TRUE);
@@ -139,11 +139,11 @@ BOOL CToolTipEx::Create(CWnd *pParentWnd)
 	m_fontHeight = -13;
 
 	m_clipDataStatic.SetFont(&m_clipDataFont);
-	m_clipDataStatic.SetBkColor(g_Opt.m_Theme.DescriptionWindowBG());
+	m_clipDataStatic.SetBkColor(CGetSetOptions::m_Theme.DescriptionWindowBG());
 	m_clipDataStatic.SetTextColor(RGB(80, 80, 80));
 
 	m_folderPathStatic.SetFont(&m_clipDataFont);
-	m_folderPathStatic.SetBkColor(g_Opt.m_Theme.DescriptionWindowBG());
+	m_folderPathStatic.SetBkColor(CGetSetOptions::m_Theme.DescriptionWindowBG());
 	m_folderPathStatic.SetTextColor(RGB(80, 80, 80));
 	
 	m_saveWindowLockout = false;
@@ -845,7 +845,7 @@ void CToolTipEx::SetHtmlText(const CString &html)
 			}
 		}
 
-		COLORREF c = g_Opt.m_Theme.DescriptionWindowBG();
+		COLORREF c = CGetSetOptions::m_Theme.DescriptionWindowBG();
 
 		DWORD dwR = GetRValue(c);
 		DWORD dwG = GetGValue(c);
@@ -892,7 +892,7 @@ void CToolTipEx::SetToolTipText(const CString &csText)
 	cfNew.dwMask = CFM_COLOR;
 	cfNew.dwEffects = CFM_COLOR;
 	cfNew.dwEffects &= ~CFE_AUTOCOLOR;
-	cfNew.crTextColor = g_Opt.m_Theme.DescriptionWindowText();
+	cfNew.crTextColor = CGetSetOptions::m_Theme.DescriptionWindowText();
 	m_RichEdit.SetDefaultCharFormat(cfNew);
 
 	HighlightSearchText();
@@ -1310,7 +1310,7 @@ void CToolTipEx::OnPaint()
 	GetClientRect(rect);
 	
 	CBrush  Brush, *pOldBrush;
-	Brush.CreateSolidBrush(g_Opt.m_Theme.DescriptionWindowBG());
+	Brush.CreateSolidBrush(CGetSetOptions::m_Theme.DescriptionWindowBG());
 
 	pOldBrush = dc.SelectObject(&Brush);
 
@@ -1488,11 +1488,11 @@ LRESULT CToolTipEx::OnDpiChanged(WPARAM wParam, LPARAM lParam)
 	m_clipDataFont.CreateFont(-m_DittoWindow.m_dpi.Scale(8), 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 3, 2, 1, 34, _T("Segoe UI"));
 	
 	m_clipDataStatic.SetFont(&m_clipDataFont);
-	m_clipDataStatic.SetBkColor(g_Opt.m_Theme.DescriptionWindowBG());
+	m_clipDataStatic.SetBkColor(CGetSetOptions::m_Theme.DescriptionWindowBG());
 	m_clipDataStatic.SetTextColor(RGB(80, 80, 80));
 
 	m_folderPathStatic.SetFont(&m_clipDataFont);
-	m_folderPathStatic.SetBkColor(g_Opt.m_Theme.DescriptionWindowBG());
+	m_folderPathStatic.SetBkColor(CGetSetOptions::m_Theme.DescriptionWindowBG());
 	m_folderPathStatic.SetTextColor(RGB(80, 80, 80));
 
 	LOGFONT lf;

+ 5 - 5
WndEx.cpp

@@ -109,7 +109,7 @@ int CWndEx::OnCreate(LPCREATESTRUCT lpCreateStruct)
 		SWP_NOZORDER | SWP_NOACTIVATE);
 
 	SetCaptionColorActive(false, TRUE);
-	m_DittoWindow.SetCaptionOn(this, CGetSetOptions::GetCaptionPos(), true, g_Opt.m_Theme.GetCaptionSize(), g_Opt.m_Theme.GetCaptionFontSize());
+	m_DittoWindow.SetCaptionOn(this, CGetSetOptions::GetCaptionPos(), true, CGetSetOptions::m_Theme.GetCaptionSize(), CGetSetOptions::m_Theme.GetCaptionFontSize());
 	SetAutoMaxDelay(CGetSetOptions::GetAutoMaxDelay());
 
 	m_toolTip.Create(this);
@@ -128,21 +128,21 @@ bool CWndEx::SetCaptionColorActive(BOOL bPersistant, BOOL ConnectedToClipboard)
 
 	if(ConnectedToClipboard == false)
 	{
-		bResult = m_DittoWindow.SetCaptionColors(g_Opt.m_Theme.CaptionLeftNotConnected(), g_Opt.m_Theme.CaptionRightNotConnected(), g_Opt.m_Theme.BorderNotConnected());
+		bResult = m_DittoWindow.SetCaptionColors(CGetSetOptions::m_Theme.CaptionLeftNotConnected(), CGetSetOptions::m_Theme.CaptionRightNotConnected(), CGetSetOptions::m_Theme.BorderNotConnected());
 	}
 	else
 	{
 		if(bPersistant)
 		{
-			bResult = m_DittoWindow.SetCaptionColors(g_Opt.m_Theme.CaptionLeftTopMost(), g_Opt.m_Theme.CaptionRightTopMost(), g_Opt.m_Theme.BorderTopMost());
+			bResult = m_DittoWindow.SetCaptionColors(CGetSetOptions::m_Theme.CaptionLeftTopMost(), CGetSetOptions::m_Theme.CaptionRightTopMost(), CGetSetOptions::m_Theme.BorderTopMost());
 		}
 		else
 		{
-			bResult = m_DittoWindow.SetCaptionColors(g_Opt.m_Theme.CaptionLeft(), g_Opt.m_Theme.CaptionRight(), g_Opt.m_Theme.Border());
+			bResult = m_DittoWindow.SetCaptionColors(CGetSetOptions::m_Theme.CaptionLeft(), CGetSetOptions::m_Theme.CaptionRight(), CGetSetOptions::m_Theme.Border());
 		}
 	}
 
-	m_DittoWindow.SetCaptionTextColor(g_Opt.m_Theme.CaptionTextColor());
+	m_DittoWindow.SetCaptionTextColor(CGetSetOptions::m_Theme.CaptionTextColor());
 
 	return bResult;
 }