diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/mir_app.vcxproj | 96 | ||||
-rw-r--r-- | src/mir_app/mir_app.vcxproj.filters | 299 | ||||
-rw-r--r-- | src/mir_app/res/resource.rc | 18 | ||||
-rw-r--r-- | src/mir_app/src/contacts.cpp | 3 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/miranda.h | 1 | ||||
-rw-r--r-- | src/mir_app/src/popupOption.cpp | 104 | ||||
-rw-r--r-- | src/mir_app/src/resource.h | 6 |
9 files changed, 520 insertions, 9 deletions
diff --git a/src/mir_app/mir_app.vcxproj b/src/mir_app/mir_app.vcxproj index 4ced95c9a1..cf8eec0f0c 100644 --- a/src/mir_app/mir_app.vcxproj +++ b/src/mir_app/mir_app.vcxproj @@ -130,6 +130,7 @@ <ClCompile Include="src\options.cpp" />
<ClCompile Include="src\path.cpp" />
<ClCompile Include="src\pluginopts.cpp" />
+ <ClCompile Include="src\popupOption.cpp" />
<ClCompile Include="src\popups.cpp" />
<ClCompile Include="src\profilemanager.cpp" />
<ClCompile Include="src\protocols.cpp" />
@@ -210,10 +211,105 @@ <ResourceCompile Include="res\version.rc" />
</ItemGroup>
<ItemGroup>
+ <None Include="res\cursor_drag_copy.cur" />
+ <None Include="res\cursor_drop_user.cur" />
+ <None Include="res\cursor_hyperlink.cur" />
<None Include="src\mir_app.def" />
<None Include="src\mir_app64.def" />
</ItemGroup>
<ItemGroup>
<Text Include="..\docs\contributors.txt" />
</ItemGroup>
+ <ItemGroup>
+ <Image Include="res\addgroup.ico" />
+ <Image Include="res\always_visible.ico" />
+ <Image Include="res\auth_add.ico" />
+ <Image Include="res\auth_grant.ico" />
+ <Image Include="res\auth_request.ico" />
+ <Image Include="res\auth_revoke.ico" />
+ <Image Include="res\chat\1.ico" />
+ <Image Include="res\chat\2.ico" />
+ <Image Include="res\chat\3.ico" />
+ <Image Include="res\chat\4.ico" />
+ <Image Include="res\chat\5.ico" />
+ <Image Include="res\chat\6.ico" />
+ <Image Include="res\chat_channel.ico" />
+ <Image Include="res\chat_join.ico" />
+ <Image Include="res\chat_leave.ico" />
+ <Image Include="res\check_off.ico" />
+ <Image Include="res\check_on.ico" />
+ <Image Include="res\contact_add.ico" />
+ <Image Include="res\contact_delete.ico" />
+ <Image Include="res\contact_groups.ico" />
+ <Image Include="res\contact_rename.ico" />
+ <Image Include="res\contact_view_details.ico" />
+ <Image Include="res\database.ico" />
+ <Image Include="res\female.ico" />
+ <Image Include="res\group_closed.ico" />
+ <Image Include="res\group_opened.ico" />
+ <Image Include="res\icon_accmgr.ico" />
+ <Image Include="res\icon_all.ico" />
+ <Image Include="res\icon_ansi.ico" />
+ <Image Include="res\icon_auth_request.ico" />
+ <Image Include="res\icon_connecting.ico" />
+ <Image Include="res\icon_down_arrow.ico" />
+ <Image Include="res\icon_error.ico" />
+ <Image Include="res\Icon_exit.ico" />
+ <Image Include="res\icon_fatal.ico" />
+ <Image Include="res\icon_file.ico" />
+ <Image Include="res\icon_find_user.ico" />
+ <Image Include="res\icon_frame.ico" />
+ <Image Include="res\icon_help.ico" />
+ <Image Include="res\icon_history.ico" />
+ <Image Include="res\icon_loaded_gray.ico" />
+ <Image Include="res\icon_mail.ico" />
+ <Image Include="res\icon_mainmenu.ico" />
+ <Image Include="res\icon_message.ico" />
+ <Image Include="res\icon_notify.ico" />
+ <Image Include="res\icon_notloaded.ico" />
+ <Image Include="res\icon_notloaded_gray.ico" />
+ <Image Include="res\icon_options.ico" />
+ <Image Include="res\icon_password.ico" />
+ <Image Include="res\icon_popup.ico" />
+ <Image Include="res\icon_popup_no.ico" />
+ <Image Include="res\icon_search_all.ico" />
+ <Image Include="res\Icon_show_hide.ico" />
+ <Image Include="res\icon_small_dot.ico" />
+ <Image Include="res\icon_sms.ico" />
+ <Image Include="res\icon_typing.ico" />
+ <Image Include="res\icon_undo.ico" />
+ <Image Include="res\icon_unicode.ico" />
+ <Image Include="res\icon_url.ico" />
+ <Image Include="res\icon_warning.ico" />
+ <Image Include="res\icon_window.ico" />
+ <Image Include="res\icon_windows.ico" />
+ <Image Include="res\male.ico" />
+ <Image Include="res\meta_add.ico" />
+ <Image Include="res\meta_convert.ico" />
+ <Image Include="res\meta_edit.ico" />
+ <Image Include="res\meta_menu.ico" />
+ <Image Include="res\meta_menuof.ico" />
+ <Image Include="res\meta_remove2.ico" />
+ <Image Include="res\meta_set_as_default.ico" />
+ <Image Include="res\miranda_home.ico" />
+ <Image Include="res\miranda_logo.ico" />
+ <Image Include="res\miranda_manager.ico" />
+ <Image Include="res\never_visible.ico" />
+ <Image Include="res\Off.ico" />
+ <Image Include="res\On.ico" />
+ <Image Include="res\sound.ico" />
+ <Image Include="res\status_away.ico" />
+ <Image Include="res\status_DND.ico" />
+ <Image Include="res\status_free4chat.ico" />
+ <Image Include="res\status_invisible.ico" />
+ <Image Include="res\status_locked.ico" />
+ <Image Include="res\status_NA.ico" />
+ <Image Include="res\status_occupied.ico" />
+ <Image Include="res\status_offline.ico" />
+ <Image Include="res\status_online.ico" />
+ <Image Include="res\status_on_the_phone.ico" />
+ <Image Include="res\status_out2lunch.ico" />
+ <Image Include="res\status_user_online.ico" />
+ <Image Include="res\_blank.ico" />
+ </ItemGroup>
</Project>
\ No newline at end of file diff --git a/src/mir_app/mir_app.vcxproj.filters b/src/mir_app/mir_app.vcxproj.filters index 7686b8957a..0b29744b8c 100644 --- a/src/mir_app/mir_app.vcxproj.filters +++ b/src/mir_app/mir_app.vcxproj.filters @@ -11,9 +11,6 @@ <ClCompile Include="src\button.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\CMPluginBase.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\contact.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -83,9 +80,6 @@ <ClCompile Include="src\modules.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\newplugins.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\options.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -395,6 +389,15 @@ <ClCompile Include="src\Docking.cpp">
<Filter>Source Files\Contact list</Filter>
</ClCompile>
+ <ClCompile Include="src\CMPluginBase.cpp">
+ <Filter>Source Files\Plugins</Filter>
+ </ClCompile>
+ <ClCompile Include="src\newplugins.cpp">
+ <Filter>Source Files\Plugins</Filter>
+ </ClCompile>
+ <ClCompile Include="src\popupOption.cpp">
+ <Filter>Source Files\Plugins</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\filter.h">
@@ -469,6 +472,15 @@ <ItemGroup>
<None Include="src\mir_app.def" />
<None Include="src\mir_app64.def" />
+ <None Include="res\cursor_hyperlink.cur">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\cursor_drag_copy.cur">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\cursor_drop_user.cur">
+ <Filter>Resource Files</Filter>
+ </None>
</ItemGroup>
<ItemGroup>
<Text Include="..\docs\contributors.txt" />
@@ -501,5 +513,280 @@ <Filter Include="Source Files\Protocols">
<UniqueIdentifier>{7e7992e9-1b69-4f98-84ff-f0be4653866c}</UniqueIdentifier>
</Filter>
+ <Filter Include="Source Files\Plugins">
+ <UniqueIdentifier>{2f5b2fe9-25c8-4029-8a52-f34a11f984a7}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <Image Include="res\miranda_logo.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\miranda_home.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\miranda_manager.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\contact_view_details.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\contact_add.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\contact_rename.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\contact_delete.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\group_closed.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\group_opened.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_user_online.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_online.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_away.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_NA.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_occupied.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_DND.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_free4chat.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_invisible.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_on_the_phone.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_out2lunch.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_offline.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_connecting.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_typing.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_find_user.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_search_all.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_options.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_accmgr.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_mainmenu.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_help.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_message.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_file.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_history.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_url.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_sms.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_mail.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_small_dot.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_auth_request.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_all.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_down_arrow.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\check_off.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\check_on.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_unicode.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_ansi.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_loaded_gray.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_notloaded.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_notloaded_gray.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_frame.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_fatal.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_error.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_warning.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_notify.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\_blank.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_undo.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_window.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_windows.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\chat_join.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\chat_leave.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\status_locked.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\Icon_show_hide.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\Icon_exit.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\contact_groups.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\On.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\Off.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\always_visible.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\never_visible.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\chat_channel.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\male.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\female.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\auth_add.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\auth_grant.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\auth_request.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\auth_revoke.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\meta_menu.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\meta_menuof.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\meta_edit.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\meta_remove2.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\meta_convert.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\meta_add.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\meta_set_as_default.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\addgroup.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_popup.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_popup_no.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\icon_password.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\sound.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\database.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\chat\1.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\chat\2.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\chat\3.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\chat\4.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\chat\5.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
+ <Image Include="res\chat\6.ico">
+ <Filter>Resource Files</Filter>
+ </Image>
</ItemGroup>
</Project>
\ No newline at end of file diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc index 0886833b0f..423dbc7941 100644 --- a/src/mir_app/res/resource.rc +++ b/src/mir_app/res/resource.rc @@ -732,6 +732,14 @@ BEGIN PUSHBUTTON "Insert separator",IDC_SEPARATOR,137,211,103,15,BS_MULTILINE
END
+IDD_OPT_POPUPOPTION DIALOGEX 0, 0, 303, 229
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ CONTROL "",IDC_TREE,"SysListView32",LVS_LIST | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,0,0,303,226
+END
+
IDD_AUTHREQ DIALOGEX 0, 0, 271, 197
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
EXSTYLE WS_EX_CONTROLPARENT
@@ -1160,6 +1168,10 @@ BEGIN BOTTOMMARGIN, 186
END
+ IDD_OPT_POPUPOPTION, DIALOG
+ BEGIN
+ END
+
IDD_AUTHREQ, DIALOG
BEGIN
LEFTMARGIN, 7
@@ -1419,6 +1431,7 @@ IDI_STATUS4 ICON "chat/5.ico" IDI_STATUS5 ICON "chat/6.ico"
+
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
@@ -1598,6 +1611,11 @@ BEGIN 0
END
+IDD_OPT_POPUPOPTION AFX_DIALOG_LAYOUT
+BEGIN
+ 0
+END
+
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 0b72e6d333..57a1833b72 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -373,7 +373,8 @@ static int ContactOptInit(WPARAM wParam, LPARAM) odp.pDialog = new CContactOptsDlg();
odp.flags = ODPF_BOLDGROUPS;
g_plugin.addOptions(wParam, &odp);
- return 0;
+
+ return PopupOptionsInit(wParam);
}
int LoadContactsModule(void)
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index e4dd6236b9..5dcd71c162 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -793,3 +793,4 @@ _Netlib_SslWrite@12 @877 NONAME ?IsMirandaFolderWritable@PU@@YG_NXZ @881 NONAME
?IsDuplicateEvent@DB@@YG_NIAAUDBEVENTINFO@@@Z @882 NONAME
Srmm_GetButtonGap @883
+?addPopupOption@CMPluginBase@@QAEHPBDAAV?$CMOption@_N@@@Z @884 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index b8b265a9d3..f40aa28380 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -793,3 +793,4 @@ Netlib_SslWrite @877 NONAME ?IsMirandaFolderWritable@PU@@YA_NXZ @881 NONAME
?IsDuplicateEvent@DB@@YA_NIAEAUDBEVENTINFO@@@Z @882 NONAME
Srmm_GetButtonGap @883
+?addPopupOption@CMPluginBase@@QEAAHPEBDAEAV?$CMOption@_N@@@Z @884 NONAME
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index 17c9812570..bd2e85fb03 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -53,6 +53,7 @@ extern bool g_bModulesLoadedFired, g_bMirandaTerminated; char* GetPluginNameByInstance(HINSTANCE hInstance);
int LoadStdPlugins(void);
int LaunchServicePlugin(pluginEntry *p);
+int PopupOptionsInit(WPARAM);
/**** path.cpp *************************************************************************/
diff --git a/src/mir_app/src/popupOption.cpp b/src/mir_app/src/popupOption.cpp new file mode 100644 index 0000000000..25243de0e5 --- /dev/null +++ b/src/mir_app/src/popupOption.cpp @@ -0,0 +1,104 @@ +/* + +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright (C) 2012-22 Miranda NG team (https://miranda-ng.org), +Copyright (c) 2000-12 Miranda IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "stdafx.h" +#include "plugins.h" + +struct MPopupOption +{ + const char *m_descr; + CMPluginBase *m_plugin; + CMOption<bool> &pVal; +}; + +static OBJLIST<MPopupOption> g_arOptions(1); + +///////////////////////////////////////////////////////////////////////////////////////// + +int CMPluginBase::addPopupOption(const char *pszDescr, CMOption<bool> &pVal) +{ + MPopupOption tmp = { pszDescr, this, pVal }; + g_arOptions.insert(new MPopupOption(tmp)); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +class CPopupOptionsDlg : public CDlgBase +{ + CCtrlListView m_tree; + +public: + CPopupOptionsDlg() : + CDlgBase(g_plugin, IDD_OPT_POPUPOPTION), + m_tree(this, IDC_TREE) + {} + + bool OnInitDialog() override + { + m_tree.SetExtendedListViewStyleEx(0, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT); + + LVITEM lvi; + lvi.mask = LVIF_TEXT | LVIF_PARAM; + lvi.iSubItem = 0; + + for (auto &it : g_arOptions) { + _A2T tmp(it->m_descr); + lvi.pszText = TranslateW_LP(tmp, it->m_plugin); + lvi.lParam = LPARAM(it); + + int iRow = m_tree.InsertItem(&lvi); + m_tree.SetItemState(iRow, it->pVal ? 0x2000 : 0x1000, LVIS_STATEIMAGEMASK); + } + + return true; + } + + bool OnApply() override + { + int iRows = m_tree.GetItemCount(); + for (int i = 0; i < iRows; i++) { + LVITEM lvi; + lvi.iItem = i; + lvi.mask = LVIF_STATE | LVIF_PARAM; + m_tree.GetItem(&lvi); + + auto *p = (MPopupOption *)lvi.lParam; + p->pVal = lvi.state == 0x2000; + } + return true; + } +}; + +int PopupOptionsInit(WPARAM wParam) +{ + OPTIONSDIALOGPAGE odp = {}; + odp.position = -1000000000; + odp.szGroup.a = LPGEN("Popups"); + odp.szTitle.a = LPGEN("Enabled items"); + odp.pDialog = new CPopupOptionsDlg(); + odp.flags = ODPF_BOLDGROUPS; + g_plugin.addOptions(wParam, &odp); + return 0; +} diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h index ede8012f12..8fda4efe5c 100644 --- a/src/mir_app/src/resource.h +++ b/src/mir_app/src/resource.h @@ -30,6 +30,7 @@ #define IDD_AUTHREQ 121
#define IDD_SELECT_CRYPTOPROVIDER 122
#define IDD_LOGIN 123
+#define IDD_OPT_POPUPOPTION 124
#define IDD_DETAILS 125
#define IDD_OPT_DATABASE 126
#define IDD_HISTORY 127
@@ -592,6 +593,7 @@ #define IDC_LOGROTATE 1749
#define IDC_RIGHTCLICK 1751
#define IDC_FILTER_SEARCH 1752
+#define IDC_TREE 1753
#define IDC_EFFECT_COLOUR_TEXT1 1853
#define IDC_EFFECT_COLOUR_SPIN1 1854
#define IDC_EXTRAORDER 1889
@@ -698,9 +700,9 @@ //
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 334
+#define _APS_NEXT_RESOURCE_VALUE 335
#define _APS_NEXT_COMMAND_VALUE 40018
-#define _APS_NEXT_CONTROL_VALUE 1753
+#define _APS_NEXT_CONTROL_VALUE 1755
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|