summaryrefslogtreecommitdiff
path: root/protocols/GTalkExt/src/options.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-28 18:22:40 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-28 18:22:40 +0000
commit56ac6b6b49cd5785ce5fb14dc63e776b4b3da07a (patch)
tree7f0b1eeaa437cf2ecd31f69add3242007f46ae3b /protocols/GTalkExt/src/options.cpp
parent00c6c10291bf7f86e871b648e8dd003a0a16c8e5 (diff)
- Google specific functionality got moved to GTalkExt, part I;
- new event for extensions list creation, ME_JABBER_EXTLISTINIT git-svn-id: http://svn.miranda-ng.org/main/trunk@6260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/GTalkExt/src/options.cpp')
-rw-r--r--protocols/GTalkExt/src/options.cpp63
1 files changed, 27 insertions, 36 deletions
diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp
index 0d5fdc25ee..1f032c108e 100644
--- a/protocols/GTalkExt/src/options.cpp
+++ b/protocols/GTalkExt/src/options.cpp
@@ -233,46 +233,37 @@ INT_PTR CALLBACK PopupsOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM
return 0;
}
-void AddPopupsPage(WPARAM wParam)
-{
- OPTIONSDIALOGPAGE odp = { sizeof(odp) };
- odp.ptszTitle = MAIL_NOTIFICATIONS;
- odp.pfnDlgProc = PopupsOptionsDlgProc;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPSETTINGS);
- odp.hInstance = g_hInst;
- odp.ptszGroup = POPUPS_OPTIONS_GROUP;
- odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB;
- Options_AddPage(wParam, &odp);
-}
-
-void AddAccPage(LPTSTR acc, LPCSTR mod, WPARAM wParam)
-{
- OPTIONSDIALOGPAGE odp = { sizeof(odp) };
- odp.ptszTitle = acc;
- odp.pfnDlgProc = AccOptionsDlgProc;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAILSETTINGS);
- odp.hInstance = g_hInst;
- odp.ptszGroup = NETWORK_OPTIONS_GROUP;
- odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
- odp.ptszTab = MAIL_NOTIFICATIONS;
- odp.dwInitParam = (LPARAM)mod;
- Options_AddPage(wParam, &odp);
-}
-
int OptionsInitialization(WPARAM wParam, LPARAM lParam)
{
- int count;
- PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
- for (int i = 0; i < count; i++) {
- IJabberInterface *ji = IsGoogleAccount(accs[i]->szModuleName);
- if (ji)
- AddAccPage(accs[i]->tszAccountName, accs[i]->szModuleName, wParam);
+ if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
+ odp.ptszTitle = MAIL_NOTIFICATIONS;
+ odp.pfnDlgProc = PopupsOptionsDlgProc;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPSETTINGS);
+ odp.hInstance = g_hInst;
+ odp.ptszGroup = POPUPS_OPTIONS_GROUP;
+ odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB;
+ Options_AddPage(wParam, &odp);
}
- if (ServiceExists(MS_POPUP_ADDPOPUPT))
- AddPopupsPage(wParam);
- return FALSE;
+ for (int i=0; i < g_accs.getCount(); i++) {
+ LPCSTR szProto = g_accs[i]->GetModuleName();
+ PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ if (pa == 0)
+ continue;
+
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
+ odp.ptszTitle = pa->tszAccountName;
+ odp.pfnDlgProc = AccOptionsDlgProc;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAILSETTINGS);
+ odp.hInstance = g_hInst;
+ odp.ptszGroup = NETWORK_OPTIONS_GROUP;
+ odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
+ odp.ptszTab = MAIL_NOTIFICATIONS;
+ odp.dwInitParam = (LPARAM)szProto;
+ Options_AddPage(wParam, &odp);
+ }
+ return 0;
}
void HookOptionsInitialization()