示例#1
0
        public NoAccountsWidget(QWidget parent) : base(parent)
        {
            SetupUi();

            m_Scene = new QGraphicsScene(m_Scene);
            m_GraphicsView.SetScene(m_Scene);
            m_Scene.SetSceneRect(0, 0, 200, 200);

            var octy = new QGraphicsPixmapItem(new QPixmap("resource:/octy.png"));

            octy.SetPos(0, 10);
            m_Scene.AddItem(octy);

            // TODO: Add bubbles!

            m_TimeLine            = new QTimeLine(2000, m_Scene);
            m_TimeLine.curveShape = QTimeLine.CurveShape.EaseOutCurve;
            QObject.Connect(m_TimeLine, Qt.SIGNAL("finished()"), HandleTimerFinished);

            QGraphicsItemAnimation animation = new QGraphicsItemAnimation(m_Scene);

            animation.SetItem(octy);
            animation.SetTimeLine(m_TimeLine);
            animation.SetPosAt(1, new QPointF(0, 0));

            m_TimeLine.Start();
        }
示例#2
0
        public ViewOnTwitterAction(QWidget parent) : base(parent)
        {
            base.Text = "View on Twitter";
            base.icon = new QIcon(new QPixmap("resource:/twitter/twitm-16.png"));

            QObject.Connect <bool>(this, Qt.SIGNAL("triggered(bool)"), HandleTriggered);
        }
示例#3
0
        public AvatarGrid(QWidget parent) : base(parent)
        {
            // FIXME: Need a preference to turn this on/off.
            // this.SetViewport(new QGLWidget());

            m_Scene = new AvatarGridScene(this);
            this.SetScene(m_Scene);

            m_InfoPopup = new InfoPopup <T>(this);
            m_InfoPopup.DoubleClicked += delegate {
                MouseDoubleClickEvent(null);
            };
            m_InfoPopup.RightClicked += delegate(QPoint pos) {
                Emit.CustomContextMenuRequested(this.MapFromGlobal(pos));
            };
            m_InfoPopup.MouseMoved += delegate {
                UpdateHoverItem();
            };

            m_TooltipTimer            = new QTimer(this);
            m_TooltipTimer.SingleShot = true;
            m_TooltipTimer.Interval   = 500;
            QObject.Connect(m_TooltipTimer, Qt.SIGNAL("timeout()"), HandleTooltipTimerTimeout);

            this.AcceptDrops = true;
        }
示例#4
0
        public AboutDialog(QWidget parentWindow) : base(parentWindow)
        {
            SetupUi();

            m_Scene = new QGraphicsScene(m_Scene);
            graphicsView.SetScene(m_Scene);
            m_Scene.SetSceneRect(0, 0, 200, 200);

            textLabel.Pixmap = new QPixmap("resource:/text.png");

            var octy = new QGraphicsPixmapItem(new QPixmap("resource:/octy.png"));

            octy.SetPos(0, 10);
            m_Scene.AddItem(octy);

            m_TimeLine            = new QTimeLine(2000, m_Scene);
            m_TimeLine.curveShape = QTimeLine.CurveShape.EaseOutCurve;
            QObject.Connect(m_TimeLine, Qt.SIGNAL("finished()"), TimerFinished);

            QGraphicsItemAnimation animation = new QGraphicsItemAnimation(m_Scene);

            animation.SetItem(octy);
            animation.SetTimeLine(m_TimeLine);
            animation.SetPosAt(1, new QPointF(0, 0));

            m_TimeLine.Start();

            Gui.CenterWidgetOnScreen(this);
        }
示例#5
0
        public InsertSnippetAction(QWidget parent) : base(parent)
        {
            m_ChatWindow = (ChatWindow)parent;

            QObject.Connect <bool>(this, Qt.SIGNAL("triggered(bool)"), HandleOnTriggered);

            base.Text = "Code Snippet...";
            base.icon = new QIcon(new QPixmap("resource:/codesnippets/insert-code.png"));
        }
示例#6
0
            public AvatarProviderTab(IAvatarProvider provider, QWidget parent) : base(parent)
            {
                m_Provider = provider;

                QObject.Connect(base.Page().MainFrame(), Qt.SIGNAL("javaScriptWindowObjectCleared()"), delegate {
                    base.Page().MainFrame().AddToJavaScriptWindowObject("AvatarSelectDialog", parent.TopLevelWidget());
                });

                base.SetHtml(String.Empty);
            }
示例#7
0
        public AddOctyDialog()
        {
            SetupUi();

            QObject.Connect(webView.Page().MainFrame(), Qt.SIGNAL("javaScriptWindowObjectCleared()"), HandleJavaScriptWindowObjectCleared);
            webView.Page().linkDelegationPolicy = QWebPage.LinkDelegationPolicy.DelegateAllLinks;
            webView.Load("resource:/addocty.html");

            Gui.CenterWidgetOnScreen(this);
        }
示例#8
0
        protected void SetupUi()
        {
            base.ObjectName  = "AboutDialog";
            this.Geometry    = new QRect(0, 0, 384, 492);
            this.MinimumSize = new QSize(384, 0);
            this.WindowTitle = "About Synapse";
            this.StyleSheet  = "#AboutDialog {\n\tmax-width: 384px;\n\tbackground: #010409 url(resource:/oceanbg.png) no-repeat top center;\n}\n\nQWidget {\n\tcolor: white;\n}\n\nQGraphicsView, QTextBrowser {\n\tbackground: transparent;\n}\n\nQPushButton[flat=\"false\"] {\n\tborder: 1px solid #2B2D31;\n\tborder-radius: 3px;\n\tbackground-color: #2B2D31;\n\tpadding: 3px;\n}\n\n#textLabel {\n\tmargin-bottom: 12px;\n}\n\nQScrollBar:vertical {\n\tborder: 0px;\n\tbackground: transparent;\n\twidth: 15px;\n\tmargin: 0px;\n}\n\nQScrollBar::handle:vertical {\n\tbackground: #4F4F4F;\n\tmin-height: 20px;\n\tborder: 1px solid #4F4F4F;\n\tborder-radius: 5px;\n}\n\nQScrollBar::add-line:vertical {\n\theight: 0px;\n\tborder: 0px;\n}\n\nQScrollBar::sub-line:vertical {\n\theight: 0px;\n}\n\nQScrollBar::add-page:vertical, \nQScrollBar::sub-page:vertical {\n\tbackground: none;\n}";
            QVBoxLayout verticalLayout;

            verticalLayout         = new QVBoxLayout(this);
            verticalLayout.Spacing = 6;
            verticalLayout.Margin  = 6;
            this.widget            = new QWidget(this);
            this.widget.ObjectName = "widget";
            QHBoxLayout horizontalLayout;

            horizontalLayout              = new QHBoxLayout(this.widget);
            horizontalLayout.Margin       = 0;
            this.graphicsView             = new QGraphicsView(this.widget);
            this.graphicsView.ObjectName  = "graphicsView";
            this.graphicsView.MinimumSize = new QSize(0, 250);
            this.graphicsView.FrameShape  = QFrame.Shape.NoFrame;
            horizontalLayout.AddWidget(this.graphicsView);
            verticalLayout.AddWidget(this.widget);
            this.textLabel            = new QLabel(this);
            this.textLabel.ObjectName = "textLabel";
            this.textLabel.Text       = "";
            this.textLabel.Alignment  = global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignCenter");
            verticalLayout.AddWidget(this.textLabel);
            this.textBrowser             = new QTextBrowser(this);
            this.textBrowser.ObjectName  = "textBrowser";
            this.textBrowser.MaximumSize = new QSize(16777215, 120);
            this.textBrowser.FrameShape  = QFrame.Shape.NoFrame;
            this.textBrowser.FrameShadow = QFrame.Shadow.Plain;
            this.textBrowser.Html        = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Bitstream Vera Sans'; font-size:9pt; font-weight:400; font-style:normal;\">\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Created By</span></p>\n<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"><a href=\"#message-eric\"><span style=\" font-weight:400; text-decoration: underline; color:#ffffff;\">Eric Butler</span></a></p>\n<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Special Thanks To</span></p>\n<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"><span style=\" font-weight:400;\">Chris Hergert</span></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Allison Hughes</p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Arno Rehn</p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Darryl Ring</p></body></html>";
            verticalLayout.AddWidget(this.textBrowser);
            QHBoxLayout horizontalLayout_2;

            horizontalLayout_2 = new QHBoxLayout();
            verticalLayout.AddLayout(horizontalLayout_2);
            this.sendFeedbackButton            = new QPushButton(this);
            this.sendFeedbackButton.ObjectName = "sendFeedbackButton";
            this.sendFeedbackButton.Text       = "Send Feedback";
            horizontalLayout_2.AddWidget(this.sendFeedbackButton);
            this.buttonBox                 = new QDialogButtonBox(this);
            this.buttonBox.ObjectName      = "buttonBox";
            this.buttonBox.Orientation     = Qt.Orientation.Horizontal;
            this.buttonBox.StandardButtons = global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Close");
            horizontalLayout_2.AddWidget(this.buttonBox);
            QObject.Connect(buttonBox, Qt.SIGNAL("rejected()"), this, Qt.SLOT("reject()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("accepted()"),this,Qt.SLOT("accept()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("accepted()"),this,Qt.SLOT("accept()"));
            QMetaObject.ConnectSlotsByName(this);
        }
示例#9
0
        public void SetupUi(QWidget LifetimeConstraintWidget)
        {
            if (LifetimeConstraintWidget.ObjectName == "")
            {
                LifetimeConstraintWidget.ObjectName = "LifetimeConstraintWidget";
            }
            QSize Size = new QSize(283, 48);

            Size = Size.ExpandedTo(LifetimeConstraintWidget.MinimumSizeHint);
            LifetimeConstraintWidget.Size = Size;
            horizontalLayout = new QHBoxLayout(LifetimeConstraintWidget);
            horizontalLayout.SetContentsMargins(0, 0, 0, 0);
            horizontalLayout.ObjectName     = "horizontalLayout";
            horizontalLayout.sizeConstraint = QLayout.SizeConstraint.SetNoConstraint;
            mCheckBox            = new QCheckBox(LifetimeConstraintWidget);
            mCheckBox.ObjectName = "mCheckBox";
            QSizePolicy sizePolicy = new QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed);

            sizePolicy.SetHorizontalStretch(0);
            sizePolicy.SetVerticalStretch(0);
            sizePolicy.SetHeightForWidth(mCheckBox.SizePolicy.HasHeightForWidth);
            mCheckBox.SizePolicy = sizePolicy;

            horizontalLayout.AddWidget(mCheckBox);

            mLineEdit            = new QLineEdit(LifetimeConstraintWidget);
            mLineEdit.ObjectName = "mLineEdit";
            mLineEdit.Enabled    = false;
            sizePolicy.SetHeightForWidth(mLineEdit.SizePolicy.HasHeightForWidth);
            mLineEdit.SizePolicy       = sizePolicy;
            mLineEdit.MaximumSize      = new QSize(40, 16777215);
            mLineEdit.InputMethodHints = Qt.InputMethodHint.ImhPreferNumbers;

            horizontalLayout.AddWidget(mLineEdit);

            mSecondsLable            = new QLabel(LifetimeConstraintWidget);
            mSecondsLable.ObjectName = "mSecondsLable";
            mSecondsLable.Enabled    = false;

            horizontalLayout.AddWidget(mSecondsLable);

            spacerItem = new QSpacerItem(90, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);

            horizontalLayout.AddItem(spacerItem);


            RetranslateUi(LifetimeConstraintWidget);
            QObject.Connect(mCheckBox, Qt.SIGNAL("toggled(bool)"), mLineEdit, Qt.SLOT("setEnabled(bool)"));
            QObject.Connect(mCheckBox,Qt.SIGNAL("toggled(bool)"),mSecondsLable,Qt.SLOT("setEnabled(bool)"));
            QObject.Connect(mCheckBox,Qt.SIGNAL("toggled(bool)"),mLineEdit,Qt.SLOT("setFocus()"));

            QMetaObject.ConnectSlotsByName(LifetimeConstraintWidget);
        } // SetupUi
示例#10
0
        public AvatarGridZoomAction(AvatarGrid <T> grid) : base(grid)
        {
            m_Grid            = grid;
            m_SliderContainer = new QWidget();
            m_SliderContainer.SetLayout(new QHBoxLayout());
            m_SliderContainer.Layout().AddWidget(new QLabel("Zoom:", m_SliderContainer));
            var zoomSlider = new QSlider(Orientation.Horizontal, m_SliderContainer);

            zoomSlider.Minimum = 16;
            zoomSlider.Maximum = 60;
            zoomSlider.Value   = m_Grid.IconSize;
            QObject.Connect <int>(zoomSlider, Qt.SIGNAL("valueChanged(int)"), HandleZoomSliderValueChanged);
            m_SliderContainer.Layout().AddWidget(zoomSlider);

            base.SetDefaultWidget(m_SliderContainer);
        }
示例#11
0
        public AddAccountDialog()
        {
            SetupUi();

            var forwardButton = new QPushButton(Gui.LoadIcon("forward"), "&Forward");

            QObject.Connect(forwardButton, Qt.SIGNAL("clicked()"), HandleForwardButtonClicked);
            buttonBox.AddButton(forwardButton, QDialogButtonBox.ButtonRole.AcceptRole);

            buttonBox_2.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel;
            var addAccountButton = buttonBox_2.Button(QDialogButtonBox.StandardButton.Ok);

            QObject.Connect(addAccountButton, Qt.SIGNAL("clicked()"), HandleAddAccountButtonClicked);
            addAccountButton.Text = "&Add Account";

            Gui.CenterWidgetOnScreen(this);
        }
示例#12
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);
        }
示例#13
0
        public InsertSnippetDialog(QWidget parent) : base(parent)
        {
            SetupUi();

            buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel;

            ChatWindow chatWindow = (ChatWindow)parent;

            toLabel.Text = (chatWindow.Handler is ChatHandler) ? ((ChatHandler)chatWindow.Handler).Jid.ToString() : ((MucHandler)chatWindow.Handler).Room.JID.ToString();

            var service = ServiceManager.Get <CodeSnippetsService>();

            foreach (var highlighter in service.Highlighters)
            {
                typeComboBox.AddItem(highlighter.FullName, highlighter.Name);
            }

            QObject.Connect(this, Qt.SIGNAL("accepted()"), HandleDialogAccepted);

            Gui.CenterWidgetOnScreen(this);
        }
        public void SetupUi(QDialog PassphraseDialog)
        {
            if (PassphraseDialog.ObjectName == "")
            {
                PassphraseDialog.ObjectName = "PassphraseDialog";
            }
            QSize Size = new QSize(493, 118);

            Size = Size.ExpandedTo(PassphraseDialog.MinimumSizeHint);
            PassphraseDialog.Size     = Size;
            verticalLayout            = new QVBoxLayout(PassphraseDialog);
            verticalLayout.ObjectName = "verticalLayout";
            mMessageLabel             = new QLabel(PassphraseDialog);
            mMessageLabel.ObjectName  = "mMessageLabel";

            verticalLayout.AddWidget(mMessageLabel, 0, Qt.AlignmentFlag.AlignHCenter);

            mPassphraseLineEdit            = new QLineEdit(PassphraseDialog);
            mPassphraseLineEdit.ObjectName = "mPassphraseLineEdit";
            mPassphraseLineEdit.echoMode   = QLineEdit.EchoMode.Password;

            verticalLayout.AddWidget(mPassphraseLineEdit);

            mButtonBox                 = new QDialogButtonBox(PassphraseDialog);
            mButtonBox.ObjectName      = "mButtonBox";
            mButtonBox.Orientation     = Qt.Orientation.Horizontal;
            mButtonBox.StandardButtons = QDialogButtonBox.StandardButton.Cancel | QDialogButtonBox.StandardButton.Ok;

            verticalLayout.AddWidget(mButtonBox);


            RetranslateUi(PassphraseDialog);
            QObject.Connect(mButtonBox, Qt.SIGNAL("accepted()"), PassphraseDialog, Qt.SLOT("accept()"));
            QObject.Connect(mButtonBox,Qt.SIGNAL("rejected()"),PassphraseDialog,Qt.SLOT("reject()"));

            QMetaObject.ConnectSlotsByName(PassphraseDialog);
        } // SetupUi
