~ubuntu-branches/ubuntu/vivid/mediathekview/vivid

« back to all changes in this revision

Viewing changes to src/mediathek/tool/UrlHyperlinkAction.java

  • Committer: Package Import Robot
  • Author(s): Markus Koschany
  • Date: 2014-10-24 12:49:46 UTC
  • mfrom: (4.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20141024124946-rhnmiwad6apojoxt
Tags: 7.1-1
* Imported Upstream version 7.1.
* Declare compliance with Debian Policy 3.9.6.
* Update VCS-Browser field to new canonical address.
* Update man pages timestamp.
* Update debian/copyright for new release.
* Add README.source.
* Rename modify-ant-build-system.patch to build.patch and update it for 7.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
        }
54
54
    }
55
55
 
56
 
    public static boolean urlOeffnen(JFrame paFrame, String url) throws URISyntaxException {
 
56
    public static void urlOeffnen(JFrame paFrame, String url) throws URISyntaxException {
57
57
        if (Desktop.isDesktopSupported()) {
58
58
            Desktop d = Desktop.getDesktop();
59
59
            try {
60
60
                if (d.isSupported(Desktop.Action.BROWSE)) {
61
61
                    d.browse(new URI(url));
62
 
                    return true;
63
 
                }
 
62
                    return;
 
63
                }
 
64
            } catch (Exception ignored) {
 
65
            }
 
66
            try {
 
67
                String programm = "";
 
68
                if (Daten.mVConfig.get(MVConfig.SYSTEM_URL_OEFFNEN).equals("")) {
 
69
                    String text = "\n Der Browser zum Anzeigen der URL wird nicht gefunden.\n Browser selbst auswählen.";
 
70
                    DialogProgrammOrdnerOeffnen dialog = new DialogProgrammOrdnerOeffnen(paFrame, true, "", "Browser suchen", text);
 
71
                    dialog.setVisible(true);
 
72
                    if (dialog.ok) {
 
73
                        programm = dialog.ziel;
 
74
                    }
 
75
                } else {
 
76
                    programm = Daten.mVConfig.get(MVConfig.SYSTEM_URL_OEFFNEN);
 
77
                }
 
78
                Runtime.getRuntime().exec(programm + " " + url);
 
79
                Daten.mVConfig.add(MVConfig.SYSTEM_URL_OEFFNEN, programm);
 
80
                ListenerMediathekView.notify(ListenerMediathekView.EREIGNIS_PROGRAMM_OEFFNEN, UrlHyperlinkAction.class.getSimpleName());
64
81
            } catch (Exception ex) {
65
 
                try {
66
 
                    String programm = "";
67
 
                    if (Daten.mVConfig.get(MVConfig.SYSTEM_URL_OEFFNEN).equals("")) {
68
 
                        String text = "\n Der Browser zum Anzeigen der URL wird nicht gefunden.\n Browser selbst auswählen.";
69
 
                        DialogProgrammOrdnerOeffnen dialog = new DialogProgrammOrdnerOeffnen(paFrame, true, "", "Browser suchen", text);
70
 
                        dialog.setVisible(true);
71
 
                        if (dialog.ok) {
72
 
                            programm = dialog.ziel;
73
 
                        }
74
 
                    } else {
75
 
                        programm = Daten.mVConfig.get(MVConfig.SYSTEM_URL_OEFFNEN);
76
 
                    }
77
 
                    Runtime.getRuntime().exec(programm + " " + url);
78
 
                    Daten.mVConfig.add(MVConfig.SYSTEM_URL_OEFFNEN, programm);
79
 
                    ListenerMediathekView.notify(ListenerMediathekView.EREIGNIS_PROGRAMM_OEFFNEN, UrlHyperlinkAction.class.getSimpleName());
80
 
                } catch (Exception eex) {
81
 
                    Daten.mVConfig.add(MVConfig.SYSTEM_URL_OEFFNEN, ""); // dann wars wohl nix
82
 
                    Log.fehlerMeldung(316497658, Log.FEHLER_ART_PROG, UrlHyperlinkAction.class.getName(), eex, "URL öffnen: " + url);
83
 
                }
 
82
                Daten.mVConfig.add(MVConfig.SYSTEM_URL_OEFFNEN, ""); // dann wars wohl nix
 
83
                Log.fehlerMeldung(316497658, UrlHyperlinkAction.class.getName(), ex, "URL öffnen: " + url);
84
84
            }
85
85
        }
86
 
        return false;
87
86
    }
88
87
}