예제 #1
0
        void HandleLinkClicked(QUrl url)
        {
            // We don't open arbitrary links for security reasons.
            var validSchemes = new [] { "http", "https", "ftp", "xmpp" };

            if (validSchemes.Contains(url.Scheme().ToLower()))
            {
                Util.Open(url);
            }
            else if (url.Scheme().ToLower() == "xmpp")
            {
                // FIXME: Add xmpp: uri handler.
                QMessageBox.Information(this.TopLevelWidget(), "Not implenented", "xmpp: uris not yet supported.");

                // Ignore # urls.
            }
            else if (!url.HasFragment())
            {
                QMessageBox.Information(this.TopLevelWidget(), "Link Fragment", url.HasFragment() + " " + url.Fragment());
                QMessageBox.Information(this.TopLevelWidget(), "Link URL", url.ToString());
            }
        }