示例#15
0
        public TrayIcon(QObject parent) : base(parent)
        {
            m_ShowMainWindowAction           = new QAction("Show Synapse", this);
            m_ShowMainWindowAction.Checkable = true;
            QObject.Connect(m_ShowMainWindowAction,  Qt.SIGNAL("triggered()"), HandleShowMainWindowActionTriggered);

            m_ShowDebugWindowAction           = new QAction("Debug Window", this);
            m_ShowDebugWindowAction.Checkable = true;
            QObject.Connect(m_ShowDebugWindowAction,  Qt.SIGNAL("triggered()"), HandleShowDebugWindowActionTriggered);

            m_Menu = new QMenu();
            m_Menu.AddAction(m_ShowMainWindowAction);
            m_Menu.AddAction(m_ShowDebugWindowAction);
            m_Menu.AddSeparator();
            m_Menu.AddAction(Gui.GlobalActions.NewMessageAction);
            m_Menu.AddAction(Gui.GlobalActions.JoinConferenceAction);
            m_Menu.AddAction(Gui.GlobalActions.ShowBrowserAction);
            m_Menu.AddAction(Gui.GlobalActions.EditProfileAction);
            m_Menu.AddAction(Gui.GlobalActions.ChangeStatusAction);
            m_Menu.AddSeparator();
            m_Menu.AddAction(Gui.GlobalActions.ShowPreferencesAction);
            m_Menu.AddSeparator();
            m_Menu.AddAction(Gui.GlobalActions.AboutAction);
            m_Menu.AddAction(Gui.GlobalActions.SendFeedbackAction);
            m_Menu.AddSeparator();
            m_Menu.AddAction(Gui.GlobalActions.QuitAction);
            QObject.Connect(m_Menu, Qt.SIGNAL("aboutToShow()"), HandleMenuAboutToShow);

            QPixmap pixmap = new QPixmap("resource:/octy-22.png");
            QIcon   icon   = new QIcon(pixmap);

            m_Icon = new QSystemTrayIcon(icon);
            m_Icon.SetContextMenu(m_Menu);

            QObject.Connect <QSystemTrayIcon.ActivationReason>(m_Icon, Qt.SIGNAL("activated(QSystemTrayIcon::ActivationReason)"), HandleTrayActivated);
        }
示例#16
0
        protected void SetupUi()
        {
            base.ObjectName  = "InsertLinkDialog";
            this.Geometry    = new QRect(0, 0, 287, 110);
            this.WindowTitle = "Insert Link";
            QVBoxLayout verticalLayout;

            verticalLayout        = new QVBoxLayout(this);
            verticalLayout.Margin = 6;
            QFormLayout formLayout;

            formLayout = new QFormLayout();
            verticalLayout.AddLayout(formLayout);
            this.label_2            = new QLabel(this);
            this.label_2.ObjectName = "label_2";
            this.label_2.Text       = "URL:";
            formLayout.SetWidget(0, QFormLayout.ItemRole.LabelRole, this.label_2);
            this.urlLineEdit            = new QLineEdit(this);
            this.urlLineEdit.ObjectName = "urlLineEdit";
            formLayout.SetWidget(0, QFormLayout.ItemRole.FieldRole, this.urlLineEdit);
            this.label            = new QLabel(this);
            this.label.ObjectName = "label";
            this.label.Text       = "Text:";
            formLayout.SetWidget(1, QFormLayout.ItemRole.LabelRole, this.label);
            this.textLineEdit            = new QLineEdit(this);
            this.textLineEdit.ObjectName = "textLineEdit";
            formLayout.SetWidget(1, QFormLayout.ItemRole.FieldRole, this.textLineEdit);
            this.buttonBox                 = new QDialogButtonBox(this);
            this.buttonBox.ObjectName      = "buttonBox";
            this.buttonBox.Orientation     = Qt.Orientation.Horizontal;
            this.buttonBox.StandardButtons = (global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Cancel") | global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Ok"));
            verticalLayout.AddWidget(this.buttonBox);
            QObject.Connect(buttonBox, Qt.SIGNAL("accepted()"), this, Qt.SLOT("accept()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("rejected()"),this,Qt.SLOT("reject()"));
            QMetaObject.ConnectSlotsByName(this);
        }
示例#17
0
        public RosterWidget(QWidget parent) : base(parent)
        {
            SetupUi();

            var settingsService = ServiceManager.Get <SettingsService>();

            m_RosterModel = new RosterAvatarGridModel();
            m_RosterModel.ShowTransports = settingsService.Get <bool>("RosterShowTransports");
            m_RosterModel.ShowOffline    = settingsService.Get <bool>("RosterShowOffline");
            rosterGrid.Model             = m_RosterModel;
            rosterGrid.ItemActivated    += HandleItemActivated;
            rosterGrid.ShowGroupCounts   = true;
            rosterGrid.InstallEventFilter(new KeyPressEater(delegate(QKeyEvent evnt) {
                if (!String.IsNullOrEmpty(evnt.Text()))
                {
                    rosterSearchButton.Checked = true;
                    friendSearchLineEdit.Text += evnt.Text();
                    friendSearchLineEdit.SetFocus();
                    return(true);
                }
                return(false);
            }, this));

            if (settingsService.Has("RosterIconSize"))
            {
                rosterGrid.IconSize = settingsService.Get <int>("RosterIconSize");
            }

            var accountService = ServiceManager.Get <AccountService>();

            accountService.AccountAdded   += HandleAccountAdded;
            accountService.AccountRemoved += HandleAccountRemoved;
            foreach (Account account in accountService.Accounts)
            {
                HandleAccountAdded(account);
            }

            m_ActivityFeedItems = new Dictionary <string, IActivityFeedItem>();

            rosterGrid.ContextMenuPolicy = Qt.ContextMenuPolicy.CustomContextMenu;

            m_RosterMenu = new QMenu(this);
            QObject.Connect <QAction>(m_RosterMenu, Qt.SIGNAL("triggered(QAction*)"), HandleRosterMenuTriggered);

            var rosterViewActionGroup = new QActionGroup(this);

            QObject.Connect <QAction>(rosterViewActionGroup, Qt.SIGNAL("triggered(QAction *)"), RosterViewActionGroupTriggered);

            m_GridModeAction = new QAction("View as Grid", this);
            m_GridModeAction.SetActionGroup(rosterViewActionGroup);
            m_GridModeAction.Checkable = true;
            m_RosterMenu.AddAction(m_GridModeAction);

            m_ListModeAction = new QAction("View as List", this);
            m_ListModeAction.SetActionGroup(rosterViewActionGroup);
            m_ListModeAction.Checkable = true;
            m_RosterMenu.AddAction(m_ListModeAction);

            if (settingsService.Get <bool>("RosterListMode"))
            {
                rosterGrid.ListMode      = true;
                m_ListModeAction.Checked = true;
            }
            else
            {
                rosterGrid.ListMode      = false;
                m_GridModeAction.Checked = true;
            }

            m_RosterMenu.AddSeparator();

            m_ShowOfflineAction           = new QAction("Show Offline Friends", this);
            m_ShowOfflineAction.Checkable = true;
            m_RosterMenu.AddAction(m_ShowOfflineAction);

            m_ShowTransportsAction           = new QAction("Show Transports", this);
            m_ShowTransportsAction.Checkable = true;
            m_RosterMenu.AddAction(m_ShowTransportsAction);

            m_RosterMenu.AddSeparator();

            var sliderAction = new AvatarGridZoomAction <Synapse.UI.RosterItem>(rosterGrid);

            sliderAction.ValueChanged += delegate(int value) {
                rosterGrid.IconSize = value;
                settingsService.Set("RosterIconSize", value);
            };
            m_RosterMenu.AddAction(sliderAction);

            m_InviteActions = new List <QAction>();

            m_InviteMenu = new QMenu(this);
            m_InviteMenu.MenuAction().Text = "Invite To";
            m_InviteMenu.AddAction("New Conference...");

            m_RosterItemMenu = new QMenu(this);
            QObject.Connect <QAction>(m_RosterItemMenu, Qt.SIGNAL("triggered(QAction*)"), HandleRosterItemMenuTriggered);
            QObject.Connect(m_RosterItemMenu, Qt.SIGNAL("aboutToShow()"), RosterItemMenuAboutToShow);
            QObject.Connect(m_RosterItemMenu, Qt.SIGNAL("aboutToHide()"), RosterItemMenuAboutToHide);

            m_ViewProfileAction = new QAction("View Profile", m_RosterItemMenu);
            m_RosterItemMenu.AddAction(m_ViewProfileAction);

            m_IMAction = new QAction("IM", m_RosterItemMenu);
            m_RosterItemMenu.AddAction(m_IMAction);

            m_RosterItemMenu.AddAction("Send File...");
            m_RosterItemMenu.AddMenu(m_InviteMenu);
            m_RosterItemMenu.AddAction("View History");

            foreach (IActionCodon node in AddinManager.GetExtensionNodes("/Synapse/QtClient/Roster/FriendActions"))
            {
                m_RosterItemMenu.AddAction((QAction)node.CreateInstance(this));
            }

            m_RosterItemMenu.AddSeparator();

            m_EditGroupsAction = new QAction("Edit Groups", m_RosterItemMenu);
            m_RosterItemMenu.AddAction(m_EditGroupsAction);

            m_RemoveAction = new QAction("Remove", m_RosterItemMenu);
            m_RosterItemMenu.AddAction(m_RemoveAction);

            friendSearchLineEdit.InstallEventFilter(new KeyPressEater(delegate(QKeyEvent evnt) {
                if (evnt.Key() == (int)Key.Key_Escape)
                {
                    friendSearchLineEdit.Clear();
                    rosterSearchButton.Checked = false;
                    rosterGrid.SetFocus();
                    return(true);
                }
                return(false);
            }, this));

            //QSizeGrip grip = new QSizeGrip(tabWidget);
            //tabWidget.SetCornerWidget(grip, Qt.Corner.BottomRightCorner);

            0.UpTo(9).ForEach(num => {
                QAction action  = new QAction(this);
                action.Shortcut = new QKeySequence("Alt+" + num.ToString());
                QObject.Connect(action, Qt.SIGNAL("triggered(bool)"), delegate {
                    tabWidget.CurrentIndex = num - 1;
                });
                this.AddAction(action);
            });

            var jsWindowObject = new SynapseJSObject(this);

            m_ActivityWebView.Page().linkDelegationPolicy = QWebPage.LinkDelegationPolicy.DelegateAllLinks;
            QObject.Connect <QUrl>(m_ActivityWebView, Qt.SIGNAL("linkClicked(QUrl)"), HandleActivityLinkClicked);
            QObject.Connect <bool>(m_ActivityWebView.Page(), Qt.SIGNAL("loadFinished(bool)"), HandleActivityPageLoadFinished);
            QObject.Connect(m_ActivityWebView.Page().MainFrame(), Qt.SIGNAL("javaScriptWindowObjectCleared()"), delegate {
                m_ActivityWebView.Page().MainFrame().AddToJavaScriptWindowObject("Synapse", jsWindowObject);
            });
            m_ActivityWebView.Page().MainFrame().Load("resource:/feed.html");

            //friendMucListWebView.Page().MainFrame().Load("resource:/friend-muclist.html");

            //quickJoinMucContainer.Hide();
            shoutContainer.Hide();

            QObject.Connect(shoutLineEdit, Qt.SIGNAL("textChanged(const QString &)"), delegate {
                shoutCharsLabel.Text = (140 - shoutLineEdit.Text.Length).ToString();
            });

            QObject.Connect(shoutLineEdit, Qt.SIGNAL("returnPressed()"), delegate {
                SendShout();
            });

            QVBoxLayout layout = new QVBoxLayout(m_AccountsContainer);

            layout.Margin = 0;
            m_AccountsContainer.SetLayout(layout);

            m_MucModel = new BookmarkedMUCsModel();
            mucTree.SetModel(m_MucModel);

            friendSearchContainer.Hide();

            rosterViewButton.icon     = new QIcon(new QPixmap("resource:/view-grid.png"));
            rosterSearchButton.icon   = new QIcon(new QPixmap("resource:/simple-search.png"));
            addFriendButton.icon      = new QIcon(new QPixmap("resource:/simple-add.png"));
            addMucBookmarkButton.icon = new QIcon(new QPixmap("resource:/simple-add.png"));
            feedFilterButton.icon     = new QIcon(new QPixmap("resource:/simple-search.png"));

            m_CollapseIcon           = new QIcon(new QPixmap("resource:/collapse.png"));
            m_ExpandIcon             = new QIcon(new QPixmap("resource:/expand.png"));
            toggleJoinMucButton.icon = m_CollapseIcon;

            UpdateOnlineCount();

            var shoutService = ServiceManager.Get <ShoutService>();

            shoutService.HandlerAdded   += HandleShoutHandlerAdded;
            shoutService.HandlerRemoved += HandleShoutHandlerRemoved;
            if (shoutService.Handlers.Count() > 0)
            {
                foreach (IShoutHandler handler in shoutService.Handlers)
                {
                    HandleShoutHandlerAdded(handler);
                }
            }
            else
            {
                shoutHandlersBox.Hide();
            }

            m_FeedFilterMenu = new QMenu(this);

            QObject.Connect(m_FeedFilterMenu, Qt.SIGNAL("triggered(QAction*)"), delegate(QAction action) {
                string js = Util.CreateJavascriptCall("ActivityFeed.setCategoryVisibility", action.Text.ToLower().Replace(" ", "-"), action.Checked);
                m_ActivityWebView.Page().MainFrame().EvaluateJavaScript(js);
            });

            var feedService = ServiceManager.Get <ActivityFeedService>();

            feedService.NewItem += delegate(IActivityFeedItem item) {
                lock (m_FeedItemQueue) {
                    if (!m_FeedIsLoaded)
                    {
                        m_FeedItemQueue.Enqueue(item);
                    }
                    else
                    {
                        AddActivityFeedItem(item);
                    }
                }
            };
            feedService.CategoryAdded += delegate(string category) {
                QApplication.Invoke(delegate {
                    HandleCategoryAdded(category);
                });
            };
            foreach (string category in feedService.Categories)
            {
                HandleCategoryAdded(category);
            }
        }
示例#18
0
    public void SetupUi(QDialog NewContactDialog)
    {
        if (NewContactDialog.ObjectName == "")
        {
            NewContactDialog.ObjectName = "NewContactDialog";
        }
        QSize Size = new QSize(360, 150);

        Size = Size.ExpandedTo(NewContactDialog.MinimumSizeHint());
        NewContactDialog.Size        = Size;
        NewContactDialog.MinimumSize = new QSize(360, 150);
        NewContactDialog.WindowIcon  = new QIcon(":/main/resources/monosim_128.png");
        gridLayout            = new QGridLayout(NewContactDialog);
        gridLayout.ObjectName = "gridLayout";
        LblTitle            = new QLabel(NewContactDialog);
        LblTitle.ObjectName = "LblTitle";
        LblTitle.Alignment  = Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignCenter");
        LblTitle.WordWrap   = true;

        gridLayout.AddWidget(LblTitle, 0, 0, 1, 2);

        LblDesc            = new QLabel(NewContactDialog);
        LblDesc.ObjectName = "LblDesc";

        gridLayout.AddWidget(LblDesc, 2, 0, 1, 1);

        TxtDesc            = new QLineEdit(NewContactDialog);
        TxtDesc.ObjectName = "TxtDesc";

        gridLayout.AddWidget(TxtDesc, 2, 1, 1, 1);

        LblNumber            = new QLabel(NewContactDialog);
        LblNumber.ObjectName = "LblNumber";

        gridLayout.AddWidget(LblNumber, 3, 0, 1, 1);

        TxtNumber            = new QLineEdit(NewContactDialog);
        TxtNumber.ObjectName = "TxtNumber";

        gridLayout.AddWidget(TxtNumber, 3, 1, 1, 1);

        spacerItem = new QSpacerItem(282, 37, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);

        gridLayout.AddItem(spacerItem, 4, 1, 1, 1);

        Buttons                 = new QDialogButtonBox(NewContactDialog);
        Buttons.ObjectName      = "Buttons";
        Buttons.Orientation     = Qt.Orientation.Horizontal;
        Buttons.StandardButtons = Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Cancel") | Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Ok");

        gridLayout.AddWidget(Buttons, 5, 0, 1, 2);

        spacerItem1 = new QSpacerItem(20, 8, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed);

        gridLayout.AddItem(spacerItem1, 1, 0, 1, 1);


        RetranslateUi(NewContactDialog);
        QObject.Connect(Buttons, Qt.SIGNAL("accepted()"), NewContactDialog, Qt.SLOT("accept()"));
        QObject.Connect(Buttons,Qt.SIGNAL("rejected()"),NewContactDialog,Qt.SLOT("reject()"));

        QMetaObject.ConnectSlotsByName(NewContactDialog);
    } // SetupUi
