diff options
author | George Hazan <ghazan@miranda.im> | 2018-11-12 21:44:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-11-12 21:44:56 +0300 |
commit | 53fe3e46177d17b4941610de19f5cc6210700cb4 (patch) | |
tree | b67a6bc208dad141f9db14035cd7e42ff2a51872 /plugins/SendScreenshotPlus | |
parent | 488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff) |
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/SendScreenshotPlus')
-rw-r--r-- | plugins/SendScreenshotPlus/src/UMainForm.cpp | 60 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/dlg_msgbox.cpp | 4 |
2 files changed, 32 insertions, 32 deletions
diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 9b7efd9d0c..2a56920e60 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -715,52 +715,52 @@ TfrmMain::~TfrmMain() void TfrmMain::LoadOptions(void) { - DWORD rgb = db_get_dw(NULL, MODULENAME, "AlphaColor", 16777215); + DWORD rgb = g_plugin.getDword("AlphaColor", 16777215); m_AlphaColor.rgbRed = GetRValue(rgb); m_AlphaColor.rgbGreen = GetGValue(rgb); m_AlphaColor.rgbBlue = GetBValue(rgb); m_AlphaColor.rgbReserved = 0; - m_opt_edtQuality = db_get_b(NULL, MODULENAME, "JpegQuality", 75); + m_opt_edtQuality = g_plugin.getByte("JpegQuality", 75); - m_opt_tabCapture = db_get_b(NULL, MODULENAME, "Capture", 0); - m_opt_chkIndirectCapture = db_get_b(NULL, MODULENAME, "IndirectCapture", 0); - m_opt_chkClientArea = db_get_b(NULL, MODULENAME, "ClientArea", 0); - m_opt_cboxDesktop = db_get_b(NULL, MODULENAME, "Desktop", 0); + m_opt_tabCapture = g_plugin.getByte("Capture", 0); + m_opt_chkIndirectCapture = g_plugin.getByte("IndirectCapture", 0); + m_opt_chkClientArea = g_plugin.getByte("ClientArea", 0); + m_opt_cboxDesktop = g_plugin.getByte("Desktop", 0); - m_opt_chkTimed = db_get_b(NULL, MODULENAME, "TimedCap", 0); - m_opt_edtTimed = db_get_b(NULL, MODULENAME, "CapTime", 3); - m_opt_cboxFormat = db_get_b(NULL, MODULENAME, "OutputFormat", 0); - m_opt_cboxSendBy = db_get_b(NULL, MODULENAME, "SendBy", 0); + m_opt_chkTimed = g_plugin.getByte("TimedCap", 0); + m_opt_edtTimed = g_plugin.getByte("CapTime", 3); + m_opt_cboxFormat = g_plugin.getByte("OutputFormat", 0); + m_opt_cboxSendBy = g_plugin.getByte("SendBy", 0); - m_opt_btnDesc = db_get_b(NULL, MODULENAME, "AutoDescription", 1); - m_opt_btnDeleteAfterSend = db_get_b(NULL, MODULENAME, "DelAfterSend", 1) != 0; - m_opt_chkEditor = db_get_b(NULL, MODULENAME, "Preview", 0); - m_opt_chkOpenAgain = db_get_b(NULL, MODULENAME, "OpenAgain", 0); + m_opt_btnDesc = g_plugin.getByte("AutoDescription", 1); + m_opt_btnDeleteAfterSend = g_plugin.getByte("DelAfterSend", 1) != 0; + m_opt_chkEditor = g_plugin.getByte("Preview", 0); + m_opt_chkOpenAgain = g_plugin.getByte("OpenAgain", 0); } void TfrmMain::SaveOptions(void) { if (m_bOnExitSave) { - db_set_dw(NULL, MODULENAME, "AlphaColor", + g_plugin.setDword("AlphaColor", (DWORD)RGB(m_AlphaColor.rgbRed, m_AlphaColor.rgbGreen, m_AlphaColor.rgbBlue)); - db_set_b(NULL, MODULENAME, "JpegQuality", m_opt_edtQuality); + g_plugin.setByte("JpegQuality", m_opt_edtQuality); - db_set_b(NULL, MODULENAME, "Capture", m_opt_tabCapture); - db_set_b(NULL, MODULENAME, "IndirectCapture", m_opt_chkIndirectCapture); - db_set_b(NULL, MODULENAME, "ClientArea", m_opt_chkClientArea); - db_set_b(NULL, MODULENAME, "Desktop", m_opt_cboxDesktop); + g_plugin.setByte("Capture", m_opt_tabCapture); + g_plugin.setByte("IndirectCapture", m_opt_chkIndirectCapture); + g_plugin.setByte("ClientArea", m_opt_chkClientArea); + g_plugin.setByte("Desktop", m_opt_cboxDesktop); - db_set_b(NULL, MODULENAME, "TimedCap", m_opt_chkTimed); - db_set_b(NULL, MODULENAME, "CapTime", m_opt_edtTimed); - db_set_b(NULL, MODULENAME, "OutputFormat", m_opt_cboxFormat); - db_set_b(NULL, MODULENAME, "SendBy", m_opt_cboxSendBy); + g_plugin.setByte("TimedCap", m_opt_chkTimed); + g_plugin.setByte("CapTime", m_opt_edtTimed); + g_plugin.setByte("OutputFormat", m_opt_cboxFormat); + g_plugin.setByte("SendBy", m_opt_cboxSendBy); - db_set_b(NULL, MODULENAME, "AutoDescription", m_opt_btnDesc); - db_set_b(NULL, MODULENAME, "DelAfterSend", m_opt_btnDeleteAfterSend); - db_set_b(NULL, MODULENAME, "Preview", m_opt_chkEditor); - db_set_b(NULL, MODULENAME, "OpenAgain", m_opt_chkOpenAgain); + g_plugin.setByte("AutoDescription", m_opt_btnDesc); + g_plugin.setByte("DelAfterSend", m_opt_btnDeleteAfterSend); + g_plugin.setByte("Preview", m_opt_chkEditor); + g_plugin.setByte("OpenAgain", m_opt_chkOpenAgain); } } @@ -935,7 +935,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP *dib) return 1; // generate file name - unsigned FileNumber = db_get_dw(NULL, MODULENAME, "FileNumber", 0) + 1; + unsigned FileNumber = g_plugin.getDword("FileNumber", 0) + 1; if (FileNumber > 99999) FileNumber = 1; @@ -1023,7 +1023,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP *dib) if (!ret) return 1; - db_set_dw(NULL, MODULENAME, "FileNumber", FileNumber); + g_plugin.setDword("FileNumber", FileNumber); replaceStrW(m_pszFile, wszFileName); if (!IsWindowEnabled(GetDlgItem(m_hWnd, ID_chkDesc)) || !m_opt_btnDesc) diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index 5603dca892..1eb23a1c59 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -654,8 +654,8 @@ INT_PTR MsgBoxService(WPARAM, LPARAM lParam) if (!(pMsgBox->uType & (MB_INFOBAR | MB_NOPOPUP)) // message box can be a popup? && ServiceExists(MS_POPUP_ADDPOPUPT) // popups exist? && myGlobals.PopupActionsExist == 1 // popup support ext stuct? - && (db_get_dw(NULL, "Popup", "Actions", 0) & 1) // popup++ actions on? - && db_get_b(NULL, MODNAME, SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX)) // user likes popups? + && (db_get_dw(0, "Popup", "Actions", 0) & 1) // popup++ actions on? + && db_get_b(0, MODNAME, SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX)) // user likes popups? return DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_MSGBOXDUMMI), pMsgBox->hParent, MsgBoxPop, lParam); return DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_MSGBOX), pMsgBox->hParent, MsgBoxProc, lParam); |