This question is answered.


Permlink Replies: 6 - Pages: 1 - Last Post: 25 May 23, 14:01 Last Post By: AndreWolff Threads: [ Previous | Next ]
AndreWolff

Posts: 1,300
Registered: 14-Dec-2007
How to display the red triangle in the lower right corner?
Posted: 25 May 23, 09:20
 
  Click to reply to this thread Reply
I display now a warning in the console with code like:
 System.out.println("Warning: You should re-arrange your images …);
but a user will not see this if the console window is not open.

So my question is what code should I add do the see the red triangle in the lower right corner if such a warning is logged?
davidekholm

Posts: 3,348
Registered: 18-Oct-2002
Re: How to display the red triangle in the lower right corner?
Posted: 25 May 23, 11:05   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
I display now a warning in the console with code like:
 System.out.println("Warning: You should re-arrange your images …);
but a user will not see this if the console window is not open.

So my question is what code should I add do the see the red triangle in the lower right corner if such a warning is logged?


Printing to the console should be reserved for more technical use than informing end users about important things. To trigger the red triangle (meaning "technical error" of some kind), use System.err.println).

With this said, I recommend this API:
engine.fireWarning("You should re-arrange your images");
This shows a yellow warning notification to the user. When running jAlbum from the command line, it just prints the warning to the cmd window.

However, engine.fireWarning requires jAlbum 30.3. To make it work on older jAlbum versions, you can use this code:
JNotification n = new JNotification(message, JNotification.Type.WARNING);
n.setPriority(JNotification.Priority.HIGH);
n.setExpiration(6);
window.showNotification(n);

That code runs on all jAlbum versions since v8.9, but assumes that you run jAlbum in windowed mode.
davidekholm

Posts: 3,348
Registered: 18-Oct-2002
Re: How to display the red triangle in the lower right corner?
Posted: 25 May 23, 11:08   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Since v30.3, you can also use engine.fireRequestConfirmation(message) to trigger a warning DIALOG (not notification), having a yes/no option. This makes jAlbum pause and wait for user feedback. If the user cancels the dialog or hits "no", then the album build is aborted. This warning can be disabled under preferences ("Show warning dialogs")
RobM

Posts: 3,727
Registered: 4-Aug-2006
Re: How to display the red triangle in the lower right corner?
Posted: 25 May 23, 11:09   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
It would be better to use the Iterator tag to process objects in the order needed, e.g. nodirs followed by dirs.
davidekholm

Posts: 3,348
Registered: 18-Oct-2002
Re: How to display the red triangle in the lower right corner?
Posted: 25 May 23, 11:10   in response to: RobM in response to: RobM
Correct
  Click to reply to this thread Reply
RobM wrote:
It would be better to use the Iterator tag to process objects in the order needed, e.g. nodirs followed by dirs.

I agree. Anything that can be done programmatically is better than bugging the user about it.
AndreWolff

Posts: 1,300
Registered: 14-Dec-2007
Re: How to display the red triangle in the lower right corner?
Posted: 25 May 23, 13:59   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
To make it work on older jAlbum versions, you can use this code:
JNotification n = new JNotification(message, JNotification.Type.WARNING);
n.setPriority(JNotification.Priority.HIGH);
n.setExpiration(6);
window.showNotification(n);

That code runs on all jAlbum versions since v8.9, but assumes that you run jAlbum in windowed mode.

This works perfect and displays also the red triangle.

Thanks for your help.
AndreWolff

Posts: 1,300
Registered: 14-Dec-2007
Re: How to display the red triangle in the lower right corner?
Posted: 25 May 23, 14:01   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
It would be better to use the Iterator tag to process objects in the order needed, e.g. nodirs followed by dirs.
I do use that, this is only a warning to indicate that the order in the album differs from the order in the Explorer.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums