Marc32 Posted May 23, 2017 Posted May 23, 2017 function RemoveFavorite(ID: Integer): WordBool; Does it work for somebody? Set DVBViewer = GetObject(, "DVBViewerServer.DVBViewer")DVBViewer.FavoritesManager.RemoveFavorite(1) 'should remove fav nr1 greetings, marc Quote
majstang Posted May 23, 2017 Posted May 23, 2017 (edited) Greetings @Marc32 Its not broken. It worked for me when enclosing the ID number in quotes: iDVBViewer := ComObjActive("DVBViewerServer.DVBViewer") iDVBViewer.FavoritesManager.Add(1, Boxer) ;adds fav nr1 provided its not added to favourites list already iDVBViewer.FavoritesManager.RemoveFavorite("1") ;removes fav nr1 Dont know why the IDispatch interface only acccept ID number as a string all of a sudden, but I would imagine the "WordBool" term means that string it should be. Edited May 23, 2017 by majstang Quote
Marc32 Posted May 23, 2017 Author Posted May 23, 2017 (edited) hmm, too early happy adding is no problem, removing doesnt work for me Set DVBViewer = GetObject(, "DVBViewerServer.DVBViewer")DVBViewer.FavoritesManager.RemoveFavorite("1") 'not working for me pls try vbscript greetings, marc Edited May 23, 2017 by Marc32 Quote
majstang Posted May 23, 2017 Posted May 23, 2017 (edited) Huh Testing enclosing with double quotes using VBScript it does remove a favourite but only the highlighted item (if you highlight a favourite at the Channel List Editor favourites pane before executing the call). Not what the actual ID number says. Hmm...im not very familiar with VBScript and maybe it uses some other chars (besides double quotes in AHK) to differentiate between a string and a variable? Single quotation marks are used to commenting stuff in VBScript so that doesnt work. EDIT: No you are right, its the same behaviour with AHK only the highlighted favourite gets removed (i didnt notice it in previous testing). RemoveFavorite seems to be busted. Edited May 23, 2017 by majstang Quote
Marc32 Posted May 23, 2017 Author Posted May 23, 2017 (edited) haha, you are right. it removes the highlighted favorite, no matter what favnumber you choose. it did not work for me, because i highlighted nothing. its buggy, griga, pls take over.:) Edited May 23, 2017 by Marc32 Quote
nuts Posted May 23, 2017 Posted May 23, 2017 Can't not test it atm but are you sure the ID of fav nr.1 = 1? DVBViewer.FavoritesManager.RemoveFavorite(1) 'should remove fav nr1 Quote
majstang Posted May 23, 2017 Posted May 23, 2017 (edited) 8 minutes ago, nuts said: Can't not test it atm but are you sure the ID of fav nr.1 = 1? DVBViewer.FavoritesManager.RemoveFavorite(1) 'should remove fav nr1 In my case channel 0 is the first favourite. This might work better if applying the 1 based channel position tweak, but will leave that testing for Marc32 Im almost sure these COM problems are due to those tweaks/handling. Edited May 23, 2017 by majstang Quote
Marc32 Posted May 23, 2017 Author Posted May 23, 2017 (edited) hi, the favnumber doesnt matters. 0,1,5 or 30, same result,just the highlighted favorite will be removed. if you highlighted none, nothing will be removed. btw. it doesnt matter if you enclosing with double qoutes or not, same result as described above. strange behavior.:) Edited May 23, 2017 by Marc32 Quote
nuts Posted May 23, 2017 Posted May 23, 2017 (edited) You can try this (pseudocode) to get the ID: IFavoritesManager.GetFavorites().Item(1).Nr() Edited May 23, 2017 by nuts Quote
Griga Posted May 23, 2017 Posted May 23, 2017 54 minutes ago, majstang said: Testing enclosing with double quotes using VBScript it does remove a favourite but only the highlighted item (if you highlight a favourite at the Channel List Editor favourites pane before executing the call). Not what the actual ID number says. Confirmed. It is a bug in DVBViewer caused by the necessity to synchronize the various favourites list representations in the UI with the change. DVBViewer focuses the to be removed favourite in the channel editor and then triggers deletion of this item, which in return triggers a kind of "update yourself" broadcast for all UI elements showing favourites. However, deletion refers to the selected item, not to the focused one So it must also be selected, not only focused. Will be fixed in the next release. Is there any need for a test version? Quote
Marc32 Posted May 23, 2017 Author Posted May 23, 2017 thank you, griga. no need, ill wait for it. just want to sync the greenbutton favorites with the DVBViewer favs. marc Quote
Marc32 Posted May 23, 2017 Author Posted May 23, 2017 "which in return triggers a kind of "update yourself" broadcast for all UI elements showing favourites" btw. a command to do exactly this is hardly missed. i have nothing found in the sdk. i there any chance to implement this? marc Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.