diff options
author | George Hazan <ghazan@miranda.im> | 2021-05-13 20:16:07 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-05-13 20:16:07 +0300 |
commit | 21833669fa44e8b8cee8dcb5779e14dc85990221 (patch) | |
tree | b9de25aaf7d0e4f657c34c5766f15f297c290f91 /plugins/QuickSearch | |
parent | b378298146b77902d23658624d7cb18edf74d0ae (diff) |
fixes #2882 (QuickSearch: wrong default options values)
Diffstat (limited to 'plugins/QuickSearch')
-rw-r--r-- | plugins/QuickSearch/src/main.cpp | 3 | ||||
-rw-r--r-- | plugins/QuickSearch/src/options.cpp | 6 | ||||
-rw-r--r-- | plugins/QuickSearch/src/stdafx.h | 2 | ||||
-rw-r--r-- | plugins/QuickSearch/src/utils.cpp | 6 |
4 files changed, 10 insertions, 7 deletions
diff --git a/plugins/QuickSearch/src/main.cpp b/plugins/QuickSearch/src/main.cpp index fef90535c5..4d20890483 100644 --- a/plugins/QuickSearch/src/main.cpp +++ b/plugins/QuickSearch/src/main.cpp @@ -171,7 +171,8 @@ int CMPlugin::Load() HookEvent(ME_SYSTEM_MODULELOAD, OnCheckPlugins); HookEvent(ME_SYSTEM_MODULEUNLOAD, OnCheckPlugins); - LoadColumns(m_columns); + if (!LoadColumns(m_columns)) + LoadDefaultColumns(m_columns); return 0; } diff --git a/plugins/QuickSearch/src/options.cpp b/plugins/QuickSearch/src/options.cpp index c8b7320dbf..2f4025dc70 100644 --- a/plugins/QuickSearch/src/options.cpp +++ b/plugins/QuickSearch/src/options.cpp @@ -235,9 +235,9 @@ public: m_list.SetExtendedListViewStyle(m_list.GetExtendedListViewStyle() | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES); m_list.AddColumn(0, L"#", 20); - m_list.AddColumn(1, TranslateT("Title"), g_plugin.getWord("col1")); - m_list.AddColumn(2, TranslateT("Module/InfoType"), g_plugin.getWord("col2")); - m_list.AddColumn(3, TranslateT("Setting"), g_plugin.getWord("col3")); + m_list.AddColumn(1, TranslateT("Title"), g_plugin.getWord("col1", 95)); + m_list.AddColumn(2, TranslateT("Module/InfoType"), g_plugin.getWord("col2", 105)); + m_list.AddColumn(3, TranslateT("Setting"), g_plugin.getWord("col3", 85)); cmbVarType.AddString(TranslateT("DB setting"), QST_SETTING); cmbVarType.AddString(TranslateT("Script"), QST_SCRIPT); diff --git a/plugins/QuickSearch/src/stdafx.h b/plugins/QuickSearch/src/stdafx.h index 591ac22596..ae66116c0c 100644 --- a/plugins/QuickSearch/src/stdafx.h +++ b/plugins/QuickSearch/src/stdafx.h @@ -200,7 +200,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> void LoadOptWnd(); void SaveOptWnd(); - void LoadColumns(OBJLIST<ColumnItem>&); + int LoadColumns(OBJLIST<ColumnItem>&); void LoadColumn(int n, ColumnItem &col); void LoadParamValue(char *buf, DWORD &flags, LPARAM &value); diff --git a/plugins/QuickSearch/src/utils.cpp b/plugins/QuickSearch/src/utils.cpp index fdacf1dafc..69b5f09c12 100644 --- a/plugins/QuickSearch/src/utils.cpp +++ b/plugins/QuickSearch/src/utils.cpp @@ -258,7 +258,7 @@ void CMPlugin::LoadOptWnd() m_rect.left = getDword(so_mleft); m_rect.top = getDword(so_mtop); - m_flags = getDword(so_flags); + m_flags = getDword(so_flags, QSO_SORTBYSTATUS + QSO_DRAWGRID + QSO_CLIENTICONS + QSO_COLORIZE + QSO_SORTASC); m_sortOrder = getDword(so_columnsort); } @@ -276,7 +276,7 @@ void CMPlugin::SaveOptWnd() ///////////////////////////////////////////////////////////////////////////////////////// // load options -void CMPlugin::LoadColumns(OBJLIST<ColumnItem> &dst) +int CMPlugin::LoadColumns(OBJLIST<ColumnItem> &dst) { m_flags = getDword(so_flags); int numCols = getWord(so_numcolumns); @@ -286,6 +286,8 @@ void CMPlugin::LoadColumns(OBJLIST<ColumnItem> &dst) LoadColumn(i, *pNew); dst.insert(pNew); } + + return numCols; } void CMPlugin::LoadColumn(int n, ColumnItem &col) |