summaryrefslogtreecommitdiff
path: root/protocols/Dummy/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-04-17 12:58:57 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-04-17 12:58:57 +0300
commit5f3e1a04da3f45067435a321b17e25ef0445e66a (patch)
tree98f7e25b7bf10399b58c8ee5386ca7f06a572cde /protocols/Dummy/src
parentf15a6313c570fc6eedb8f955ce94510438f6be52 (diff)
code cleaing
Diffstat (limited to 'protocols/Dummy/src')
-rw-r--r--protocols/Dummy/src/dummy_options.cpp4
-rw-r--r--protocols/Dummy/src/dummy_proto.cpp58
-rw-r--r--protocols/Dummy/src/stdafx.h2
3 files changed, 37 insertions, 27 deletions
diff --git a/protocols/Dummy/src/dummy_options.cpp b/protocols/Dummy/src/dummy_options.cpp
index 807ea84bb7..d1d7175905 100644
--- a/protocols/Dummy/src/dummy_options.cpp
+++ b/protocols/Dummy/src/dummy_options.cpp
@@ -33,9 +33,7 @@ INT_PTR CALLBACK DummyAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
Window_SetIcon_IcoLib(hwndDlg, ppro->m_hProtoIcon);
{
- SendDlgItemMessageA(hwndDlg, IDC_TEMPLATE, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(Translate(templates[0].name)));
- for (size_t i = 1; templates[i].name != 0; i++)
- SendDlgItemMessageA(hwndDlg, IDC_TEMPLATE, CB_INSERTSTRING, i, reinterpret_cast<LPARAM>(templates[i].name));
+ FillTemplateCombo(hwndDlg, IDC_TEMPLATE);
int templateId = ppro->getTemplateId();
SendDlgItemMessage(hwndDlg, IDC_TEMPLATE, CB_SETCURSEL, templateId, 0);
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp
index 27d2858600..a6f8c58d6d 100644
--- a/protocols/Dummy/src/dummy_proto.cpp
+++ b/protocols/Dummy/src/dummy_proto.cpp
@@ -24,32 +24,40 @@ const ttemplate templates[] =
#ifndef MIRANDA_VERSION_ISALPHA
{ "Discord", "id", LPGEN("Discord ID") },
#endif
- { "EmLAN", "Nick", LPGEN("User name") },
- { "Facebook", "ID", LPGEN("Facebook ID") },
- { "GG", "UIN", LPGEN("Gadu-Gadu number") },
- { "ICQ", "UIN", LPGEN("User ID") },
- { "ICQCorp", "UIN", LPGEN("ICQ number") },
- { "IRC", "Nick", LPGEN("Nickname") },
- { "Jabber", "jid", LPGEN("JID") },
- { "MinecraftDynmap", "Nick", LPGEN("Visible name") },
- { "MRA", "e-mail", LPGEN("E-mail address") },
- { "MSN", "wlid", LPGEN("Live ID") },
- { "Omegle", "nick", LPGEN("Visible name") },
- { "Sametime", "stid", LPGEN("ID") },
- { "Skype (SkypeKit)", "sid", LPGEN("Skype name") },
- { "Skype (Classic)", "Username", LPGEN("Skype name") },
- { "Skype (Web)", "Username", LPGEN("Skype name") },
- { "Steam", "SteamID", LPGEN("Steam ID") },
- { "Tlen", "jid", LPGEN("Tlen login") },
- { "Tox", "ToxID", LPGEN("Tox ID") },
- { "Twitter", "Username", LPGEN("Username") },
- { "VK", "ID", LPGEN("VKontakte ID") },
- { "WhatsApp", "ID", LPGEN("WhatsApp ID") },
- { "XFire", "Username", LPGEN("Username") },
- { "Yahoo", "yahoo_id", LPGEN("ID") },
- { 0, 0, 0 }
+ { "EmLAN", "Nick", LPGEN("User name") },
+ { "Facebook", "ID", LPGEN("Facebook ID") },
+ { "GG", "UIN", LPGEN("Gadu-Gadu number") },
+ { "ICQ", "UIN", LPGEN("User ID") },
+ { "ICQCorp", "UIN", LPGEN("ICQ number") },
+ { "IRC", "Nick", LPGEN("Nickname") },
+ { "Jabber", "jid", LPGEN("JID") },
+ { "MinecraftDynmap", "Nick", LPGEN("Visible name") },
+ { "MRA", "e-mail", LPGEN("E-mail address") },
+ { "MSN", "wlid", LPGEN("Live ID") },
+ { "Omegle", "nick", LPGEN("Visible name") },
+ { "Sametime", "stid", LPGEN("ID") },
+ { "Skype (SkypeKit)", "sid", LPGEN("Skype name") },
+ { "Skype (Classic)", "Username", LPGEN("Skype name") },
+ { "Skype (Web)", "Username", LPGEN("Skype name") },
+ { "Steam", "SteamID", LPGEN("Steam ID") },
+ { "Tlen", "jid", LPGEN("Tlen login") },
+ { "Tox", "ToxID", LPGEN("Tox ID") },
+ { "Twitter", "Username", LPGEN("Username") },
+ { "VK", "ID", LPGEN("VKontakte ID") },
+ { "WhatsApp", "ID", LPGEN("WhatsApp ID") },
+ { "XFire", "Username", LPGEN("Username") },
+ { "Yahoo", "yahoo_id", LPGEN("ID") },
+ { "Telegram", "id", LPGEN("Telegram ID") },
};
+void FillTemplateCombo(HWND hwndDlg, int iCtrlId)
+{
+ for (auto &it : templates) {
+ int i = &it - templates;
+ SendDlgItemMessageA(hwndDlg, iCtrlId, CB_INSERTSTRING, i, LPARAM(i == 0 ? Translate(it.name) : it.name));
+ }
+}
+
void CDummyProto::SearchIdAckThread(void *targ)
{
PROTOSEARCHRESULT psr = { 0 };
@@ -63,6 +71,8 @@ void CDummyProto::SearchIdAckThread(void *targ)
mir_free(targ);
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static int sttCompareProtocols(const CDummyProto *p1, const CDummyProto *p2)
{
return mir_wstrcmp(p1->m_tszUserName, p2->m_tszUserName);
diff --git a/protocols/Dummy/src/stdafx.h b/protocols/Dummy/src/stdafx.h
index 17db5c82d4..4dd662c2db 100644
--- a/protocols/Dummy/src/stdafx.h
+++ b/protocols/Dummy/src/stdafx.h
@@ -59,3 +59,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "resource.h"
#include "dummy.h"
#include "dummy_proto.h"
+
+void FillTemplateCombo(HWND hwndDlg, int iCtrlId);