summaryrefslogtreecommitdiff
path: root/protocols/Xfire/src
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-02-23 13:36:18 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-02-23 13:36:18 +0000
commit197abf300c77a2ca088d2cd22ea51e23dfc48983 (patch)
treea00cc83c19927b0d269b79e920339729acd7a879 /protocols/Xfire/src
parent23d8983fd3935d7d9d43bd14454eb6be55de3c40 (diff)
the XFire options redesign (fixes #229)
git-svn-id: http://svn.miranda-ng.org/main/trunk@3723 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Xfire/src')
-rw-r--r--protocols/Xfire/src/main.cpp24
-rw-r--r--protocols/Xfire/src/options.cpp241
2 files changed, 75 insertions, 190 deletions
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp
index dab7685ef9..e723338788 100644
--- a/protocols/Xfire/src/main.cpp
+++ b/protocols/Xfire/src/main.cpp
@@ -764,13 +764,11 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
//=====================================================
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
-
//=====================================================
// Unloads plugin
//=====================================================
@@ -948,42 +946,42 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam)
tr.tszTokenString = _T("xfiregame");
tr.parseFunction = Varxfiregame;
- tr.szHelpText = "XFire\tCurrent Game";
+ tr.szHelpText = LPGEN("XFire")"\t"LPGEN("Current Game");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr);
tr.tszTokenString = _T("myxfiregame");
tr.parseFunction = Varmyxfiregame;
- tr.szHelpText = "XFire\tMy Current Game";
+ tr.szHelpText = LPGEN("XFire")"\t"LPGEN("My Current Game");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr);
tr.tszTokenString = _T("xfireserverip");
tr.parseFunction = Varxfireserverip;
- tr.szHelpText = "XFire\tServerIP";
+ tr.szHelpText = LPGEN("XFire")"\t"LPGEN("ServerIP");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr);
tr.tszTokenString = _T("myxfireserverip");
tr.parseFunction = Varmyxfireserverip;
- tr.szHelpText = "XFire\tMy Current ServerIP";
+ tr.szHelpText = LPGEN("XFire")"\t"LPGEN("My Current ServerIP");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr);
tr.tszTokenString = _T("xfirevoice");
tr.parseFunction = Varxfirevoice;
- tr.szHelpText = "XFire\tVoice";
+ tr.szHelpText = LPGEN("XFire")"\t"LPGEN("Voice");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr);
tr.tszTokenString = _T("myxfirevoice");
tr.parseFunction = Varmyxfirevoice;
- tr.szHelpText = "XFire\tMy Current Voice";
+ tr.szHelpText = LPGEN("XFire")"\t"LPGEN("My Current Voice");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr);
tr.tszTokenString = _T("xfirevoiceip");
tr.parseFunction = Varxfirevoiceip;
- tr.szHelpText = "XFire\tVoice ServerIP";
+ tr.szHelpText = LPGEN("XFire")"\t"LPGEN("Voice ServerIP");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr);
tr.tszTokenString = _T("myxfirevoiceip");
tr.parseFunction = Varmyxfirevoiceip;
- tr.szHelpText = "XFire\tMy Voice ServerIP";
+ tr.szHelpText = LPGEN("XFire")"\t"LPGEN("My Voice ServerIP");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr);
}
@@ -995,7 +993,7 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam)
}
//sound einfügen
- SkinAddNewSoundEx(Translate("xfirebstartgame"),protocolname,Translate("Buddy start a game"));
+ SkinAddNewSoundEx("xfirebstartgame",protocolname,LPGEN("Buddy start a game"));
//hook für mbot einfügen, nur wenn mbot option aktiv
if(DBGetContactSettingByte(NULL,protocolname,"mbotsupport",0))
@@ -3147,7 +3145,7 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
//buddy vorher ein spielgestartet, wenn nicht sound spielen?
if(!DBGetContactSettingWord(hContact, protocolname, "GameId",0))
- SkinPlaySound( Translate( "xfirebstartgame" ) );
+ SkinPlaySound("xfirebstartgame");
DBWriteContactSettingWord(hContact, protocolname, "GameId", entry->game);
}
diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp
index f1b38be7f0..e5e9b1ee2e 100644
--- a/protocols/Xfire/src/options.cpp
+++ b/protocols/Xfire/src/options.cpp
@@ -64,44 +64,44 @@ xfireconfigitem xfireconfigitems[XFIRE_RECVPREFSPACKET_SUPPORTEDONFIGS] = {
};
#define NUM_ICONS 4
-
-static mytreeitem mytree[] = {
- {LPGEN("Avatars"),"",1,0},
- {LPGEN("Disable avatars"),"noavatars",0,0},
- {LPGEN("Dont download avatars of clan members"),"noclanavatars",0,0},
- {LPGEN("Use alternate way for Avatar download"),"specialavatarload",0,0},
- {LPGEN("General"),"",1,0},
- {LPGEN("Use UTF8 for messaging and nick's (beta)"),"useutf8",0,0},
- {LPGEN("Automatically reconnect on protocol version changes"),"recprotoverchg",0,0},
- {LPGEN("No Ip/Port in StatusMsg"),"noipportinstatus",0,0},
- {LPGEN("Use Online status for unsupported global statuses"),"oninsteadafk",0,0},
- {LPGEN("Dont move friends to clan groups"),"skipfriendsgroups",0,0},
- {LPGEN("GameServerQuery support"),"gsqsupport",0,0},
- {LPGEN("No custom away message"),"nocustomaway",0,0},
- {LPGEN("Remove friend of friend buddies from database"),"fofdbremove",0,0},
- /*{"Show usernames only","onlyusername",0},*/
- {LPGEN("Hide yourself in buddylist"),"skipmyself",0,0},
- {LPGEN("Dont display game search results"),"dontdisresults",0,0},
- {LPGEN("Dont display game search status window"),"dontdissstatus",0,0},
- {LPGEN("Display popup, if someone start a game"),"gamepopup",0,0},
- {LPGEN("Dont automatically create clan groups"),"noclangroups",0,0},
- {LPGEN("Enable MBot support"),"mbotsupport",0,0},
- {LPGEN("Gamedetection"),"",1,0},
- /*{"Scan for games on every Miranda start","scanalways",0},*/
- {LPGEN("Disable game detection"),"nogamedetect",0,0},
- /*{"Enable server IP/Port detection","ipportdetec",0},*/
- /*{"Enable TeamSpeak2/Ventrilo detection","",0},*/
- {LPGEN("Use TSRemote.dll to get teamspeak server info"),"ts2useremote",0,0},
- {LPGEN("Disable popups when ingame"),"nopopups",0,0},
- {LPGEN("Disable sound events when ingame"),"nosoundev",0,0},
- {LPGEN("Files"),"",1,0},
- {LPGEN("Automatically update xfire_games.ini (pro-laming.de)"),"autoiniupdate",0,0},
- {LPGEN("Automatically update icons.dll (pro-laming.de)"),"autoicodllupdate",0,0},
- {LPGEN("Download missing game icons from Xfire website"),"xfiresitegameico",0,0},
- {LPGEN("No backup on update"),"nobackupini",0,0},
- {LPGEN("Background updating"),"dontaskforupdate",0,0},
-};
-
+
+static mytreeitem mytree[] = {
+ {LPGEN("Avatars"),"",1,0},
+ {LPGEN("Disable avatars"),"noavatars",0,0},
+ {LPGEN("Dont download avatars of clan members"),"noclanavatars",0,0},
+ {LPGEN("Use alternate way for Avatar download"),"specialavatarload",0,0},
+ {LPGEN("General"),"",1,0},
+ {LPGEN("Use UTF8 for messaging and nick's (beta)"),"useutf8",0,0},
+ {LPGEN("Automatically reconnect on protocol version changes"),"recprotoverchg",0,0},
+ {LPGEN("No Ip/Port in StatusMsg"),"noipportinstatus",0,0},
+ {LPGEN("Use Online status for unsupported global statuses"),"oninsteadafk",0,0},
+ {LPGEN("Dont move friends to clan groups"),"skipfriendsgroups",0,0},
+ {LPGEN("GameServerQuery support"),"gsqsupport",0,0},
+ {LPGEN("No custom away message"),"nocustomaway",0,0},
+ {LPGEN("Remove friend of friend buddies from database"),"fofdbremove",0,0},
+ /*{"Show usernames only","onlyusername",0},*/
+ {LPGEN("Hide yourself in buddylist"),"skipmyself",0,0},
+ {LPGEN("Dont display game search results"),"dontdisresults",0,0},
+ {LPGEN("Dont display game search status window"),"dontdissstatus",0,0},
+ {LPGEN("Display popup, if someone start a game"),"gamepopup",0,0},
+ {LPGEN("Dont automatically create clan groups"),"noclangroups",0,0},
+ {LPGEN("Enable MBot support"),"mbotsupport",0,0},
+ {LPGEN("Gamedetection"),"",1,0},
+ /*{"Scan for games on every Miranda start","scanalways",0},*/
+ {LPGEN("Disable game detection"),"nogamedetect",0,0},
+ /*{"Enable server IP/Port detection","ipportdetec",0},*/
+ /*{"Enable TeamSpeak2/Ventrilo detection","",0},*/
+ {LPGEN("Use TSRemote.dll to get teamspeak server info"),"ts2useremote",0,0},
+ {LPGEN("Disable popups when ingame"),"nopopups",0,0},
+ {LPGEN("Disable sound events when ingame"),"nosoundev",0,0},
+ {LPGEN("Files"),"",1,0},
+ {LPGEN("Automatically update xfire_games.ini (pro-laming.de)"),"autoiniupdate",0,0},
+ {LPGEN("Automatically update icons.dll (pro-laming.de)"),"autoicodllupdate",0,0},
+ {LPGEN("Download missing game icons from Xfire website"),"xfiresitegameico",0,0},
+ {LPGEN("No backup on update"),"nobackupini",0,0},
+ {LPGEN("Background updating"),"dontaskforupdate",0,0},
+};
+
//funktion zum auslesen aller einträge unter XFireBlock
static int enumSettingsProc(const char *szSetting,LPARAM lParam)
{
@@ -1099,152 +1099,39 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
return FALSE;
}
-static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+int OptInit(WPARAM wParam,LPARAM)
{
- switch (msg)
- {
- case PSM_CHANGED:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case WM_INITDIALOG:
- {
- HWND hwndTab,hPage;
- TCITEMA tci = {0};
- int iTotal;
- RECT rcClient;
-
- hwndTab = GetDlgItem(hwndDlg, IDC_OPTIONSTAB);
- TabCtrl_DeleteAllItems(hwndTab);
- GetClientRect(GetParent(hwndTab), &rcClient);
-
- hPage=CreateDialog(hinstance, MAKEINTRESOURCE(IDD_OPTLOGIN), hwndDlg, DlgProcOpts2);
- iTotal = TabCtrl_GetItemCount(hwndTab);
- tci.mask = TCIF_PARAM|TCIF_TEXT;
- tci.lParam = (LPARAM)hPage;
- tci.pszText = Translate("Account");
- SendMessageA(hwndTab, TCM_INSERTITEMA, iTotal, (WPARAM)&tci);
- MoveWindow(hPage, 3, 24, rcClient.right - 6, rcClient.bottom - 28, 1);
- iTotal++;
-
-
- hPage=CreateDialog(hinstance, MAKEINTRESOURCE(IDD_OPTFEAT), hwndDlg, DlgProcOpts3);
- ShowWindow(hPage,FALSE);
- iTotal = TabCtrl_GetItemCount(hwndTab);
- tci.mask = TCIF_PARAM|TCIF_TEXT;
- tci.lParam = (LPARAM)hPage;
- tci.pszText = Translate("Features");
- SendMessageA(hwndTab, TCM_INSERTITEMA, iTotal, (WPARAM)&tci);
- MoveWindow(hPage, 3, 24, rcClient.right - 6, rcClient.bottom - 28, 1);
- iTotal++;
-
- hPage=CreateDialog(hinstance, MAKEINTRESOURCE(IDD_OPTFEAT2), hwndDlg, DlgProcOpts4);
- ShowWindow(hPage,FALSE);
- iTotal = TabCtrl_GetItemCount(hwndTab);
- tci.mask = TCIF_PARAM|TCIF_TEXT;
- tci.lParam = (LPARAM)hPage;
- tci.pszText = Translate("Blocklist / Games");
- SendMessageA(hwndTab, TCM_INSERTITEMA, iTotal, (WPARAM)&tci);
- MoveWindow(hPage, 3, 24, rcClient.right - 6, rcClient.bottom - 28, 1);
- iTotal++;
-
- hPage=CreateDialog(hinstance, MAKEINTRESOURCE(IDD_OPTFEAT3), hwndDlg, DlgProcOpts5);
- ShowWindow(hPage,FALSE);
- iTotal = TabCtrl_GetItemCount(hwndTab);
- tci.mask = TCIF_PARAM|TCIF_TEXT;
- tci.lParam = (LPARAM)hPage;
- tci.pszText = Translate("StatusMsg");
- SendMessageA(hwndTab, TCM_INSERTITEMA, iTotal, (WPARAM)&tci);
- MoveWindow(hPage, 3, 24, rcClient.right - 6, rcClient.bottom - 28, 1);
- iTotal++;
-
- hPage=CreateDialog(hinstance, MAKEINTRESOURCE(IDD_OPTFEAT4), hwndDlg, DlgProcOpts6);
- ShowWindow(hPage,FALSE);
- iTotal = TabCtrl_GetItemCount(hwndTab);
- tci.mask = TCIF_PARAM|TCIF_TEXT;
- tci.lParam = (LPARAM)hPage;
- tci.pszText = Translate("Games");
- SendMessageA(hwndTab, TCM_INSERTITEMA, iTotal, (WPARAM)&tci);
- MoveWindow(hPage, 3, 24, rcClient.right - 6, rcClient.bottom - 28, 1);
- iTotal++;
-
- TabCtrl_SetCurSel(hwndTab, 0);
+ ghwndDlg2 = NULL;
- return TRUE;
- }
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->idFrom)
- {
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- TCITEM tci;
- int i,count;
-
- tci.mask = TCIF_PARAM;
- count = TabCtrl_GetItemCount(GetDlgItem(hwndDlg,IDC_OPTIONSTAB));
- for (i=0; i<count; i++)
- {
- TabCtrl_GetItem(GetDlgItem(hwndDlg,IDC_OPTIONSTAB),i,&tci);
- SendMessage((HWND)tci.lParam,WM_NOTIFY,0,lParam);
- }
- break;
- }
- }
- break;
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
+ odp.hInstance = hinstance;
+ odp.ptszTitle = LPGENT("XFire");
+ odp.ptszGroup = LPGENT("Network");
+ odp.flags = ODPF_BOLDGROUPS| ODPF_TCHAR;
- case IDC_OPTIONSTAB:
- {
- HWND hTabCtrl = GetDlgItem(hwndDlg, IDC_OPTIONSTAB);
-
- switch (((LPNMHDR)lParam)->code)
- {
- case TCN_SELCHANGING:
- {
- TCITEM tci;
-
- tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(hTabCtrl, TabCtrl_GetCurSel(hTabCtrl), &tci);
- ShowWindow((HWND)tci.lParam, SW_HIDE);
- }
- break;
+ odp.pfnDlgProc = DlgProcOpts2;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTLOGIN);
+ odp.ptszTab = LPGENT("Account");
+ Options_AddPage(wParam, &odp);
- case TCN_SELCHANGE:
- {
- TCITEM tci;
+ odp.pfnDlgProc = DlgProcOpts3;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTFEAT);
+ odp.ptszTab = LPGENT("Features");
+ Options_AddPage(wParam, &odp);
- tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(hTabCtrl, TabCtrl_GetCurSel(hTabCtrl), &tci);
- ShowWindow((HWND)tci.lParam,SW_SHOW);
- }
- break;
- }
- break;
- }
- }
- break;
- }
+ odp.pfnDlgProc = DlgProcOpts4;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTFEAT2);
+ odp.ptszTab = LPGENT("Blocklist / Games");
+ Options_AddPage(wParam, &odp);
- return FALSE;
-}
+ odp.pfnDlgProc = DlgProcOpts5;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTFEAT3);
+ odp.ptszTab = LPGENT("StatusMsg");
+ Options_AddPage(wParam, &odp);
-int OptInit(WPARAM wParam,LPARAM lParam)
-{
- OPTIONSDIALOGPAGE odp;
-
- ghwndDlg2=NULL;
-
- ZeroMemory(&odp,sizeof(odp));
- odp.cbSize=sizeof(odp);
- //odp.position=-790000000;
- odp.hInstance=hinstance;
- odp.pszTemplate=MAKEINTRESOURCE(IDD_OPT);
- odp.ptszTitle=_T("XFire");
- odp.ptszGroup = TranslateT("Network");
- odp.flags=ODPF_BOLDGROUPS, ODPF_UNICODE;
- //odp.nIDBottomSimpleControl=IDC_GROUPMAIN;
- odp.pfnDlgProc=DlgProcOpts;
+ odp.pfnDlgProc = DlgProcOpts6;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTFEAT4);
+ odp.ptszTab = LPGENT("Games");
Options_AddPage(wParam, &odp);
return 0;