示例#19
0
        public AccountStatusWidget(Account account, RosterWidget parent, MainWindow parentWindow) : base(parent)
        {
            SetupUi();

            m_ParentWindow = parentWindow;

            m_EditProfileDialog = new EditProfileDialog(account, this.TopLevelWidget());

            m_AvatarLabel.Cursor   = new QCursor(CursorShape.PointingHandCursor);
            m_AvatarLabel.Clicked += delegate {
                if (m_Account.ConnectionState == AccountConnectionState.Connected)
                {
                    m_EditProfileDialog.Show(2);
                    m_EditProfileDialog.ActivateWindow();
                }
                else
                {
                    // FIXME: It really wouldn't be so hard to make this work.
                    // On connect, check to see if it was changed and update server.
                    QMessageBox.Warning(this.TopLevelWidget(), "Synapse", "Cannot edit avatar when you're not connected.");
                }
            };

            m_Account = account;
            m_Account.ConnectionStateChanged      += OnAccountStateChanged;
            m_Account.StatusChanged               += OnAccountStateChanged;
            m_Account.MyVCardUpdated              += HandleMyVCardUpdated;
            m_Account.AvatarManager.AvatarUpdated += HandleAvatarUpdated;
            OnAccountStateChanged(account);

            HandleAvatarUpdated(m_Account.Jid.Bare, null);

            HandleMyVCardUpdated(null, EventArgs.Empty);
            m_NameLabel.TextFormat = TextFormat.RichText;

            HandleAvatarUpdated(m_Account.Jid.Bare, m_Account.GetProperty("AvatarHash"));

            m_PresenceMenu = new QMenu(this);
            QObject.Connect(m_PresenceMenu, Qt.SIGNAL("aboutToShow()"), HandlePresenceMenuAboutToShow);
            QObject.Connect <QAction>(m_PresenceMenu, Qt.SIGNAL("triggered(QAction*)"), HandlePresenceMenuTriggered);

            QActionGroup group = new QActionGroup(this);

            group.Exclusive = true;

            m_AvailableAction = m_PresenceMenu.AddAction("Available");
            group.AddAction(m_AvailableAction);
            m_AvailableAction.Checkable = true;

            m_FreeToChatAction = m_PresenceMenu.AddAction("Free To Chat");
            group.AddAction(m_FreeToChatAction);
            m_FreeToChatAction.Checkable = true;

            m_AwayAction = m_PresenceMenu.AddAction("Away");
            group.AddAction(m_AwayAction);
            m_AwayAction.Checkable = true;

            m_ExtendedAwayAction = m_PresenceMenu.AddAction("Extended Away");
            group.AddAction(m_ExtendedAwayAction);
            m_ExtendedAwayAction.Checkable = true;

            m_DoNotDisturbAction = m_PresenceMenu.AddAction("Do Not Disturb");
            group.AddAction(m_DoNotDisturbAction);
            m_DoNotDisturbAction.Checkable = true;

            m_PresenceMenu.AddSeparator();

            m_OfflineAction = m_PresenceMenu.AddAction("Offline");
            group.AddAction(m_OfflineAction);
            m_OfflineAction.Checkable = true;
        }
示例#20
0
        public TabbedChatsWindow()
        {
            // FIXME: This doesn't work very well in most themes...
            //this.SetStyleSheet("QTabWidget::pane { border: 0px; }");

            // The tab widget messes up this background color.
            this.SetStyleSheet("QTabWidget > QWidget { background: palette(window); }");

            m_Tabs             = new QTabWidget();
            m_Tabs.tabPosition = QTabWidget.TabPosition.South;

            QToolButton newTabButton = new QToolButton(m_Tabs);

            newTabButton.AutoRaise = true;
            newTabButton.SetDefaultAction(new QAction(Gui.LoadIcon("tab-new", 16), "New Tab", newTabButton));
            newTabButton.SetToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly);
            QObject.Connect <QAction>(newTabButton, Qt.SIGNAL("triggered(QAction*)"), HandleNewTab);
            m_Tabs.SetCornerWidget(newTabButton, Qt.Corner.BottomLeftCorner);

            QHBoxLayout rightButtonsLayout = new QHBoxLayout();

            rightButtonsLayout.SetContentsMargins(0, 0, 0, 0);
            rightButtonsLayout.Spacing = 0;

            QToolButton closeTabButton = new QToolButton(m_Tabs);

            closeTabButton.SetToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly);
            closeTabButton.AutoRaise = true;
            closeTabButton.SetDefaultAction(new QAction(Gui.LoadIcon("window-close", 16), "Close Tab", closeTabButton));
            QObject.Connect <QAction>(closeTabButton, Qt.SIGNAL("triggered(QAction*)"), HandleCloseTab);
            rightButtonsLayout.AddWidget(closeTabButton);

            QMenu menu = new QMenu(this);

            menu.AddAction(new QIcon(), "No Recently Closed Tabs");

            QToolButton trashButton = new QToolButton(m_Tabs);

            trashButton.SetToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly);
            trashButton.AutoRaise = true;
            trashButton.PopupMode = QToolButton.ToolButtonPopupMode.InstantPopup;
            trashButton.SetMenu(menu);
            trashButton.SetDefaultAction(new QAction(Gui.LoadIcon("user-trash", 16), "Recently Closed Tabs", trashButton));
            rightButtonsLayout.AddWidget(trashButton);

            // FIXME: This looks bad.
            //rightButtonsLayout.AddWidget(new QSizeGrip(this));

            QWidget rightButtonsContainer = new QWidget(m_Tabs);

            rightButtonsContainer.SetLayout(rightButtonsLayout);
            m_Tabs.SetCornerWidget(rightButtonsContainer, Qt.Corner.BottomRightCorner);

            QVBoxLayout layout = new QVBoxLayout(this);

            layout.SetContentsMargins(0, 0, 0, 0);
            layout.AddWidget(m_Tabs, 1, 0);
            this.SetLayout(layout);

            QObject.Connect <int>(m_Tabs, Qt.SIGNAL("currentChanged(int)"), HandleCurrentChanged);

            this.SetGeometry(0, 0, 445, 370);
            Gui.CenterWidgetOnScreen(this);

            QAction closeAction = new QAction(this);

            QObject.Connect <bool>(closeAction, Qt.SIGNAL("triggered(bool)"), HandleCloseActionTriggered);
            closeAction.Shortcut = new QKeySequence("Ctrl+w");
            this.AddAction(closeAction);

            0.UpTo(9).ForEach(num => {
                QAction action  = new QAction(this);
                action.Shortcut = new QKeySequence("Alt+" + num.ToString());
                QObject.Connect(action, Qt.SIGNAL("triggered(bool)"), delegate {
                    m_Tabs.CurrentIndex = num - 1;
                });
                this.AddAction(action);
            });

            QAction nextTabAction = new QAction(this);

            nextTabAction.Shortcut = new QKeySequence(QKeySequence.StandardKey.NextChild);
            QObject.Connect(nextTabAction, Qt.SIGNAL("triggered(bool)"), delegate {
                if (m_Tabs.CurrentIndex == m_Tabs.Count - 1)
                {
                    m_Tabs.CurrentIndex = 0;
                }
                else
                {
                    m_Tabs.CurrentIndex += 1;
                }
            });
            this.AddAction(nextTabAction);

            QAction prevTabAction = new QAction(this);

            prevTabAction.Shortcut = new QKeySequence(QKeySequence.StandardKey.PreviousChild);
            QObject.Connect(prevTabAction, Qt.SIGNAL("triggered(bool)"), delegate {
                if (m_Tabs.CurrentIndex == 0)
                {
                    m_Tabs.CurrentIndex = m_Tabs.Count - 1;
                }
                else
                {
                    m_Tabs.CurrentIndex -= 1;
                }
            });

            var accountService = ServiceManager.Get <AccountService>();

            accountService.AccountAdded   += HandleAccountAdded;
            accountService.AccountRemoved += HandleAccountRemoved;
            foreach (Account account in accountService.Accounts)
            {
                HandleAccountAdded(account);
            }

            var settingsService = ServiceManager.Get <SettingsService>();

            if (settingsService.Has("ChatsWindowGeometry"))
            {
                var geometry = settingsService.Get <byte[]>("ChatsWindowGeometry");
                base.RestoreGeometry(QByteArrayConverter.FromArray(geometry));
            }
        }
