summaryrefslogtreecommitdiff
path: root/plugins/Msg_Export/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-08-13 19:16:38 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-08-13 19:16:38 +0300
commit7572c2f49fc29f3f5b20128cdb96e6087f89ab9a (patch)
tree331c8eca7d807e7c0af7c3b18b3674e180a7b217 /plugins/Msg_Export/src/main.cpp
parent4e8d4723c8d60474147e12e7f6ff85836681d746 (diff)
MsgExport: options diivded into two separate dialogs, code cleaning
Diffstat (limited to 'plugins/Msg_Export/src/main.cpp')
-rwxr-xr-xplugins/Msg_Export/src/main.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp
index 3ce7781be1..08cb626d0e 100755
--- a/plugins/Msg_Export/src/main.cpp
+++ b/plugins/Msg_Export/src/main.cpp
@@ -110,7 +110,7 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/)
HookEvent(ME_DB_CONTACT_DELETED, nContactDeleted);
HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
- if (!bReplaceHistory) {
+ if (!g_bReplaceHistory) {
CMenuItem mi(&g_plugin);
SET_UID(mi, 0x701c543, 0xd078, 0x41dd, 0x95, 0xe3, 0x96, 0x49, 0x8a, 0x72, 0xc7, 0x50);
mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_EXPORT_MESSAGE));
@@ -141,28 +141,29 @@ int CMPlugin::Load()
{
HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
- nMaxLineWidth = db_get_w(NULL, MODULENAME, "MaxLineWidth", nMaxLineWidth);
+ nMaxLineWidth = getWord("MaxLineWidth", nMaxLineWidth);
if (nMaxLineWidth > 0 && nMaxLineWidth < 5)
nMaxLineWidth = 5;
- sExportDir = _DBGetStringW(NULL, MODULENAME, "ExportDir", L"%dbpath%\\MsgExport\\");
- sDefaultFile = _DBGetStringW(NULL, MODULENAME, "DefaultFile", L"%nick%.txt");
+ g_sExportDir = _DBGetStringW(NULL, MODULENAME, "ExportDir", L"%dbpath%\\MsgExport\\");
+ g_sDefaultFile = _DBGetStringW(NULL, MODULENAME, "DefaultFile", L"%nick%.txt");
- sTimeFormat = _DBGetStringW(NULL, MODULENAME, "TimeFormat", L"d s");
+ g_sTimeFormat = _DBGetStringW(NULL, MODULENAME, "TimeFormat", L"d s");
sFileViewerPrg = _DBGetStringW(NULL, MODULENAME, "FileViewerPrg", L"");
- bUseInternalViewer(db_get_b(NULL, MODULENAME, "UseInternalViewer", bUseInternalViewer()) != 0);
+ bUseInternalViewer(getBool("UseInternalViewer", bUseInternalViewer()));
- bReplaceHistory = db_get_b(NULL, MODULENAME, "ReplaceHistory", bReplaceHistory) != 0;
- bAppendNewLine = db_get_b(NULL, MODULENAME, "AppendNewLine", bAppendNewLine) != 0;
- bUseUtf8InNewFiles = db_get_b(NULL, MODULENAME, "UseUtf8InNewFiles", bUseUtf8InNewFiles) != 0;
- bUseLessAndGreaterInExport = db_get_b(NULL, MODULENAME, "UseLessAndGreaterInExport", bUseLessAndGreaterInExport) != 0;
+ g_bUseJson = getBool("UseJson", false);
+ g_bAppendNewLine = getBool("AppendNewLine", true);
+ g_bReplaceHistory = getBool("ReplaceHistory", false);
+ g_bUseUtf8InNewFiles = getBool("UseUtf8InNewFiles", g_bUseUtf8InNewFiles);
+ g_bUseLessAndGreaterInExport = getBool("UseLessAndGreaterInExport", false);
- enRenameAction = (ENDialogAction)db_get_b(NULL, MODULENAME, "RenameAction", enRenameAction);
- enDeleteAction = (ENDialogAction)db_get_b(NULL, MODULENAME, "DeleteAction", enDeleteAction);
+ g_enRenameAction = (ENDialogAction)getByte("RenameAction", eDAPromptUser);
+ g_enDeleteAction = (ENDialogAction)getByte("DeleteAction", eDAPromptUser);
HANDLE hServiceFunc = nullptr;
- if (bReplaceHistory)
+ if (g_bReplaceHistory)
hServiceFunc = CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY, ShowExportHistory); //this need new code
if (!hServiceFunc)