Jump to content

function RemoveFavorite(ID: Integer): WordBool;


Recommended Posts

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
 

Link to comment

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.

:bye:

 

 

 

 

Edited by majstang
Link to comment

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 by Marc32
Link to comment

Huh:unsure:

 

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 by majstang
Link to comment

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 by Marc32
Link to comment

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 

 

 

 

Link to comment
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 by majstang
Link to comment

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 by Marc32
Link to comment

You can try this (pseudocode) to get the ID:

IFavoritesManager.GetFavorites().Item(1).Nr() 

 

 

Edited by nuts
Link to comment
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?

Link to comment

thank you, griga.

 

no need, ill wait for it. just want to sync the greenbutton favorites with the DVBViewer favs.

 

marc

Link to comment

"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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...