示例#21
0
        internal ChatWindow(IChatHandler handler)
        {
            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }
            m_Handler = handler;

            var settingsService = ServiceManager.Get <SettingsService>();

            SetupUi();

            if (handler is MucHandler)
            {
                m_ParticipantsMenu = new QMenu(this);
                QObject.Connect(m_ParticipantsMenu, Qt.SIGNAL("aboutToShow()"), HandleMenuAboutToShow);
                QObject.Connect(m_ParticipantsMenu, Qt.SIGNAL("aboutToHide()"), HandleMenuAboutToHide);

                var mucHandler = (MucHandler)handler;
                participantsGrid.Model             = mucHandler.GridModel;
                participantsGrid.ContextMenuPolicy = Qt.ContextMenuPolicy.CustomContextMenu;
                participantsGrid.ItemActivated    += HandleItemActivated;

                participantsGrid.ListMode = settingsService.Get <bool>("MucListMode");
                if (settingsService.Has("MucIconSize"))
                {
                    participantsGrid.IconSize = settingsService.Get <int>("MucIconSize");
                }

                var group = new QActionGroup(this);

                var gridModeAction = new QAction("View as Grid", this);
                QObject.Connect(gridModeAction, Qt.SIGNAL("triggered()"), HandleGridModeActionTriggered);
                gridModeAction.SetActionGroup(group);
                gridModeAction.Checkable = true;
                gridModeAction.Checked   = true;
                m_ParticipantsMenu.AddAction(gridModeAction);

                var listModeAction = new QAction("View as List", this);
                QObject.Connect(listModeAction, Qt.SIGNAL("triggered()"), HandleListModeActionTriggered);
                listModeAction.SetActionGroup(group);
                listModeAction.Checkable = true;
                listModeAction.Checked   = participantsGrid.ListMode;
                m_ParticipantsMenu.AddAction(listModeAction);

                var separatorAction = new QAction(participantsGrid);
                separatorAction.SetSeparator(true);
                m_ParticipantsMenu.AddAction(separatorAction);

                var sliderAction = new AvatarGridZoomAction <jabber.connection.RoomParticipant>(participantsGrid);
                sliderAction.ValueChanged += delegate(int value) {
                    participantsGrid.IconSize = value;
                    settingsService.Set("MucIconSize", value);
                };
                m_ParticipantsMenu.AddAction(sliderAction);

                m_ParticipantItemMenu = new QMenu(this);
                QObject.Connect(m_ParticipantItemMenu, Qt.SIGNAL("aboutToShow()"), HandleMenuAboutToShow);
                QObject.Connect(m_ParticipantItemMenu, Qt.SIGNAL("aboutToHide()"), HandleMenuAboutToHide);

                var mucViewProfileAction = new QAction("View Profile", this);
                QObject.Connect(mucViewProfileAction, Qt.SIGNAL("triggered()"), HandleMucViewProfileActionTriggered);
                m_ParticipantItemMenu.AddAction(mucViewProfileAction);

                var mucPrivateMessageAction = new QAction("IM", this);
                QObject.Connect(mucPrivateMessageAction, Qt.SIGNAL("triggered()"), HandleMucPrivateMessageTriggered);
                m_ParticipantItemMenu.AddAction(mucPrivateMessageAction);

                var mucSendFileAction = new QAction("Send File...", this);
                QObject.Connect(mucSendFileAction, Qt.SIGNAL("triggered()"), HandleMucSendFileActionTriggered);
                m_ParticipantItemMenu.AddAction(mucSendFileAction);

                var mucViewHistoryAction = new QAction("View History", this);
                QObject.Connect(mucViewHistoryAction, Qt.SIGNAL("triggered()"), HandleMucViewHistoryActionTriggered);
                m_ParticipantItemMenu.AddAction(mucViewHistoryAction);

                m_ModeratorActionsMenu = new QMenu("Moderator Actions", this);

                var roomRoleActionGroup = new QActionGroup(this);
                QObject.Connect(roomRoleActionGroup, Qt.SIGNAL("triggered(QAction*)"), this, Qt.SLOT("HandleRoomRoleActionGroupTriggered(QAction*)"));

                m_ModeratorAction = new QAction("Moderator",this);
                roomRoleActionGroup.AddAction(m_ModeratorAction);
                m_ModeratorAction.Checkable = true;
                m_ModeratorActionsMenu.AddAction(m_ModeratorAction);

                m_ParticipantAction = new QAction("Participant",this);
                roomRoleActionGroup.AddAction(m_ParticipantAction);
                m_ParticipantAction.Checkable = true;
                m_ModeratorActionsMenu.AddAction(m_ParticipantAction);

                m_VisitorAction = new QAction("Visitor",this);
                roomRoleActionGroup.AddAction(m_VisitorAction);
                m_VisitorAction.Checkable = true;
                m_ModeratorActionsMenu.AddAction(m_VisitorAction);

                m_ModeratorActionsMenu.AddSeparator();

                var mucKickAction = new QAction("Kick...",this);
                QObject.Connect(mucKickAction,Qt.SIGNAL("triggered()"),HandleMucKickActionTriggered);
                m_ModeratorActionsMenu.AddAction(mucKickAction);

                var mucBanAction = new QAction("Ban...",this);
                QObject.Connect(mucBanAction,Qt.SIGNAL("triggered()"),HandleMucBanActionTriggered);
                m_ModeratorActionsMenu.AddAction(mucBanAction);

                m_ModeratorActionsMenu.AddSeparator();

                m_ChangeAffiliationAction = new QAction("Change Affiliation...",this);
                QObject.Connect(m_ChangeAffiliationAction,Qt.SIGNAL("triggered()"),HandleChangeAffiliationTriggered);
                m_ModeratorActionsMenu.AddAction(m_ChangeAffiliationAction);

                m_ParticipantItemMenu.AddSeparator();
                m_ParticipantItemMenu.AddMenu(m_ModeratorActionsMenu);

                m_ParticipantItemMenu.AddSeparator();

                m_AddAsFriendAction = new QAction("Add as Friend",this);
                m_ParticipantItemMenu.AddAction(m_AddAsFriendAction);

                this.WindowTitle = mucHandler.Room.JID.User;                 // FIXME: Show only "user" in tab, show full room jid in title?
                this.WindowIcon  = Gui.LoadIcon("internet-group-chat");
            }
            else
            {
                var chatHandler = (ChatHandler)handler;
                rightContainer.Hide();

                if (((ChatHandler)handler).IsMucMessage)
                {
                    this.WindowTitle = chatHandler.Jid.Resource;
                }
                else
                {
                    this.WindowTitle = chatHandler.Account.GetDisplayName(chatHandler.Jid);
                }
                this.WindowIcon = new QIcon((QPixmap)Synapse.Xmpp.AvatarManager.GetAvatar(chatHandler.Jid));
            }

            m_ConversationWidget.ChatHandler = handler;

            handler.ReadyChanged += HandleReadyChanged;

            splitter.SetStretchFactor(1,0);
            splitter_2.SetStretchFactor(1,0);

            if (settingsService.Has("MucSplitterState"))
            {
                byte[] state = settingsService.Get <byte[]>("MucSplitterState");
                splitter_2.RestoreState(QByteArrayConverter.FromArray(state));
            }

            KeyPressEater eater = new KeyPressEater(this);

            eater.KeyEvent += HandleKeyEvent;
            textEdit.InstallEventFilter(eater);

            QToolBar toolbar = new QToolBar(this);

            toolbar.IconSize = new QSize(16,16);

            var formatMenuButton = new QToolButton(this);

            var formatMenu = new QMenu(this);

            QObject.Connect <QAction>(formatMenu,Qt.SIGNAL("triggered(QAction*)"),HandleFormatMenuActionTriggered);
            formatMenuButton.ToolButtonStyle = ToolButtonStyle.ToolButtonTextBesideIcon;
            formatMenuButton.Text            = "Format";
            formatMenuButton.icon            = Gui.LoadIcon("preferences-desktop-font",16);
            formatMenuButton.PopupMode       = QToolButton.ToolButtonPopupMode.InstantPopup;
            formatMenuButton.SetMenu(formatMenu);
            toolbar.AddWidget(formatMenuButton);

            m_BoldAction           = new QAction(Gui.LoadIcon("format-text-bold",16),"Bold",this);
            m_BoldAction.Shortcut  = "Ctrl+B";
            m_BoldAction.Checkable = true;
            formatMenu.AddAction(m_BoldAction);

            m_ItalicAction           = new QAction(Gui.LoadIcon("format-text-italic",16),"Italic",this);
            m_ItalicAction.Shortcut  = "Ctrl+I";
            m_ItalicAction.Checkable = true;
            formatMenu.AddAction(m_ItalicAction);

            m_UnderlineAction           = new QAction(Gui.LoadIcon("format-text-underline",16),"Underline",this);
            m_UnderlineAction.Shortcut  = "Ctrl+U";
            m_UnderlineAction.Checkable = true;
            formatMenu.AddAction(m_UnderlineAction);

            m_StrikethroughAction           = new QAction(Gui.LoadIcon("format-text-strikethrough",16),"Strikethrough",this);
            m_StrikethroughAction.Shortcut  = "Ctrl+S";
            m_StrikethroughAction.Checkable = true;
            formatMenu.AddAction(m_StrikethroughAction);

            formatMenu.AddSeparator();

            m_ClearFormattingAction = new QAction(Gui.LoadIcon("edit-clear",16),"Clear Formatting",this);
            formatMenu.AddAction(m_ClearFormattingAction);

            var insertMenu       = new QMenu(this);
            var insertMenuButton = new QToolButton(this);

            insertMenuButton.ToolButtonStyle = ToolButtonStyle.ToolButtonTextBesideIcon;
            insertMenuButton.Text            = "Insert";
            insertMenuButton.icon            = Gui.LoadIcon("image-x-generic",16);
            insertMenuButton.PopupMode       = QToolButton.ToolButtonPopupMode.InstantPopup;
            insertMenuButton.SetMenu(insertMenu);
            toolbar.AddWidget(insertMenuButton);

            m_InsertPhotoAction = new QAction(Gui.LoadIcon("insert-image",16),"Photo...",this);
            QObject.Connect(m_InsertPhotoAction,Qt.SIGNAL("triggered()"),HandleInsertImageActionTriggered);
            insertMenu.AddAction(m_InsertPhotoAction);

            m_InsertLinkAction = new QAction(Gui.LoadIcon("insert-link",16),"Link...",this);
            QObject.Connect(m_InsertLinkAction,Qt.SIGNAL("triggered()"),HandleInsertLinkActionTriggered);
            insertMenu.AddAction(m_InsertLinkAction);

            foreach (IActionCodon node in AddinManager.GetExtensionNodes("/Synapse/QtClient/ChatWindow/InsertActions"))
            {
                insertMenu.AddAction((QAction)node.CreateInstance(this));
            }

            toolbar.AddSeparator();

            var activitiesMenu       = new QMenu(this);
            var activitiesMenuButton = new QToolButton(this);

            activitiesMenuButton.ToolButtonStyle = ToolButtonStyle.ToolButtonTextBesideIcon;
            activitiesMenuButton.Text            = "Activities";
            activitiesMenuButton.icon            = Gui.LoadIcon("applications-games",16);   // FIXME: Not a good icon.
            activitiesMenuButton.PopupMode       = QToolButton.ToolButtonPopupMode.InstantPopup;
            activitiesMenuButton.SetMenu(activitiesMenu);
            toolbar.AddWidget(activitiesMenuButton);

            m_InviteToMucAction = new QAction(Gui.LoadIcon("internet-group-chat",16),"Invite to Conference...",this);
            QObject.Connect(m_InviteToMucAction,Qt.SIGNAL("triggered()"),HandleInviteToMucActionTriggered);
            activitiesMenu.AddAction(m_InviteToMucAction);
            activitiesMenu.AddSeparator();

            activitiesMenu.AddAction(Gui.LoadIcon("applications-graphics",16),"Launch Whiteboard...");
            activitiesMenu.AddAction(Gui.LoadIcon("user-desktop",16),"Share Desktop...");

            var spacerWidget = new QWidget(toolbar);

            spacerWidget.SetSizePolicy(QSizePolicy.Policy.Expanding,QSizePolicy.Policy.Fixed);
            toolbar.AddWidget(spacerWidget);

            var toContainer = new QWidget(toolbar);
            var layout      = new QHBoxLayout(toContainer);

            layout.SetContentsMargins(0,0,4,0);

            m_ToComboBox = new QComboBox(toContainer);

            layout.AddWidget(new QLabel("To:",toContainer));
            layout.AddWidget(m_ToComboBox);

            QAction toWidgetAction = (QWidgetAction)toolbar.AddWidget(toContainer);

            m_ToComboBox.AddItem("Automatic","auto");
            m_ToComboBox.InsertSeparator(1);

            ((QVBoxLayout)bottomContainer.Layout()).InsertWidget(0,toolbar);

            if (handler is ChatHandler)
            {
                var chatHandler = (ChatHandler)handler;
                handler.Account.Client.OnPresence += delegate(object sender,Presence pres) {
                    if (pres.From.Bare != chatHandler.Jid.Bare || pres.Priority == "-1")
                    {
                        return;
                    }
                    QApplication.Invoke(delegate {
                        if (!String.IsNullOrEmpty(pres.From.Resource))
                        {
                            if (pres.Type == PresenceType.available)
                            {
                                string text = String.Format("{0} ({1})",Helper.GetResourceDisplay(pres),Helper.GetPresenceDisplay(pres));
                                int i       = m_ToComboBox.FindData(pres.From.Resource);
                                if (i == -1)
                                {
                                    m_ToComboBox.AddItem(text,pres.From.Resource);
                                }
                                else
                                {
                                    m_ToComboBox.SetItemText(i,text);
                                }
                            }
                            else if (pres.Type == PresenceType.unavailable)
                            {
                                int i = m_ToComboBox.FindData(pres.From.Resource);
                                if (i > -1)
                                {
                                    m_ToComboBox.RemoveItem(i);
                                    m_ToComboBox.CurrentIndex = 0;
                                }
                            }
                        }

                        if (chatHandler.IsMucMessage)
                        {
                            toWidgetAction.Visible = false;
                        }
                        else
                        {
                            string title = null;
                            if (handler.Account.PresenceManager[pres.From.BareJID] == null)
                            {
                                title = String.Format("{0} (Offline)",chatHandler.Account.GetDisplayName(chatHandler.Jid));
                            }
                            else
                            {
                                title = chatHandler.Account.GetDisplayName(chatHandler.Jid);
                            }
                            Gui.TabbedChatsWindow.SetTabTitle(this,title);
                        }
                    });
                };

                foreach (var presence in chatHandler.Account.PresenceManager.GetAll(chatHandler.Jid))
                {
                    if (presence.Priority != "-1" && !String.IsNullOrEmpty(presence.From.Resource))
                    {
                        string text = String.Format("{0} ({1})",Helper.GetResourceDisplay(presence),Helper.GetPresenceDisplay(presence));
                        m_ToComboBox.AddItem(text,presence.From.Resource);
                    }
                }

                // FIXME: Make this a menu with "View Profile" and "View History".
                var viewProfileAction = new QAction(Gui.LoadIcon("info",16),"View Profile",this);
                QObject.Connect(viewProfileAction,Qt.SIGNAL("triggered()"),HandleViewProfileActionTriggered);
                toolbar.AddAction(viewProfileAction);
            }
            else
            {
                toWidgetAction.Visible = false;
            }

            QObject.Connect <bool>(m_ConversationWidget.Page(),Qt.SIGNAL("loadFinished(bool)"),delegate(bool ok) {
                if (!ok)
                {
                    throw new Exception("Failed to load chat html.");
                }
                handler.NewContent += HandleNewContent;
                m_Handler.FireQueued();
            });

            var settings = ServiceManager.Get <SettingsService>();

            m_ConversationWidget.ShowHeader    = settings.Get <bool>("MessageShowHeader");
            m_ConversationWidget.ShowUserIcons = settings.Get <bool>("MessageShowAvatars");
            m_ConversationWidget.LoadTheme(settings.Get <string>("MessageTheme"),settings.Get <string>("MessageThemeVariant"));
        }
