示例#1
0
        public void TestFromStringList()
        {
            using (var url = QUrl.FromUserInput("qt-project.org"))
            {
            }

            // TODO
        }
示例#2
0
        public void TestMatches()
        {
            using (var n = new QUrl("ftp://*****:*****@ftp.example.com:2021?58#question13"))
            {
            }

            throw new AssertionException("Not implemented!");
        }
示例#3
0
        public void TestResolved()
        {
            var baseUrl     = new QUrl("http://qt.digia.com/Support/");
            var relativeUrl = new QUrl("../Product/Library/");

            var res = baseUrl.Resolved(relativeUrl);

            Assert.AreEqual("http://qt.digia.com/Product/Library/", res.ToString());
        }
示例#4
0
 public void TestCopyConstructor()
 {
     using (var s = new QUrl(Url2))
     {
         using (new QUrl(s))
         {
         }
     }
 }
示例#5
0
 public void TestCopyConstructor()
 {
     using (var s = new QUrl(Url2))
     {
         using (new QUrl(s))
         {
         }
     }
 }
示例#6
0
        public void TestSetFragment()
        {
            var baseUrl = new QUrl();

            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");

            Assert.AreEqual("#question13", baseUrl.Fragment());
        }
示例#7
0
 void on_textBrowser_anchorClicked(QUrl link)
 {
     if (link.ToString() == "#message-eric")
     {
         var account = Gui.ShowAccountSelectMenu(null);
         if (account != null)
         {
             Gui.TabbedChatsWindow.StartChat(account, new jabber.JID("*****@*****.**"));
         }
     }
 }
示例#8
0
        public void TestSetPath()
        {
            var baseUrl = new QUrl();

            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetPassword("5uQQo_f2");
            baseUrl.SetPath("/pub/something/");

            Assert.AreEqual("/pub/something/", baseUrl.Path());
        }
示例#9
0
        public void TestTopLevelDomain()
        {
            var baseUrl = new QUrl();

            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserName("tray2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            Assert.AreEqual(".com", baseUrl.TopLevelDomain());
        }
示例#10
0
        public void TestUrl()
        {
            var baseUrl = new QUrl();

            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserName("tray2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            throw new AssertionException("Url() not implemented!");
            //Assert.AreEqual(".com", baseUrl.Url());
        }
示例#11
0
        void HandleActivityLinkClicked(QUrl url)
        {
            try {
                Uri uri = new Uri(url.ToString());
                if (uri.Scheme == "http" || uri.Scheme == "https")
                {
                    Util.Open(uri.ToString());
                }
                else
                {
                    if (uri.Scheme == "xmpp")
                    {
                        JID jid   = new JID(uri.AbsolutePath);
                        var query = XmppUriQueryInfo.ParseQuery(uri.Query);
                        switch (query.QueryType)
                        {
                        case "message":
                            // FIXME: Should not ask which account to use, should use whichever account generated the event.
                            var account = Gui.ShowAccountSelectMenu(this);
                            if (account != null)
                            {
                                Gui.TabbedChatsWindow.StartChat(account, jid);
                            }
                            break;

                        default:
                            throw new NotSupportedException("Unsupported query type: " + query.QueryType);
                        }
                    }
                    else if (uri.Scheme == "activity-item")
                    {
                        string itemId = uri.AbsolutePath;
                        string action = uri.Query.Substring(1);
                        m_ActivityFeedItems[itemId].TriggerAction(action);
                    }
                }
            } catch (Exception ex) {
                Console.Error.WriteLine(ex);
                QMessageBox.Critical(null, "Synapse Error", ex.Message);
            }
        }
示例#12
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());
            }
        }
示例#13
0
        public void TestNotEqualOperator()
        {
            var n = new QUrl(Url);

            Assert.IsFalse(n != _qUrl);
        }
示例#14
0
 /// <remarks>
 ///  Creates a MediaSource object for a URL.
 ///  \param url URL to a media file or stream.
 ///          </remarks>        <short>    Creates a MediaSource object for a URL.</short>
 public MediaSource(QUrl url) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("MediaSource#", "MediaSource(const QUrl&)", typeof(void), typeof(QUrl), url);
 }
示例#15
0
        public void TestMatches()
        {
            var n = new QUrl("ftp://*****:*****@ftp.example.com:2021?58#question13");

            throw new AssertionException("Not implemented!");
        }
