Skip to content

Commit

Permalink
Fix MitgliedVCardQRCodeAction ESC Handling (#119)
Browse files Browse the repository at this point in the history
Beim Beenden des Dialogs mit ESC wird eine Fehlermeldung ausgegeben, das sollte nicht sein.
  • Loading branch information
JohannMaierhofer authored Jan 24, 2024
1 parent 641aaf2 commit fa0666d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/de/jost_net/JVerein/gui/action/MitgliedVCardQRCodeAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import de.willuhn.jameica.gui.Action;
import de.willuhn.jameica.gui.GUI;
import de.willuhn.jameica.gui.dialogs.AbstractDialog;
import de.willuhn.jameica.system.OperationCanceledException;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;
import ezvcard.Ezvcard;
Expand All @@ -52,8 +53,7 @@ public void handleAction(Object context) throws ApplicationException
{
ArrayList<Mitglied> mitgl = new ArrayList<>();
mitgl.add((Mitglied) context);
try
{

String qrCodeData = Ezvcard.write(VCardTool.getVCards(mitgl))
.version(VCardVersion.V3_0).go();
String charset = "UTF-8"; // or "ISO-8859-1"
Expand All @@ -68,23 +68,20 @@ public void handleAction(Object context) throws ApplicationException
QRCodeImageDialog dia = new QRCodeImageDialog(
AbstractDialog.POSITION_MOUSE, bi);
dia.open();

}
catch (Exception re)
{
Logger.error("Fehler", re);
GUI.getStatusBar().setErrorText(re.getMessage());
throw new ApplicationException(re);
}
}
else
{
throw new ApplicationException("Kein Mitglied ausgewählt");
}
}
catch (OperationCanceledException oce)
{
throw oce;
}
catch (Exception e)
{
throw new ApplicationException("Fehler: " + e.getLocalizedMessage());
Logger.error("Fehler", e);
GUI.getStatusBar().setErrorText("Fehler beim Generieren des QR Codes");
}
}
}

0 comments on commit fa0666d

Please sign in to comment.