示例#22
0
        protected void SetupUi()
        {
            base.ObjectName = "NoAccountsWidget";
            this.Geometry   = new QRect(0, 0, 341, 485);
            QSizePolicy NoAccountsWidget_sizePolicy;

            NoAccountsWidget_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum);
            NoAccountsWidget_sizePolicy.SetVerticalStretch(0);
            NoAccountsWidget_sizePolicy.SetHorizontalStretch(0);
            NoAccountsWidget_sizePolicy.SetHeightForWidth(this.SizePolicy.HasHeightForWidth());
            this.SizePolicy  = NoAccountsWidget_sizePolicy;
            this.WindowTitle = "Form";
            QVBoxLayout verticalLayout;

            verticalLayout                 = new QVBoxLayout(this);
            verticalLayout.Spacing         = 6;
            verticalLayout.Margin          = 6;
            this.m_GraphicsView            = new QGraphicsView(this);
            this.m_GraphicsView.ObjectName = "m_GraphicsView";
            QSizePolicy m_GraphicsView_sizePolicy;

            m_GraphicsView_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed);
            m_GraphicsView_sizePolicy.SetVerticalStretch(0);
            m_GraphicsView_sizePolicy.SetHorizontalStretch(0);
            m_GraphicsView_sizePolicy.SetHeightForWidth(this.m_GraphicsView.SizePolicy.HasHeightForWidth());
            this.m_GraphicsView.SizePolicy  = m_GraphicsView_sizePolicy;
            this.m_GraphicsView.MinimumSize = new QSize(0, 300);
            this.m_GraphicsView.FrameShape  = QFrame.Shape.NoFrame;
            verticalLayout.AddWidget(this.m_GraphicsView);
            this.stackedWidget              = new QStackedWidget(this);
            this.stackedWidget.ObjectName   = "stackedWidget";
            this.stackedWidget.CurrentIndex = 1;
            verticalLayout.AddWidget(this.stackedWidget);
            this.page_3            = new QWidget(this.stackedWidget);
            this.page_3.ObjectName = "page_3";
            QVBoxLayout verticalLayout_2;

            verticalLayout_2         = new QVBoxLayout(this.page_3);
            verticalLayout_2.Spacing = 6;
            verticalLayout_2.Margin  = 0;
            this.m_Label             = new QLabel(this.page_3);
            this.m_Label.ObjectName  = "m_Label";
            QSizePolicy m_Label_sizePolicy;

            m_Label_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            m_Label_sizePolicy.SetVerticalStretch(0);
            m_Label_sizePolicy.SetHorizontalStretch(0);
            m_Label_sizePolicy.SetHeightForWidth(this.m_Label.SizePolicy.HasHeightForWidth());
            this.m_Label.SizePolicy = m_Label_sizePolicy;
            this.m_Label.Text       = "<p><strong>Welcome.</strong><br/>Click <em>Add Account</em> below to begin.";
            this.m_Label.Alignment  = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignBottom") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft"));
            verticalLayout_2.AddWidget(this.m_Label);
            QHBoxLayout horizontalLayout_2;

            horizontalLayout_2 = new QHBoxLayout();
            verticalLayout_2.AddLayout(horizontalLayout_2);
            QSpacerItem horizontalSpacer_2;

            horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout_2.AddItem(horizontalSpacer_2);
            this.quitButton1            = new QPushButton(this.page_3);
            this.quitButton1.ObjectName = "quitButton1";
            this.quitButton1.Text       = "Quit";
            horizontalLayout_2.AddWidget(this.quitButton1);
            this.addAccountButton            = new QPushButton(this.page_3);
            this.addAccountButton.ObjectName = "addAccountButton";
            this.addAccountButton.Text       = "Add Account";
            horizontalLayout_2.AddWidget(this.addAccountButton);
            this.stackedWidget.AddWidget(this.page_3);
            this.page_4            = new QWidget(this.stackedWidget);
            this.page_4.ObjectName = "page_4";
            QVBoxLayout verticalLayout_3;

            verticalLayout_3        = new QVBoxLayout(this.page_4);
            verticalLayout_3.Margin = 0;
            this.label_3            = new QLabel(this.page_4);
            this.label_3.ObjectName = "label_3";
            this.label_3.Text       = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'DejaVu Sans'; font-size:8pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Add Account</span></p></body></html>";
            this.label_3.Alignment  = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignBottom") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft"));
            verticalLayout_3.AddWidget(this.label_3);
            QGridLayout gridLayout;

            gridLayout = new QGridLayout();
            verticalLayout_3.AddLayout(gridLayout);
            this.label            = new QLabel(this.page_4);
            this.label.ObjectName = "label";
            this.label.Text       = "Jabber ID:";
            gridLayout.AddWidget(this.label, 0, 0, 1, 1);
            this.m_LoginLineEdit            = new QLineEdit(this.page_4);
            this.m_LoginLineEdit.ObjectName = "m_LoginLineEdit";
            gridLayout.AddWidget(this.m_LoginLineEdit, 0, 1, 1, 1);
            this.label_2            = new QLabel(this.page_4);
            this.label_2.ObjectName = "label_2";
            this.label_2.Text       = "Password:"******"m_PasswordLineEdit";
            this.m_PasswordLineEdit.echoMode   = QLineEdit.EchoMode.Password;
            gridLayout.AddWidget(this.m_PasswordLineEdit, 1, 1, 1, 1);
            QHBoxLayout horizontalLayout;

            horizontalLayout = new QHBoxLayout();
            verticalLayout_3.AddLayout(horizontalLayout);
            horizontalLayout.sizeConstraint = QLayout.SizeConstraint.SetDefaultConstraint;
            QSpacerItem horizontalSpacer;

            horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout.AddItem(horizontalSpacer);
            this.quitButton2            = new QPushButton(this.page_4);
            this.quitButton2.ObjectName = "quitButton2";
            this.quitButton2.Text       = "Quit";
            horizontalLayout.AddWidget(this.quitButton2);
            this.saveAccountButton             = new QPushButton(this.page_4);
            this.saveAccountButton.ObjectName  = "saveAccountButton";
            this.saveAccountButton.Text        = "OK";
            this.saveAccountButton.AutoDefault = true;
            this.saveAccountButton.Default     = true;
            horizontalLayout.AddWidget(this.saveAccountButton);
            this.stackedWidget.AddWidget(this.page_4);
            QObject.Connect(m_PasswordLineEdit, Qt.SIGNAL("returnPressed()"), saveAccountButton, Qt.SLOT("click()"));
            QObject.Connect(m_LoginLineEdit,Qt.SIGNAL("returnPressed()"),saveAccountButton,Qt.SLOT("click()"));
            QMetaObject.ConnectSlotsByName(this);
            this.label.SetBuddy(m_LoginLineEdit);
            this.label_2.SetBuddy(m_PasswordLineEdit);
        }
