From c09a65cb4153f151ec2eb074614b4ccfe7c22bdb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Mar 2019 17:14:40 +0300 Subject: popups: pascal code cleaning --- plugins/Watrack/myshows/i_myshows_api.inc | 38 +++++++++++++------------------ plugins/Watrack/myshows/i_myshows_opt.inc | 4 +--- 2 files changed, 17 insertions(+), 25 deletions(-) (limited to 'plugins/Watrack/myshows') diff --git a/plugins/Watrack/myshows/i_myshows_api.inc b/plugins/Watrack/myshows/i_myshows_api.inc index 25593311d7..f92df86b50 100644 --- a/plugins/Watrack/myshows/i_myshows_api.inc +++ b/plugins/Watrack/myshows/i_myshows_api.inc @@ -36,10 +36,7 @@ begin end; StrCopyW(StrCopyEW(buf,'MyShows: '),TranslateW(ppc)); - if ServiceExists(MS_POPUP_SHOWMESSAGEW) then - CallService(MS_POPUP_SHOWMESSAGEW,TWPARAM(@buf),SM_WARNING) - else - MessageBoxW(0,@buf,'ERROR',MB_ICONERROR) + PUShowMessage(@buf,SM_WARNING); end; function GetMD5Str(const digest:TMD5Hash; buf:pAnsiChar):PAnsiChar; @@ -199,28 +196,25 @@ begin if SendMSRequest(buf,show) then begin //!! add option to show it?? - if ServiceExists(MS_POPUP_SHOWMESSAGEW) then - begin - jn:=json_get(jroot,'show'); - shId:=json_as_string(json_get(jn,'title')); + jn:=json_get(jroot,'show'); + shId:=json_as_string(json_get(jn,'title')); - jn:=json_get(jn,'episodes'); - jn:=json_get(jn,'episodes'); - pWideChar(epId):=json_as_string(json_get(jn,'title')); + jn:=json_get(jn,'episodes'); + jn:=json_get(jn,'episodes'); + pWideChar(epId):=json_as_string(json_get(jn,'title')); - mGetMem(pc,1024); - StrCopyW( + mGetMem(pc,1024); + StrCopyW( + StrCopyEW( StrCopyEW( StrCopyEW( - StrCopyEW( - StrCopyEW(pWideChar(pc),'Show "'), - shId), - '"'#13#10'episode "'), - pWideChar(epId)), - '" checked'); - CallService(MS_POPUP_SHOWMESSAGEW,TWPARAM(pc),SM_NOTIFY); - mFreeMem(pc); - end; + StrCopyEW(pWideChar(pc),'Show "'), + shId), + '"'#13#10'episode "'), + pWideChar(epId)), + '" checked'); + PUShowMessage(pc,SM_NOTIFY); + mFreeMem(pc); result:=true; end; end; diff --git a/plugins/Watrack/myshows/i_myshows_opt.inc b/plugins/Watrack/myshows/i_myshows_opt.inc index 125d4deda5..c5696771c6 100644 --- a/plugins/Watrack/myshows/i_myshows_opt.inc +++ b/plugins/Watrack/myshows/i_myshows_opt.inc @@ -26,9 +26,7 @@ begin mFreeMem(msh_login ); msh_login :=DBReadString(0,PluginShort,optLogin); mFreeMem(msh_password); msh_password:=DBReadString(0,PluginShort,optPassword); if (msh_login=nil) or (msh_password=nil) then - CallService(MS_POPUP_SHOWMESSAGEW, - WPARAM(TranslateW('Don''t forget to enter Login and Password to use MyShows service')), - SM_WARNING); + PUShowMessageW(TranslateW('Don''t forget to enter Login and Password to use MyShows service'), SM_WARNING); end; procedure FreeOpt; -- cgit v1.2.3