示例#16
0
        public void TestUrl()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserName("tray2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            throw new AssertionException("Url() not implemented!");
            //Assert.AreEqual(".com", baseUrl.Url());
        }
示例#17
0
        public void TestFromLocalFile()
        {
            var u = QUrl.FromLocalFile("//servername/path/to/file.txt");

            Assert.AreEqual("file.txt", u.FileName());
        }
示例#18
0
 public void Init()
 {
     this.qUrl = new QUrl(Url);
 }
示例#19
0
 public void TestStringTolerantConstructor()
 {
     var s = new QUrl("http://www.example.com/List of holidays.xml");
 }
示例#20
0
 public void TestEmpyConstructor()
 {
     var s = new QUrl();
 }
示例#21
0
        public void TestSetPassword()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetPassword("5uQQo_f2");

            Assert.AreEqual("5uQQo_f2", baseUrl.Password());
        }
示例#22
0
 public void TestEmpyConstructor()
 {
     var s = new QUrl();
 }
示例#23
0
 public void Init()
 {
     // TODO: Add Init code.
     _qUrl = new QUrl(Url);
 }
示例#24
0
 public void TestStringTolerantConstructor()
 {
     var s = new QUrl("http://www.example.com/List of holidays.xml");
 }
示例#25
0
 public void TestStringDecodedConstructor()
 {
     var s = new QUrl("http://www.example.com/List of holidays.xml", QUrl.ParsingMode.DecodedMode);
 }
示例#26
0
        public void TestIsLocalFile()
        {
            var u = QUrl.FromLocalFile("//servername/path/to/file.txt");

            Assert.IsTrue(u.IsLocalFile);
        }
示例#27
0
        public void TestResolved()
        {
            var baseUrl = new QUrl("http://qt.digia.com/Support/");
            var relativeUrl = new QUrl("../Product/Library/");

            var res = baseUrl.Resolved(relativeUrl);

            Assert.AreEqual("http://qt.digia.com/Product/Library/", res.ToString());
        }
示例#28
0
        public void TestSetUserInfo()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserInfo("tray2:5uQQo_f2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            Assert.AreEqual("tray2", baseUrl.UserName());
            Assert.AreEqual("5uQQo_f2", baseUrl.Password());
            Assert.AreEqual("tray2:5uQQo_f2", baseUrl.UserInfo());
        }
示例#29
0
 public void Init()
 {
     // TODO: Add Init code.
     _qUrl = new QUrl(Url);
 }
示例#30
0
        public void TestCopyConstructor()
        {
            var s = new QUrl("http://www.example.com/List of holidays.xml");

            var n = new QUrl(s);
        }
示例#31
0
        public void TestSetQuery2()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetPassword("5uQQo_f2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetQuery(new QUrlQuery("new"));

            Assert.AreEqual("new", baseUrl.Query());
        }
示例#32
0
        public void TestNotEqualOperator()
        {
            var n = new QUrl(Url);

            Assert.IsFalse(n != this.qUrl);
        }
示例#33
0
 public void TestStringStrictConstructor()
 {
     var s = new QUrl("http://www.example.com/List of holidays.xml", QUrl.ParsingMode.StrictMode);
 }
示例#34
0
        public void TestEqualWithQUrlOperator()
        {
            QUrl n = this.qUrl;

            //Assert.IsFalse(n != _qUrl);
        }
示例#35
0
        public void TestTopLevelDomain()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserName("tray2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            Assert.AreEqual(".com", baseUrl.TopLevelDomain());
        }
示例#36
0
 public void Init()
 {
     this.qUrl = new QUrl(Url);
 }
示例#37
0
        public void TestCopyConstructor()
        {
            var s = new QUrl("http://www.example.com/List of holidays.xml");

            var n = new QUrl(s);
        }
示例#38
0
        public void TestEqualOperator()
        {
            var n = new QUrl(Url);

            Assert.AreEqual(n, this.qUrl);
        }
示例#39
0
        public void TestEqualOperator()
        {
            var n = new QUrl(Url);

            Assert.AreEqual(n, _qUrl);
        }
示例#40
0
 void on_webView_linkClicked(QUrl url)
 {
     RequestUrl(new Uri(url.ToString()));
 }