Example #1
0
        public ServiceBrowserWindow(Account account)
        {
            SetupUi();

            m_Account = account;
            m_HomeUri = new Uri(String.Format("xmpp:{0}?disco", account.Jid.Server));

            this.WindowTitle = String.Format("XMPP Browser - {0}", account.Jid);

            m_BackAction    = new QAction(Gui.LoadIcon("go-previous", 16), "Back", this);
            m_ForwardAction = new QAction(Gui.LoadIcon("go-next", 16), "Forward", this);
            m_ReloadAction  = new QAction(Gui.LoadIcon("view-refresh", 16), "Reload", this);
            m_StopAction    = new QAction(Gui.LoadIcon("process-stop", 16), "Stop", this);
            m_HomeAction    = new QAction(Gui.LoadIcon("go-home", 16), "Home", this);
            m_GoAction      = new QAction("Go", this);

            m_BackAction.Enabled    = false;
            m_ForwardAction.Enabled = false;

            m_StopAction.Visible = false;

            m_Toolbar = new QToolBar(this);
            m_Toolbar.AddAction(m_BackAction);
            m_Toolbar.AddAction(m_ForwardAction);
            m_Toolbar.AddAction(m_ReloadAction);
            m_Toolbar.AddAction(m_StopAction);
            m_Toolbar.AddAction(m_HomeAction);

            m_AddresCombo = new QComboBox(m_Toolbar);
            m_AddresCombo.SetSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed);
            m_AddresCombo.Editable = true;
            m_Toolbar.AddWidget(m_AddresCombo);

            m_Toolbar.AddAction(m_GoAction);

            QObject.Connect <QAction>(m_Toolbar, Qt.SIGNAL("actionTriggered(QAction*)"), HandleToolbarActionTriggered);

            ((QBoxLayout)this.Layout()).InsertWidget(0, m_Toolbar);

            webView.Page().linkDelegationPolicy = QWebPage.LinkDelegationPolicy.DelegateAllLinks;

            RequestUrl(m_HomeUri);

            Gui.CenterWidgetOnScreen(this);
        }