示例#23
0
        protected void SetupUi()
        {
            base.ObjectName  = "RosterWidget";
            this.Geometry    = new QRect(0, 0, 352, 538);
            this.WindowTitle = "RosterWidget";
            this.StyleSheet  = "";
            QVBoxLayout verticalLayout_6;

            verticalLayout_6                    = new QVBoxLayout(this);
            verticalLayout_6.Spacing            = 0;
            verticalLayout_6.sizeConstraint     = QLayout.SizeConstraint.SetDefaultConstraint;
            verticalLayout_6.Margin             = 0;
            this.m_AccountsContainer            = new QWidget(this);
            this.m_AccountsContainer.ObjectName = "m_AccountsContainer";
            QSizePolicy m_AccountsContainer_sizePolicy;

            m_AccountsContainer_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Preferred);
            m_AccountsContainer_sizePolicy.SetVerticalStretch(0);
            m_AccountsContainer_sizePolicy.SetHorizontalStretch(0);
            m_AccountsContainer_sizePolicy.SetHeightForWidth(this.m_AccountsContainer.SizePolicy.HasHeightForWidth());
            this.m_AccountsContainer.SizePolicy = m_AccountsContainer_sizePolicy;
            verticalLayout_6.AddWidget(this.m_AccountsContainer);
            this.notificationsWidget             = new Synapse.QtClient.Widgets.NotificationsWidget(this);
            this.notificationsWidget.ObjectName  = "notificationsWidget";
            this.notificationsWidget.FrameShape  = QFrame.Shape.NoFrame;
            this.notificationsWidget.FrameShadow = QFrame.Shadow.Raised;
            verticalLayout_6.AddWidget(this.notificationsWidget);
            this.splitter             = new QSplitter(this);
            this.splitter.ObjectName  = "splitter";
            this.splitter.Orientation = Qt.Orientation.Vertical;
            verticalLayout_6.AddWidget(this.splitter);
            this.widget            = new QWidget(this.splitter);
            this.widget.ObjectName = "widget";
            QVBoxLayout verticalLayout_2;

            verticalLayout_2            = new QVBoxLayout(this.widget);
            verticalLayout_2.Margin     = 0;
            this.tabWidget              = new Synapse.QtClient.Widgets.MainTabWidget(this.widget);
            this.tabWidget.ObjectName   = "tabWidget";
            this.tabWidget.tabPosition  = QTabWidget.TabPosition.South;
            this.tabWidget.CurrentIndex = 2;
            verticalLayout_2.AddWidget(this.tabWidget);
            this.friendsTab            = new QWidget(this.tabWidget);
            this.friendsTab.ObjectName = "friendsTab";
            QVBoxLayout verticalLayout_4;

            verticalLayout_4                   = new QVBoxLayout(this.friendsTab);
            verticalLayout_4.Spacing           = 0;
            verticalLayout_4.Margin            = 0;
            this.gridHeader                    = new QFrame(this.friendsTab);
            this.gridHeader.ObjectName         = "gridHeader";
            this.gridHeader.AutoFillBackground = true;
            this.gridHeader.FrameShape         = QFrame.Shape.NoFrame;
            this.gridHeader.FrameShadow        = QFrame.Shadow.Raised;
            QHBoxLayout horizontalLayout_6;

            horizontalLayout_6         = new QHBoxLayout(this.gridHeader);
            horizontalLayout_6.Spacing = 3;
            horizontalLayout_6.Margin  = 3;
            this.statsLabel            = new QLabel(this.gridHeader);
            this.statsLabel.ObjectName = "statsLabel";
            QSizePolicy statsLabel_sizePolicy;

            statsLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred);
            statsLabel_sizePolicy.SetVerticalStretch(0);
            statsLabel_sizePolicy.SetHorizontalStretch(0);
            statsLabel_sizePolicy.SetHeightForWidth(this.statsLabel.SizePolicy.HasHeightForWidth());
            this.statsLabel.SizePolicy = statsLabel_sizePolicy;
            this.statsLabel.Text       = "";
            horizontalLayout_6.AddWidget(this.statsLabel);
            this.rosterSearchButton             = new QPushButton(this.gridHeader);
            this.rosterSearchButton.ObjectName  = "rosterSearchButton";
            this.rosterSearchButton.FocusPolicy = Qt.FocusPolicy.TabFocus;
            this.rosterSearchButton.ToolTip     = "Search friends";
            this.rosterSearchButton.Text        = "";
            this.rosterSearchButton.Checkable   = true;
            this.rosterSearchButton.Checked     = false;
            this.rosterSearchButton.Flat        = true;
            horizontalLayout_6.AddWidget(this.rosterSearchButton);
            this.rosterViewButton             = new QPushButton(this.gridHeader);
            this.rosterViewButton.ObjectName  = "rosterViewButton";
            this.rosterViewButton.FocusPolicy = Qt.FocusPolicy.TabFocus;
            this.rosterViewButton.ToolTip     = "Change view options";
            this.rosterViewButton.Text        = "";
            this.rosterViewButton.Flat        = true;
            horizontalLayout_6.AddWidget(this.rosterViewButton);
            this.addFriendButton             = new QPushButton(this.gridHeader);
            this.addFriendButton.ObjectName  = "addFriendButton";
            this.addFriendButton.FocusPolicy = Qt.FocusPolicy.TabFocus;
            this.addFriendButton.ToolTip     = "Add & Invite new friends";
            this.addFriendButton.Text        = "";
            this.addFriendButton.Flat        = true;
            horizontalLayout_6.AddWidget(this.addFriendButton);
            verticalLayout_4.AddWidget(this.gridHeader);
            this.friendSearchContainer            = new QWidget(this.friendsTab);
            this.friendSearchContainer.ObjectName = "friendSearchContainer";
            QHBoxLayout horizontalLayout;

            horizontalLayout                     = new QHBoxLayout(this.friendSearchContainer);
            horizontalLayout.Spacing             = 0;
            horizontalLayout.Margin              = 3;
            this.friendSearchLineEdit            = new QLineEdit(this.friendSearchContainer);
            this.friendSearchLineEdit.ObjectName = "friendSearchLineEdit";
            horizontalLayout.AddWidget(this.friendSearchLineEdit);
            verticalLayout_4.AddWidget(this.friendSearchContainer);
            this.rosterGrid             = new Synapse.QtClient.Widgets.AvatarGrid <Synapse.UI.RosterItem>(this.friendsTab);
            this.rosterGrid.ObjectName  = "rosterGrid";
            this.rosterGrid.FocusPolicy = Qt.FocusPolicy.StrongFocus;
            this.rosterGrid.FrameShape  = QFrame.Shape.NoFrame;
            this.rosterGrid.Alignment   = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignTop"));
            verticalLayout_4.AddWidget(this.rosterGrid);
            this.tabWidget.AddTab(this.friendsTab, "Friends");
            this.chatroomsTab            = new QWidget(this.tabWidget);
            this.chatroomsTab.ObjectName = "chatroomsTab";
            QVBoxLayout verticalLayout_3;

            verticalLayout_3               = new QVBoxLayout(this.chatroomsTab);
            verticalLayout_3.Spacing       = 0;
            verticalLayout_3.Margin        = 0;
            this.joinMucHeader             = new QFrame(this.chatroomsTab);
            this.joinMucHeader.ObjectName  = "joinMucHeader";
            this.joinMucHeader.FrameShape  = QFrame.Shape.NoFrame;
            this.joinMucHeader.FrameShadow = QFrame.Shadow.Raised;
            QHBoxLayout horizontalLayout_5;

            horizontalLayout_5         = new QHBoxLayout(this.joinMucHeader);
            horizontalLayout_5.Spacing = 3;
            horizontalLayout_5.Margin  = 3;
            this.label_7            = new QLabel(this.joinMucHeader);
            this.label_7.ObjectName = "label_7";
            QSizePolicy label_7_sizePolicy;

            label_7_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred);
            label_7_sizePolicy.SetVerticalStretch(0);
            label_7_sizePolicy.SetHorizontalStretch(0);
            label_7_sizePolicy.SetHeightForWidth(this.label_7.SizePolicy.HasHeightForWidth());
            this.label_7.SizePolicy = label_7_sizePolicy;
            this.label_7.Text       = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Bitstream Vera Sans'; font-size:9pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans';\">Join or Create Conference</p></body></html>";
            horizontalLayout_5.AddWidget(this.label_7);
            this.toggleJoinMucButton             = new QPushButton(this.joinMucHeader);
            this.toggleJoinMucButton.ObjectName  = "toggleJoinMucButton";
            this.toggleJoinMucButton.FocusPolicy = Qt.FocusPolicy.TabFocus;
            this.toggleJoinMucButton.Text        = "";
            this.toggleJoinMucButton.Flat        = true;
            horizontalLayout_5.AddWidget(this.toggleJoinMucButton);
            verticalLayout_3.AddWidget(this.joinMucHeader);
            this.joinMucContainer            = new QWidget(this.chatroomsTab);
            this.joinMucContainer.ObjectName = "joinMucContainer";
            QVBoxLayout verticalLayout_5;

            verticalLayout_5 = new QVBoxLayout(this.joinMucContainer);
            verticalLayout_5.SetContentsMargins(0, 0, 0, 6);
            QGridLayout gridLayout;

            gridLayout = new QGridLayout();
            verticalLayout_5.AddLayout(gridLayout);
            gridLayout.SetContentsMargins(6, 6, 6, 0);
            this.label_2            = new QLabel(this.joinMucContainer);
            this.label_2.ObjectName = "label_2";
            this.label_2.Text       = "Room:";
            gridLayout.AddWidget(this.label_2, 0, 0, 1, 1);
            this.label_5            = new QLabel(this.joinMucContainer);
            this.label_5.ObjectName = "label_5";
            this.label_5.Text       = "Server:";
            gridLayout.AddWidget(this.label_5, 1, 0, 1, 1);
            this.mucServerLineEdit            = new QLineEdit(this.joinMucContainer);
            this.mucServerLineEdit.ObjectName = "mucServerLineEdit";
            this.mucServerLineEdit.Text       = "conference.extremeboredom.net";
            gridLayout.AddWidget(this.mucServerLineEdit, 1, 1, 1, 1);
            this.mucRoomLineEdit            = new QLineEdit(this.joinMucContainer);
            this.mucRoomLineEdit.ObjectName = "mucRoomLineEdit";
            this.mucRoomLineEdit.Text       = "synapse";
            gridLayout.AddWidget(this.mucRoomLineEdit, 0, 1, 1, 1);
            this.label_6            = new QLabel(this.joinMucContainer);
            this.label_6.ObjectName = "label_6";
            this.label_6.Text       = "Nickname:";
            gridLayout.AddWidget(this.label_6, 2, 0, 1, 1);
            this.mucNicknameLineEdit            = new QLineEdit(this.joinMucContainer);
            this.mucNicknameLineEdit.ObjectName = "mucNicknameLineEdit";
            gridLayout.AddWidget(this.mucNicknameLineEdit, 2, 1, 1, 1);
            this.label            = new QLabel(this.joinMucContainer);
            this.label.ObjectName = "label";
            this.label.Text       = "Password:"******"mucPasswordLineEdit";
            gridLayout.AddWidget(this.mucPasswordLineEdit, 3, 1, 1, 1);
            QHBoxLayout horizontalLayout_4;

            horizontalLayout_4 = new QHBoxLayout();
            verticalLayout_5.AddLayout(horizontalLayout_4);
            horizontalLayout_4.SetContentsMargins(6, 0, 6, 0);
            this.pushButton            = new QPushButton(this.joinMucContainer);
            this.pushButton.ObjectName = "pushButton";
            this.pushButton.Text       = "Browse...";
            horizontalLayout_4.AddWidget(this.pushButton);
            QSpacerItem horizontalSpacer_3;

            horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout_4.AddItem(horizontalSpacer_3);
            this.m_JoinChatButton            = new QPushButton(this.joinMucContainer);
            this.m_JoinChatButton.ObjectName = "m_JoinChatButton";
            this.m_JoinChatButton.Text       = "Join";
            horizontalLayout_4.AddWidget(this.m_JoinChatButton);
            verticalLayout_3.AddWidget(this.joinMucContainer);
            this.yourMucsHeader             = new QFrame(this.chatroomsTab);
            this.yourMucsHeader.ObjectName  = "yourMucsHeader";
            this.yourMucsHeader.FrameShape  = QFrame.Shape.NoFrame;
            this.yourMucsHeader.FrameShadow = QFrame.Shadow.Raised;
            QHBoxLayout horizontalLayout_7;

            horizontalLayout_7         = new QHBoxLayout(this.yourMucsHeader);
            horizontalLayout_7.Spacing = 3;
            horizontalLayout_7.Margin  = 3;
            this.label_4            = new QLabel(this.yourMucsHeader);
            this.label_4.ObjectName = "label_4";
            QSizePolicy label_4_sizePolicy;

            label_4_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred);
            label_4_sizePolicy.SetVerticalStretch(0);
            label_4_sizePolicy.SetHorizontalStretch(0);
            label_4_sizePolicy.SetHeightForWidth(this.label_4.SizePolicy.HasHeightForWidth());
            this.label_4.SizePolicy = label_4_sizePolicy;
            this.label_4.Text       = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Bitstream Vera Sans'; font-size:9pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans';\">Your Conferences</p></body></html>";
            horizontalLayout_7.AddWidget(this.label_4);
            this.addMucBookmarkButton             = new QPushButton(this.yourMucsHeader);
            this.addMucBookmarkButton.ObjectName  = "addMucBookmarkButton";
            this.addMucBookmarkButton.FocusPolicy = Qt.FocusPolicy.TabFocus;
            this.addMucBookmarkButton.Text        = "";
            this.addMucBookmarkButton.Flat        = true;
            horizontalLayout_7.AddWidget(this.addMucBookmarkButton);
            verticalLayout_3.AddWidget(this.yourMucsHeader);
            this.mucTree              = new QTreeView(this.chatroomsTab);
            this.mucTree.ObjectName   = "mucTree";
            this.mucTree.FrameShape   = QFrame.Shape.NoFrame;
            this.mucTree.Animated     = true;
            this.mucTree.HeaderHidden = true;
            verticalLayout_3.AddWidget(this.mucTree);
            this.friendsMucsHeader             = new QFrame(this.chatroomsTab);
            this.friendsMucsHeader.ObjectName  = "friendsMucsHeader";
            this.friendsMucsHeader.FrameShape  = QFrame.Shape.NoFrame;
            this.friendsMucsHeader.FrameShadow = QFrame.Shadow.Raised;
            QHBoxLayout horizontalLayout_8;

            horizontalLayout_8         = new QHBoxLayout(this.friendsMucsHeader);
            horizontalLayout_8.Spacing = 3;
            horizontalLayout_8.Margin  = 3;
            this.label_3            = new QLabel(this.friendsMucsHeader);
            this.label_3.ObjectName = "label_3";
            this.label_3.Text       = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Bitstream Vera Sans'; font-size:9pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans';\">Friends' Conferences</p></body></html>";
            horizontalLayout_8.AddWidget(this.label_3);
            verticalLayout_3.AddWidget(this.friendsMucsHeader);
            this.friendsMucTree              = new QTreeView(this.chatroomsTab);
            this.friendsMucTree.ObjectName   = "friendsMucTree";
            this.friendsMucTree.FrameShape   = QFrame.Shape.NoFrame;
            this.friendsMucTree.Animated     = true;
            this.friendsMucTree.HeaderHidden = true;
            verticalLayout_3.AddWidget(this.friendsMucTree);
            this.tabWidget.AddTab(this.chatroomsTab, "Conferences");
            this.activityTab            = new QWidget(this.tabWidget);
            this.activityTab.ObjectName = "activityTab";
            QVBoxLayout verticalLayout;

            verticalLayout                 = new QVBoxLayout(this.activityTab);
            verticalLayout.Spacing         = 0;
            verticalLayout.sizeConstraint  = QLayout.SizeConstraint.SetDefaultConstraint;
            verticalLayout.Margin          = 0;
            this.activityHeader            = new QFrame(this.activityTab);
            this.activityHeader.ObjectName = "activityHeader";
            QSizePolicy activityHeader_sizePolicy;

            activityHeader_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            activityHeader_sizePolicy.SetVerticalStretch(0);
            activityHeader_sizePolicy.SetHorizontalStretch(0);
            activityHeader_sizePolicy.SetHeightForWidth(this.activityHeader.SizePolicy.HasHeightForWidth());
            this.activityHeader.SizePolicy  = activityHeader_sizePolicy;
            this.activityHeader.FrameShape  = QFrame.Shape.NoFrame;
            this.activityHeader.FrameShadow = QFrame.Shadow.Raised;
            QHBoxLayout horizontalLayout_9;

            horizontalLayout_9               = new QHBoxLayout(this.activityHeader);
            horizontalLayout_9.Spacing       = 3;
            horizontalLayout_9.Margin        = 3;
            this.m_ShoutButton               = new QPushButton(this.activityHeader);
            this.m_ShoutButton.ObjectName    = "m_ShoutButton";
            this.m_ShoutButton.FocusPolicy   = Qt.FocusPolicy.TabFocus;
            this.m_ShoutButton.StyleSheet    = "";
            this.m_ShoutButton.Text          = "Shout!";
            this.m_ShoutButton.Checkable     = true;
            this.m_ShoutButton.AutoExclusive = false;
            this.m_ShoutButton.Flat          = true;
            horizontalLayout_9.AddWidget(this.m_ShoutButton);
            this.m_PostLinkButton               = new QPushButton(this.activityHeader);
            this.m_PostLinkButton.ObjectName    = "m_PostLinkButton";
            this.m_PostLinkButton.FocusPolicy   = Qt.FocusPolicy.TabFocus;
            this.m_PostLinkButton.Text          = "Post Link";
            this.m_PostLinkButton.Checkable     = true;
            this.m_PostLinkButton.AutoExclusive = false;
            this.m_PostLinkButton.Flat          = true;
            horizontalLayout_9.AddWidget(this.m_PostLinkButton);
            this.m_PostFileButton               = new QPushButton(this.activityHeader);
            this.m_PostFileButton.ObjectName    = "m_PostFileButton";
            this.m_PostFileButton.FocusPolicy   = Qt.FocusPolicy.TabFocus;
            this.m_PostFileButton.Text          = "Post File";
            this.m_PostFileButton.Checkable     = true;
            this.m_PostFileButton.AutoExclusive = false;
            this.m_PostFileButton.Flat          = true;
            horizontalLayout_9.AddWidget(this.m_PostFileButton);
            QSpacerItem horizontalSpacer_2;

            horizontalSpacer_2 = new QSpacerItem(0, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout_9.AddItem(horizontalSpacer_2);
            this.feedFilterButton             = new QPushButton(this.activityHeader);
            this.feedFilterButton.ObjectName  = "feedFilterButton";
            this.feedFilterButton.FocusPolicy = Qt.FocusPolicy.TabFocus;
            this.feedFilterButton.Text        = "";
            this.feedFilterButton.Flat        = true;
            horizontalLayout_9.AddWidget(this.feedFilterButton);
            verticalLayout.AddWidget(this.activityHeader);
            this.shoutContainer            = new QWidget(this.activityTab);
            this.shoutContainer.ObjectName = "shoutContainer";
            QVBoxLayout verticalLayout_8;

            verticalLayout_8        = new QVBoxLayout(this.shoutContainer);
            verticalLayout_8.Margin = 6;
            QHBoxLayout horizontalLayout_2;

            horizontalLayout_2 = new QHBoxLayout();
            verticalLayout_8.AddLayout(horizontalLayout_2);
            this.shoutLineEdit            = new QLineEdit(this.shoutContainer);
            this.shoutLineEdit.ObjectName = "shoutLineEdit";
            this.shoutLineEdit.MaxLength  = 140;
            horizontalLayout_2.AddWidget(this.shoutLineEdit);
            this.shoutCharsLabel            = new QLabel(this.shoutContainer);
            this.shoutCharsLabel.ObjectName = "shoutCharsLabel";
            this.shoutCharsLabel.Text       = "140";
            horizontalLayout_2.AddWidget(this.shoutCharsLabel);
            this.shoutHandlersBox            = new QWidget(this.shoutContainer);
            this.shoutHandlersBox.ObjectName = "shoutHandlersBox";
            QHBoxLayout horizontalLayout_10;

            horizontalLayout_10        = new QHBoxLayout(this.shoutHandlersBox);
            horizontalLayout_10.Margin = 0;
            this.label_8            = new QLabel(this.shoutHandlersBox);
            this.label_8.ObjectName = "label_8";
            this.label_8.Text       = "Also Send To:";
            horizontalLayout_10.AddWidget(this.label_8);
            this.shoutHandlersContainer            = new QWidget(this.shoutHandlersBox);
            this.shoutHandlersContainer.ObjectName = "shoutHandlersContainer";
            QHBoxLayout horizontalLayout_11;

            horizontalLayout_11         = new QHBoxLayout(this.shoutHandlersContainer);
            horizontalLayout_11.Spacing = 3;
            horizontalLayout_11.Margin  = 0;
            horizontalLayout_10.AddWidget(this.shoutHandlersContainer);
            QSpacerItem horizontalSpacer_4;

            horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout_10.AddItem(horizontalSpacer_4);
            verticalLayout_8.AddWidget(this.shoutHandlersBox);
            QHBoxLayout horizontalLayout_3;

            horizontalLayout_3 = new QHBoxLayout();
            verticalLayout_8.AddLayout(horizontalLayout_3);
            QSpacerItem horizontalSpacer;

            horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout_3.AddItem(horizontalSpacer);
            this.sendShoutButton            = new QPushButton(this.shoutContainer);
            this.sendShoutButton.ObjectName = "sendShoutButton";
            this.sendShoutButton.Text       = "Shout!";
            horizontalLayout_3.AddWidget(this.sendShoutButton);
            verticalLayout.AddWidget(this.shoutContainer);
            this.m_ActivityWebView            = new Synapse.QtClient.Widgets.StubbornWebView(this.activityTab);
            this.m_ActivityWebView.ObjectName = "m_ActivityWebView";
            QSizePolicy m_ActivityWebView_sizePolicy;

            m_ActivityWebView_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Expanding);
            m_ActivityWebView_sizePolicy.SetVerticalStretch(0);
            m_ActivityWebView_sizePolicy.SetHorizontalStretch(0);
            m_ActivityWebView_sizePolicy.SetHeightForWidth(this.m_ActivityWebView.SizePolicy.HasHeightForWidth());
            this.m_ActivityWebView.SizePolicy = m_ActivityWebView_sizePolicy;
            this.m_ActivityWebView.Url        = new QUrl("about:blank");
            verticalLayout.AddWidget(this.m_ActivityWebView);
            this.tabWidget.AddTab(this.activityTab, "Activity");
            this.splitter.AddWidget(this.widget);
            QObject.Connect(m_ShoutButton, Qt.SIGNAL("toggled(bool)"), shoutContainer, Qt.SLOT("setShown(bool)"));
            QObject.Connect(mucRoomLineEdit,Qt.SIGNAL("returnPressed()"),m_JoinChatButton,Qt.SLOT("click()"));
            QObject.Connect(mucPasswordLineEdit,Qt.SIGNAL("returnPressed()"),m_JoinChatButton,Qt.SLOT("click()"));
            QObject.Connect(mucServerLineEdit,Qt.SIGNAL("returnPressed()"),m_JoinChatButton,Qt.SLOT("click()"));
            QObject.Connect(mucNicknameLineEdit,Qt.SIGNAL("returnPressed()"),m_JoinChatButton,Qt.SLOT("click()"));
            QMetaObject.ConnectSlotsByName(this);
            this.label_2.SetBuddy(mucRoomLineEdit);
            this.label_5.SetBuddy(mucServerLineEdit);
            this.label_6.SetBuddy(mucNicknameLineEdit);
            this.label.SetBuddy(mucPasswordLineEdit);
        }
示例#24
0
        public void LoadTheme(string themeName, string variantName)
        {
            if (this.ChatHandler == null)
            {
                throw new InvalidOperationException("Set ChatHandler first");
            }

            string themeDirectory = System.IO.Path.Combine(ThemesDirectory, themeName) + ".AdiumMessageStyle";

            if (!Directory.Exists(themeDirectory))
            {
                throw new DirectoryNotFoundException(themeDirectory);
            }

            m_StylePath = Util.JoinPath(themeDirectory, "Contents", "Resources");

            string plistPath = Util.JoinPath(themeDirectory, "Contents", "Info.plist");

            // XXX: Add additional checks for other required files.
            if (!File.Exists(plistPath))
            {
                throw new Exception("Missing required theme file: Info.plist");
            }

            m_StyleInfo = new PList(plistPath);

            // Default Behavior
            m_AllowsCustomBackground = true;
            m_AllowsUserIcons        = true;

            m_StyleVersion = m_StyleInfo.GetInt("MessageViewVersion");

            // Pre-fetch our templates
            LoadTemplates();

            // Style flags
            m_AllowsCustomBackground       = !m_StyleInfo.Get <bool>("DisableCustomBackground");
            m_TransparentDefaultBackground = m_StyleInfo.Get <bool>("DefaultBackgroundIsTransparent");
            if (m_TransparentDefaultBackground)
            {
                // FIXME:
                Console.WriteLine("Transparent background not supported");
            }

            m_CombineConsecutive = !m_StyleInfo.Get <bool>("DisableCombineConsecutive");

            if (m_StyleInfo.ContainsKey("ShowsUserIcons"))
            {
                m_AllowsUserIcons = m_StyleInfo.Get <bool>("ShowsUserIcons");
            }

            // User icon masking
            var maskName = m_StyleInfo.Get <string>("ImageMask");

            if (!String.IsNullOrEmpty(maskName))
            {
                // FIXME:
                Console.WriteLine("ImageMask not supported");
            }

            m_AllowsColors = m_StyleInfo.Get <bool>("AllowTextColors");
            if (!m_AllowsColors)
            {
                Console.WriteLine("AllowTextColors not supported");
            }

            // FIXME: Need to selectively show certain actions depending on what's under the cursor.
            //this.AddAction(this.PageAction(QWebPage.WebAction.OpenLink));
            //this.AddAction(this.PageAction(QWebPage.WebAction.CopyLinkToClipboard));
            //this.AddAction(this.PageAction(QWebPage.WebAction.CopyImageToClipboard));
            //this.AddSeparator();
            QAction copyAction = this.PageAction(QWebPage.WebAction.Copy);

            copyAction.SetShortcuts(QKeySequence.StandardKey.Copy);
            this.AddAction(copyAction);
            this.AddAction(this.PageAction(QWebPage.WebAction.InspectElement));

            // Create the base template
            string baseUri               = "file://" + m_StylePath + "/";
            string mainCssPath           = "main.css";
            string variantCssPath        = PathForVariant(variantName);
            var    formattedBaseTemplate = FormatBaseTemplate(baseUri, mainCssPath, variantCssPath);

            base.Page().MainFrame().SetHtml(formattedBaseTemplate, themeDirectory);

            QObject.Connect(this.Page().MainFrame(), Qt.SIGNAL("javaScriptWindowObjectCleared()"), HandleJavaScriptWindowObjectCleared);

            if (ConversationWidget.ThemesDirectory == null)
            {
                throw new Exception("Set ThemesDirectory first");
            }

            this.ContextMenuPolicy = ContextMenuPolicy.ActionsContextMenu;

            this.Page().linkDelegationPolicy = QWebPage.LinkDelegationPolicy.DelegateAllLinks;
            QObject.Connect <QUrl>(this, Qt.SIGNAL("linkClicked(QUrl)"), HandleLinkClicked);

            m_ThemeLoaded = true;

            HandleJavaScriptWindowObjectCleared();
        }
