Jump to content

Plugin UI Alert/Popup/links


Recommended Posts

Posted

@softworkzIs there a way to have a popup/alert from a run command?  EX Press button, do work, then popup or trigger a new tab to open? Or do I need to set a captionitem with like a hidden visibility flag after do work change flag so item shows, then user has to click link, I havent tried but will it render an a tag link?

Posted

@softworkzI was hoping more external site like a true anchor tag. But if I can popup a window with the url for them to click on that can also work.

Posted

I had written this yesterday but forgot to send:

For those kinds of "Do you really wanna do this?" message boxes, there's a Emby SDK Reference: ButtonItem.ConfirmationPrompt property on Emby SDK Reference: EditorTypes.ButtonItem elements. When you set the text, a messagebox will be shown and the command will only be executed when the user confirms.

32 minutes ago, bakes82 said:

@softworkzI was hoping more external site like a true anchor tag. But if I can popup a window with the url for them to click on that can also work.

But now I see you're asking for something different.

Generally, links to external web content should be avoided because it disrupts the operational flow in navigation and many apps (like those being shown on TV screens) either don't have the ability to open browser windows (Android TV OS for example doesn't even have a browser app) or even if they have, you wouldn't be able to navigate back to the Emby app.

But it depends on the plugin purpose. It your UI is only meant to be used from a browser with mouse/keyboard input for doing the configuration, then there's no problem when having links in the UI.

That being said, there are two UI elements which have a Hyperlink property:

In case of the Emby SDK Reference: LabelItem, the text will be shown as a link and the link will be launched in an external window. Whether it's a browser tab or a new browser window is app-specific. In case of the web app, it opens in a new tab.

For the GenericListItem, the whole item will become clickable (color change on hover and mouse cursor changes to link cursor) and the link will cause navigation in the current window (I have a backlog entry for adding a property to enable opening externally). 

For indicating ongoing work, you can use a Emby SDK Reference: StatusItem and set its Emby SDK Reference: StatusItem.Status property to Emby SDK Reference: ItemStatus.InProgress . When the work is done, you can set it to Emby SDK Reference: ItemStatus.Succeeded and set Emby SDK Reference: CaptionItem.IsVisible to true.

Posted

It's been a while since I promised to provide example code for working with dialogs and wizards. I hadn't forgotten, just short on time, but it's done now:

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...