示例#25
0
        public PreferencesWindow()
        {
            SetupUi();

            // Tweak the account list
            accountsList.HorizontalHeader().Hide();
            accountsList.VerticalHeader().Hide();
            accountsList.SetModel(new AccountsItemModel(accountsList));
            accountsList.SetItemDelegate(new PaddedItemDelegate(accountsList));
            accountsList.HorizontalHeader().SetResizeMode(QHeaderView.ResizeMode.Stretch);
            accountsList.HorizontalHeader().SetResizeMode(1, QHeaderView.ResizeMode.ResizeToContents);

            // Set up fake chat handler for preview
            messagePreviewWebView.ChatHandler = new FakeChatHandler();

            QObject.Connect <bool>(messagePreviewWebView, Qt.SIGNAL("loadFinished(bool)"), delegate {
                ((FakeChatHandler)messagePreviewWebView.ChatHandler).Go();
            });

            // Load Settings
            var settings = ServiceManager.Get <SettingsService>();

            showHeaderCheckBox.Checked  = settings.Get <bool>("MessageShowHeader");
            showAvatarsCheckBox.Checked = settings.Get <bool>("MessageShowAvatars");

            string themeName        = settings.Get <string>("MessageTheme");
            string themeVariantName = settings.Get <string>("MessageThemeVariant");

            foreach (var pair in ConversationWidget.AllThemes)
            {
                messageStyleCombo.AddItem(pair.Value.Get <string>("CFBundleName"), pair.Key);
            }

            // Select the current style/variant
            messageStyleCombo.CurrentIndex        = messageStyleCombo.FindData(themeName);
            messageStyleVariantCombo.CurrentIndex = messageStyleVariantCombo.FindText(themeVariantName);

            messagePreviewWebView.ChatHandler.NewContent += delegate(IChatHandler handler, AbstractChatContent content) {
                messagePreviewWebView.AppendContent(content, false, false, false);
            };

            // Tweak the extensions list
            extensionsList.HorizontalHeader().Hide();
            extensionsList.VerticalHeader().Hide();
            extensionsList.SetModel(new ExtensionsItemModel(extensionsList));
            extensionsList.SetItemDelegate(new PaddedItemDelegate(extensionsList));
            extensionsList.HorizontalHeader().SetResizeMode(QHeaderView.ResizeMode.Stretch);
            QObject.Connect(extensionsList, Qt.SIGNAL("activated(const QModelIndex &)"), delegate(QModelIndex index) {
                Addin addin = (Addin)index.InternalPointer();

                var nodes = AddinManager.GetExtensionNodes("/Synapse/QtClient/AddinPreferencesDialogs");
                foreach (QWidgetTypeExtensionNode node in nodes)
                {
                    if (addin.Id.StartsWith(node.Addin.Id))
                    {
                        QDialog dialog = (QDialog)node.CreateInstance(this);
                        dialog.Show();
                        dialog.Exec();
                        break;
                    }
                }
            });

            m_Loaded = true;
            RefreshMessagePreview();
        }
示例#26
0
        public GlobalActions()
        {
            m_AccountsMenu = new QMenu();

            m_QuitAction          = new QAction(Gui.LoadIcon("application-exit"), "Quit", this);
            m_QuitAction.Shortcut = new QKeySequence("Ctrl+Q");
            QObject.Connect(m_QuitAction, Qt.SIGNAL("triggered()"), HandleQuitActionTriggered);

            m_ShowPreferencesAction = new QAction(Gui.LoadIcon("preferences-desktop"), "Preferences", this);
            QObject.Connect(m_ShowPreferencesAction, Qt.SIGNAL("triggered()"), HandleShowPreferencesActionTriggered);

            m_SendFeedbackAction = new QAction("Send Feedback...", this);
            QObject.Connect(m_SendFeedbackAction, Qt.SIGNAL("triggered()"), HandleSendFeedbackActionTriggered);

            m_ShowBrowserAction = new QAction(Gui.LoadIcon("system-search"), "Discover Services...", this);
            QObject.Connect(m_ShowBrowserAction, Qt.SIGNAL("triggered()"), HandleShowBrowserActionTriggered);

            m_NewMessageAction = new QAction(Gui.LoadIcon("document-new"), "New Message...", this);

            m_JoinMucAction = new QAction(Gui.LoadIcon("internet-group-chat"), "Create/Join Conference...", this);

            m_EditProfileAction = new QAction(Gui.LoadIcon("user-info"), "Edit Profile...", this);
            QObject.Connect(m_EditProfileAction, Qt.SIGNAL("triggered()"), HandleEditProfileActionTriggered);

            m_AboutAction = new QAction(Gui.LoadIcon("help-about"), "About", this);
            QObject.Connect(m_AboutAction, Qt.SIGNAL("triggered()"), HandleAboutActionTriggered);

            m_PresenceMenu = new QMenu();

            QActionGroup group = new QActionGroup(this);

            group.Exclusive = true;

            m_AvailableAction = m_PresenceMenu.AddAction("Available");
            group.AddAction(m_AvailableAction);
            m_AvailableAction.Checkable = true;

            m_FreeToChatAction = m_PresenceMenu.AddAction("Free To Chat");
            group.AddAction(m_FreeToChatAction);
            m_FreeToChatAction.Checkable = true;

            m_AwayAction = m_PresenceMenu.AddAction("Away");
            group.AddAction(m_AwayAction);
            m_AwayAction.Checkable = true;

            m_ExtendedAwayAction = m_PresenceMenu.AddAction("Extended Away");
            group.AddAction(m_ExtendedAwayAction);
            m_ExtendedAwayAction.Checkable = true;

            m_DoNotDisturbAction = m_PresenceMenu.AddAction("Do Not Disturb");
            group.AddAction(m_DoNotDisturbAction);
            m_DoNotDisturbAction.Checkable = true;

            m_PresenceMenu.AddSeparator();

            m_OfflineAction = m_PresenceMenu.AddAction("Offline");
            group.AddAction(m_OfflineAction);
            m_OfflineAction.Checkable = true;

            m_ChangeStatusAction = new QAction("Change Status", this);
            m_ChangeStatusAction.SetMenu(m_PresenceMenu);
        }
示例#27
0
            public NotificationItemWidget(IActivityFeedItem item, QWidget parent) : base(parent)
            {
                m_Item = item;
                item.ActionTriggered += HandleActionTriggered;

                QHBoxLayout layout = new QHBoxLayout(this);

                layout.Margin = 3;

                var service = ServiceManager.Get <ActivityFeedService>();
                ActivityFeedItemTemplate template = service.Templates[item.Type];

                var builder = new StringBuilder();

                builder.AppendFormat("<span style=\"font-size: 9pt;\">");
                builder.AppendFormat("<b>{0}</b>", item.FromName);
                builder.Append(" ");
                builder.AppendFormat(template.SingularText, "<b>{0}</b>".FormatWith(item.ActionItem));

                if (!String.IsNullOrEmpty(item.Content))
                {
                    builder.Append(":");
                    builder.Append("<p style=\"margin-left: 20px; margin-top: 0px; margin-bottom: 0px;\">");
                    builder.Append(item.Content);
                    builder.Append("</p>");
                }
                else
                {
                    builder.Append(".");
                }

                if (template.Actions != null && template.Actions.Length > 0)
                {
                    builder.Append("<br/>");
                    foreach (var action in template.Actions)
                    {
                        builder.AppendFormat("<a style=\"color: white\" href=\"{0}\">{1}</a> ", action.Name, action.Label);
                    }
                }

                builder.Append("</span>");

                QLabel label = new QLabel(builder.ToString(), this);

                QObject.Connect(label, Qt.SIGNAL("linkActivated(const QString &)"), delegate(string link) {
                    m_Item.TriggerAction(link);
                });

                label.MinimumWidth = 1;
                label.WordWrap     = true;
                layout.AddWidget(label, 1);

                if (item is XmppActivityFeedItem)
                {
                    label.ToolTip = String.Format("From: {0}", ((XmppActivityFeedItem)item).FromJid);
                }

                QPushButton closeButton = new QPushButton(this);

                QObject.Connect(closeButton, Qt.SIGNAL("clicked()"), delegate {
                    Close();
                });
                closeButton.icon = Gui.LoadIcon("window-close", 16);
                layout.AddWidget(closeButton, 0);
            }
示例#28
0
        protected void SetupUi()
        {
            base.ObjectName  = "ErrorDialog";
            this.Geometry    = new QRect(0, 0, 400, 322);
            this.WindowTitle = "ErrorDialog";
            QVBoxLayout verticalLayout_2;

            verticalLayout_2 = new QVBoxLayout(this);
            verticalLayout_2.sizeConstraint = QLayout.SizeConstraint.SetFixedSize;
            verticalLayout_2.Margin         = 6;
            QHBoxLayout horizontalLayout_2;

            horizontalLayout_2 = new QHBoxLayout();
            verticalLayout_2.AddLayout(horizontalLayout_2);
            horizontalLayout_2.sizeConstraint = QLayout.SizeConstraint.SetFixedSize;
            this.iconLabel            = new QLabel(this);
            this.iconLabel.ObjectName = "iconLabel";
            QSizePolicy iconLabel_sizePolicy;

            iconLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            iconLabel_sizePolicy.SetVerticalStretch(0);
            iconLabel_sizePolicy.SetHorizontalStretch(0);
            iconLabel_sizePolicy.SetHeightForWidth(this.iconLabel.SizePolicy.HasHeightForWidth());
            this.iconLabel.SizePolicy  = iconLabel_sizePolicy;
            this.iconLabel.MinimumSize = new QSize(48, 48);
            this.iconLabel.Text        = "";
            this.iconLabel.Alignment   = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignTop"));
            horizontalLayout_2.AddWidget(this.iconLabel);
            QVBoxLayout verticalLayout;

            verticalLayout = new QVBoxLayout();
            horizontalLayout_2.AddLayout(verticalLayout);
            verticalLayout.Spacing        = 6;
            verticalLayout.sizeConstraint = QLayout.SizeConstraint.SetFixedSize;
            this.titleLabel            = new QLabel(this);
            this.titleLabel.ObjectName = "titleLabel";
            QSizePolicy titleLabel_sizePolicy;

            titleLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            titleLabel_sizePolicy.SetVerticalStretch(0);
            titleLabel_sizePolicy.SetHorizontalStretch(0);
            titleLabel_sizePolicy.SetHeightForWidth(this.titleLabel.SizePolicy.HasHeightForWidth());
            this.titleLabel.SizePolicy = titleLabel_sizePolicy;
            this.titleLabel.Text       = "<b>Title</b>";
            this.titleLabel.WordWrap   = true;
            verticalLayout.AddWidget(this.titleLabel);
            this.messageLabel            = new QLabel(this);
            this.messageLabel.ObjectName = "messageLabel";
            QSizePolicy messageLabel_sizePolicy;

            messageLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            messageLabel_sizePolicy.SetVerticalStretch(0);
            messageLabel_sizePolicy.SetHorizontalStretch(0);
            messageLabel_sizePolicy.SetHeightForWidth(this.messageLabel.SizePolicy.HasHeightForWidth());
            this.messageLabel.SizePolicy = messageLabel_sizePolicy;
            this.messageLabel.Text       = "Message";
            this.messageLabel.WordWrap   = true;
            verticalLayout.AddWidget(this.messageLabel);
            this.showDetailsButtonContainer            = new QWidget(this);
            this.showDetailsButtonContainer.ObjectName = "showDetailsButtonContainer";
            QSizePolicy showDetailsButtonContainer_sizePolicy;

            showDetailsButtonContainer_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            showDetailsButtonContainer_sizePolicy.SetVerticalStretch(0);
            showDetailsButtonContainer_sizePolicy.SetHorizontalStretch(0);
            showDetailsButtonContainer_sizePolicy.SetHeightForWidth(this.showDetailsButtonContainer.SizePolicy.HasHeightForWidth());
            this.showDetailsButtonContainer.SizePolicy = showDetailsButtonContainer_sizePolicy;
            QHBoxLayout horizontalLayout;

            horizontalLayout                  = new QHBoxLayout(this.showDetailsButtonContainer);
            horizontalLayout.Margin           = 0;
            this.showDetailsButton            = new QPushButton(this.showDetailsButtonContainer);
            this.showDetailsButton.ObjectName = "showDetailsButton";
            this.showDetailsButton.Text       = "Show Details";
            this.showDetailsButton.Checkable  = true;
            horizontalLayout.AddWidget(this.showDetailsButton);
            QSpacerItem horizontalSpacer;

            horizontalSpacer = new QSpacerItem(223, 17, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout.AddItem(horizontalSpacer);
            verticalLayout.AddWidget(this.showDetailsButtonContainer);
            this.detailsTextEdit            = new QPlainTextEdit(this);
            this.detailsTextEdit.ObjectName = "detailsTextEdit";
            this.detailsTextEdit.ReadOnly   = true;
            verticalLayout.AddWidget(this.detailsTextEdit);
            this.buttonBox                 = new QDialogButtonBox(this);
            this.buttonBox.ObjectName      = "buttonBox";
            this.buttonBox.Orientation     = Qt.Orientation.Horizontal;
            this.buttonBox.StandardButtons = global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Close");
            verticalLayout_2.AddWidget(this.buttonBox);
            QObject.Connect(buttonBox, Qt.SIGNAL("accepted()"), this, Qt.SLOT("accept()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("rejected()"),this,Qt.SLOT("reject()"));
            QObject.Connect(showDetailsButton,Qt.SIGNAL("toggled(bool)"),detailsTextEdit,Qt.SLOT("setVisible(bool)"));
            QMetaObject.ConnectSlotsByName(this);
        }
示例#29
0
        protected void SetupUi()
        {
            base.ObjectName     = "TwitterConfigurationDialog";
            this.WindowModality = Qt.WindowModality.NonModal;
            this.Geometry       = new QRect(0, 0, 313, 137);
            this.WindowTitle    = "Twitter Configuration";
            this.Modal          = true;
            QVBoxLayout verticalLayout;

            verticalLayout        = new QVBoxLayout(this);
            verticalLayout.Margin = 6;
            QHBoxLayout horizontalLayout;

            horizontalLayout = new QHBoxLayout();
            verticalLayout.AddLayout(horizontalLayout);
            this.logoLabel             = new QLabel(this);
            this.logoLabel.ObjectName  = "logoLabel";
            this.logoLabel.MinimumSize = new QSize(48, 0);
            this.logoLabel.Text        = "";
            horizontalLayout.AddWidget(this.logoLabel);
            QVBoxLayout verticalLayout_2;

            verticalLayout_2 = new QVBoxLayout();
            horizontalLayout.AddLayout(verticalLayout_2);
            this.label            = new QLabel(this);
            this.label.ObjectName = "label";
            QSizePolicy label_sizePolicy;

            label_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            label_sizePolicy.SetVerticalStretch(0);
            label_sizePolicy.SetHorizontalStretch(0);
            label_sizePolicy.SetHeightForWidth(this.label.SizePolicy.HasHeightForWidth());
            this.label.SizePolicy = label_sizePolicy;
            this.label.Text       = "Enter your Twitter account information:";
            verticalLayout_2.AddWidget(this.label);
            QGridLayout gridLayout_2;

            gridLayout_2 = new QGridLayout();
            verticalLayout_2.AddLayout(gridLayout_2);
            gridLayout_2.sizeConstraint = QLayout.SizeConstraint.SetMaximumSize;
            this.label_2            = new QLabel(this);
            this.label_2.ObjectName = "label_2";
            this.label_2.Text       = "Username:"******"usernameLineEdit";
            gridLayout_2.AddWidget(this.usernameLineEdit, 0, 1, 1, 1);
            this.label_3            = new QLabel(this);
            this.label_3.ObjectName = "label_3";
            this.label_3.Text       = "Password:"******"passwordLineEdit";
            this.passwordLineEdit.echoMode   = QLineEdit.EchoMode.Password;
            gridLayout_2.AddWidget(this.passwordLineEdit, 1, 1, 1, 1);
            this.buttonBox                 = new QDialogButtonBox(this);
            this.buttonBox.ObjectName      = "buttonBox";
            this.buttonBox.Orientation     = Qt.Orientation.Horizontal;
            this.buttonBox.StandardButtons = (global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Cancel") | global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Ok"));
            verticalLayout.AddWidget(this.buttonBox);
            QObject.Connect(buttonBox, Qt.SIGNAL("accepted()"), this, Qt.SLOT("accept()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("rejected()"),this,Qt.SLOT("reject()"));
            QMetaObject.ConnectSlotsByName(this);
        }
示例#30
0
 protected void SetupUi() {
     base.ObjectName = "EditAccountDialog";
     this.Geometry = new QRect(0, 0, 343, 261);
     this.WindowTitle = "Edit Account";
     this.Modal = true;
     QVBoxLayout verticalLayout;
     verticalLayout = new QVBoxLayout(this);
     verticalLayout.Margin = 6;
     this.tabWidget = new QTabWidget(this);
     this.tabWidget.ObjectName = "tabWidget";
     this.tabWidget.Enabled = true;
     this.tabWidget.CurrentIndex = 3;
     verticalLayout.AddWidget(this.tabWidget);
     this.tab = new QWidget(this.tabWidget);
     this.tab.ObjectName = "tab";
     QVBoxLayout verticalLayout_2;
     verticalLayout_2 = new QVBoxLayout(this.tab);
     verticalLayout_2.Margin = 6;
     QFormLayout formLayout;
     formLayout = new QFormLayout();
     verticalLayout_2.AddLayout(formLayout);
     this.label = new QLabel(this.tab);
     this.label.ObjectName = "label";
     this.label.Text = "Jabber ID:";
     formLayout.SetWidget(0, QFormLayout.ItemRole.LabelRole, this.label);
     this.jidLineEdit = new QLineEdit(this.tab);
     this.jidLineEdit.ObjectName = "jidLineEdit";
     formLayout.SetWidget(0, QFormLayout.ItemRole.FieldRole, this.jidLineEdit);
     this.label_2 = new QLabel(this.tab);
     this.label_2.ObjectName = "label_2";
     this.label_2.Text = "Password:"******"passwordLineEdit";
     this.passwordLineEdit.echoMode = QLineEdit.EchoMode.Password;
     formLayout.SetWidget(1, QFormLayout.ItemRole.FieldRole, this.passwordLineEdit);
     this.label_3 = new QLabel(this.tab);
     this.label_3.ObjectName = "label_3";
     this.label_3.Text = "Resource:";
     formLayout.SetWidget(2, QFormLayout.ItemRole.LabelRole, this.label_3);
     this.resourceCombo = new QComboBox(this.tab);
     this.resourceCombo.ObjectName = "resourceCombo";
     this.resourceCombo.Editable = true;
     formLayout.SetWidget(2, QFormLayout.ItemRole.FieldRole, this.resourceCombo);
     this.resourceCombo.InsertItems(0, new System.Collections.Generic.List<string>(new string[] {
                     "Home Computer",
                     "Work Computer",
                     "Laptop"}));
     QSpacerItem verticalSpacer;
     verticalSpacer = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
     verticalLayout_2.AddItem(verticalSpacer);
     this.widget = new QWidget(this.tab);
     this.widget.ObjectName = "widget";
     QHBoxLayout horizontalLayout;
     horizontalLayout = new QHBoxLayout(this.widget);
     horizontalLayout.Margin = 0;
     this.pushButton = new QPushButton(this.widget);
     this.pushButton.ObjectName = "pushButton";
     this.pushButton.Enabled = false;
     this.pushButton.Text = "Change Password...";
     horizontalLayout.AddWidget(this.pushButton);
     QSpacerItem horizontalSpacer;
     horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
     horizontalLayout.AddItem(horizontalSpacer);
     verticalLayout_2.AddWidget(this.widget);
     this.tabWidget.AddTab(this.tab, "Account");
     this.tab_4 = new QWidget(this.tabWidget);
     this.tab_4.ObjectName = "tab_4";
     QVBoxLayout verticalLayout_3;
     verticalLayout_3 = new QVBoxLayout(this.tab_4);
     verticalLayout_3.Margin = 6;
     this.label_5 = new QLabel(this.tab_4);
     this.label_5.ObjectName = "label_5";
     this.label_5.Text = "Synapse will attempt to automatically discover your connect server if you leave this field blank.";
     this.label_5.WordWrap = true;
     verticalLayout_3.AddWidget(this.label_5);
     QFormLayout formLayout_2;
     formLayout_2 = new QFormLayout();
     verticalLayout_3.AddLayout(formLayout_2);
     this.label_4 = new QLabel(this.tab_4);
     this.label_4.ObjectName = "label_4";
     this.label_4.Text = "Connect Server:";
     formLayout_2.SetWidget(0, QFormLayout.ItemRole.LabelRole, this.label_4);
     this.serverLineEdit = new QLineEdit(this.tab_4);
     this.serverLineEdit.ObjectName = "serverLineEdit";
     formLayout_2.SetWidget(0, QFormLayout.ItemRole.FieldRole, this.serverLineEdit);
     this.label_6 = new QLabel(this.tab_4);
     this.label_6.ObjectName = "label_6";
     this.label_6.Text = "Port:";
     formLayout_2.SetWidget(1, QFormLayout.ItemRole.LabelRole, this.label_6);
     this.portSpinBox = new QSpinBox(this.tab_4);
     this.portSpinBox.ObjectName = "portSpinBox";
     this.portSpinBox.Maximum = 9999999;
     this.portSpinBox.SingleStep = 1;
     this.portSpinBox.Value = 5222;
     formLayout_2.SetWidget(1, QFormLayout.ItemRole.FieldRole, this.portSpinBox);
     this.label_7 = new QLabel(this.tab_4);
     this.label_7.ObjectName = "label_7";
     this.label_7.Enabled = false;
     this.label_7.Text = "Note that the server must support TLS encryption.";
     this.label_7.Alignment = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignVCenter"));
     verticalLayout_3.AddWidget(this.label_7);
     QSpacerItem verticalSpacer_2;
     verticalSpacer_2 = new QSpacerItem(20, 170, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
     verticalLayout_3.AddItem(verticalSpacer_2);
     this.tabWidget.AddTab(this.tab_4, "Server");
     this.tab_2 = new QWidget(this.tabWidget);
     this.tab_2.ObjectName = "tab_2";
     QVBoxLayout verticalLayout_4;
     verticalLayout_4 = new QVBoxLayout(this.tab_2);
     verticalLayout_4.Margin = 6;
     this.autoConnectCheckBox = new QCheckBox(this.tab_2);
     this.autoConnectCheckBox.ObjectName = "autoConnectCheckBox";
     this.autoConnectCheckBox.Text = "Connect Automatically";
     verticalLayout_4.AddWidget(this.autoConnectCheckBox);
     QSpacerItem verticalSpacer_3;
     verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
     verticalLayout_4.AddItem(verticalSpacer_3);
     this.tabWidget.AddTab(this.tab_2, "Options");
     this.tab_3 = new QWidget(this.tabWidget);
     this.tab_3.ObjectName = "tab_3";
     QVBoxLayout verticalLayout_5;
     verticalLayout_5 = new QVBoxLayout(this.tab_3);
     verticalLayout_5.Margin = 6;
     QFormLayout formLayout_3;
     formLayout_3 = new QFormLayout();
     verticalLayout_5.AddLayout(formLayout_3);
     formLayout_3.fieldGrowthPolicy = QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow;
     this.label_9 = new QLabel(this.tab_3);
     this.label_9.ObjectName = "label_9";
     this.label_9.Text = "&Type:";
     formLayout_3.SetWidget(0, QFormLayout.ItemRole.LabelRole, this.label_9);
     this.comboBox = new QComboBox(this.tab_3);
     this.comboBox.ObjectName = "comboBox";
     formLayout_3.SetWidget(0, QFormLayout.ItemRole.FieldRole, this.comboBox);
     this.comboBox.InsertItems(0, new System.Collections.Generic.List<string>(new string[] {
                     "Use System Settings (DOES NOT WORK)",
                     "No Proxy",
                     "HTTP",
                     "SOCKS4",
                     "SOCKS5"}));
     this.proxyHostLabel = new QLabel(this.tab_3);
     this.proxyHostLabel.ObjectName = "proxyHostLabel";
     this.proxyHostLabel.Enabled = true;
     this.proxyHostLabel.Text = "&Host:";
     formLayout_3.SetWidget(2, QFormLayout.ItemRole.LabelRole, this.proxyHostLabel);
     this.proxyHostLineEdit = new QLineEdit(this.tab_3);
     this.proxyHostLineEdit.ObjectName = "proxyHostLineEdit";
     this.proxyHostLineEdit.Enabled = true;
     formLayout_3.SetWidget(2, QFormLayout.ItemRole.FieldRole, this.proxyHostLineEdit);
     this.proxyPortLabel = new QLabel(this.tab_3);
     this.proxyPortLabel.ObjectName = "proxyPortLabel";
     this.proxyPortLabel.Enabled = true;
     this.proxyPortLabel.Text = "&Port:";
     formLayout_3.SetWidget(3, QFormLayout.ItemRole.LabelRole, this.proxyPortLabel);
     this.proxyPortSpinBox = new QSpinBox(this.tab_3);
     this.proxyPortSpinBox.ObjectName = "proxyPortSpinBox";
     this.proxyPortSpinBox.Enabled = true;
     this.proxyPortSpinBox.Maximum = 66666;
     formLayout_3.SetWidget(3, QFormLayout.ItemRole.FieldRole, this.proxyPortSpinBox);
     this.proxyUserLabel = new QLabel(this.tab_3);
     this.proxyUserLabel.ObjectName = "proxyUserLabel";
     this.proxyUserLabel.Enabled = true;
     this.proxyUserLabel.Text = "&Username:"******"proxyUserLineEdit";
     this.proxyUserLineEdit.Enabled = true;
     formLayout_3.SetWidget(4, QFormLayout.ItemRole.FieldRole, this.proxyUserLineEdit);
     this.proxyPassLabel = new QLabel(this.tab_3);
     this.proxyPassLabel.ObjectName = "proxyPassLabel";
     this.proxyPassLabel.Enabled = true;
     this.proxyPassLabel.Text = "Pa&ssword:";
     formLayout_3.SetWidget(5, QFormLayout.ItemRole.LabelRole, this.proxyPassLabel);
     this.proxyPassLineEdit = new QLineEdit(this.tab_3);
     this.proxyPassLineEdit.ObjectName = "proxyPassLineEdit";
     this.proxyPassLineEdit.Enabled = true;
     formLayout_3.SetWidget(5, QFormLayout.ItemRole.FieldRole, this.proxyPassLineEdit);
     this.line = new QFrame(this.tab_3);
     this.line.ObjectName = "line";
     this.line.FrameShape = QFrame.Shape.HLine;
     this.line.FrameShadow = QFrame.Shadow.Sunken;
     formLayout_3.SetWidget(1, QFormLayout.ItemRole.LabelRole, this.line);
     QSpacerItem verticalSpacer_4;
     verticalSpacer_4 = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
     verticalLayout_5.AddItem(verticalSpacer_4);
     this.tabWidget.AddTab(this.tab_3, "Proxy");
     this.buttonBox = new QDialogButtonBox(this);
     this.buttonBox.ObjectName = "buttonBox";
     this.buttonBox.Orientation = Qt.Orientation.Horizontal;
     this.buttonBox.StandardButtons = (global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Cancel") | global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Ok"));
     verticalLayout.AddWidget(this.buttonBox);
     QObject.Connect(buttonBox, Qt.SIGNAL("accepted()"), this, Qt.SLOT("accept()"));
     QObject.Connect(buttonBox, Qt.SIGNAL("rejected()"), this, Qt.SLOT("reject()"));
     QMetaObject.ConnectSlotsByName(this);
     this.label_9.SetBuddy(comboBox);
     this.proxyHostLabel.SetBuddy(proxyHostLineEdit);
     this.proxyPortLabel.SetBuddy(proxyPortSpinBox);
     this.proxyUserLabel.SetBuddy(proxyUserLineEdit);
     this.proxyPassLabel.SetBuddy(proxyPassLineEdit);
 }