Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 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"));
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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);
            }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
        public static void Main(string[] args)
        {
            using (QApplication app = new QApplication()) {
                using (QPushButton hello = new QPushButton("Hello world!")) {
                    hello.Resize(200, 30);
                    QObject.Connect(hello, "2clicked()", app, "1aboutQt()", ConnectionType.AutoConnection);

                    hello.SetVisible(true);
                    QApplication.Exec();
                }
            }
        }
Ejemplo n.º 10
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
Ejemplo n.º 11
0
    public static int Main(String[] args)
    {
        QApplication app = new QApplication(args);

        QPushButton quit = new QPushButton("Quit");

        quit.Resize(75, 30);
        quit.Font = new QFont("Times", 18, (int)QFont.Weight.Bold);

        QObject.Connect(quit, SIGNAL("clicked()"), app, SLOT("quit()"));

        quit.Show();
        return(QApplication.Exec());
    }
Ejemplo n.º 12
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);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
0
    public static int Main(String[] args)
    {
        QApplication app = new QApplication(args);

        QWidget window = new QWidget();

        window.Resize(200, 120);

        QPushButton quit = new QPushButton("Quit", window);

        quit.Font = new QFont("Times", 18, (int)QFont.Weight.Bold);
        quit.SetGeometry(10, 40, 180, 40);

        QObject.Connect(quit, SIGNAL("clicked()"), app, SLOT("quit()"));

        window.Show();
        return(QApplication.Exec());
    }
Ejemplo n.º 16
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
Ejemplo n.º 18
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);
        }
Ejemplo n.º 19
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);
        }
Ejemplo n.º 20
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
Ejemplo n.º 21
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;
        }
Ejemplo n.º 22
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));
            }
        }
Ejemplo n.º 23
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"));
        }
Ejemplo n.º 24
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);
        }
Ejemplo n.º 25
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);
            }
Ejemplo n.º 26
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();
        }
Ejemplo n.º 27
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();
        }
Ejemplo n.º 28
0
        public CoverageView(QWidget parent, String fileName) : base(parent)
        {
            SetRootIsDecorated(true);
            AddColumn("Classes");
            AddColumn("Lines Hit");
            AddColumn("Lines Missed");
            AddColumn("Coverage");

            sourceViews = new Hashtable();

            // TODO: Why the cast ?
            SetColumnAlignment(1, (int)Qt.AlignmentFlags.AlignCenter);
            SetColumnAlignment(2, (int)Qt.AlignmentFlags.AlignCenter);
            SetColumnAlignment(3, (int)Qt.AlignmentFlags.AlignCenter);

            QObject.Connect(this, SIGNAL("doubleClicked(QListViewItem)"),
                            this, SLOT("OnDoubleClick(QListViewItem)"));

            QObject.Connect(this,SIGNAL("expanded(QListViewItem)"),
                            this,SLOT("OnExpanded(QListViewItem)"));

            // TODO: This is not supported by current Qt#
            try {
                QObject.Connect(this,SIGNAL("contextMenuRequested(QListViewItem,QPoint,int)"),
                                this,SLOT("OnContextMenu(QListViewItem, QPoint, Int32)"));
            }
            catch (Exception) {
            }

            QPixmap namespaceOpenPixmap   = new QPixmap(namespace_open_xpm);
            QPixmap namespaceClosedPixmap = new QPixmap(namespace_closed_xpm);
            QPixmap classPixmap           = new QPixmap(class_xpm);

            model = new CoverageModel();
            foreach (string filter in DEFAULT_FILTERS)
            {
                model.AddFilter(filter);
            }
            model.ReadFromFile(fileName);

            QListViewItem rootItem = new TreeItem(this,"PROJECT",model);

            rootItem.SetOpen(true);

            Hashtable classes2 = model.Classes;

            namespaces = new Hashtable();

            foreach (string name in classes2.Keys)
            {
                ClassCoverageItem klass = (ClassCoverageItem)classes2 [name];

                if (klass.filtered)
                {
                    continue;
                }

                string        namespace2 = klass.name_space;
                NamespaceItem nsItem     = (NamespaceItem)namespaces [namespace2];
                if (nsItem == null)
                {
                    // Create namespaces
                    String        nsPrefix   = "";
                    QListViewItem parentItem = rootItem;
                    foreach (String nsPart in namespace2.Split('.'))
                    {
                        if (nsPrefix == "")
                        {
                            nsPrefix = nsPart;
                        }
                        else
                        {
                            nsPrefix = nsPrefix + "." + nsPart;
                        }

                        NamespaceCoverageItem nsModel = (NamespaceCoverageItem)model.Namespaces [nsPrefix];
                        if (nsModel.filtered)
                        {
                            break;
                        }

                        nsItem = (NamespaceItem)namespaces [nsPrefix];
                        if (nsItem == null)
                        {
                            nsItem = new NamespaceItem(parentItem,nsPrefix,
                                                       nsModel);
                            nsItem.SetOpen(true);
                            nsItem.SetPixmap(0,namespaceOpenPixmap);
                            namespaces [nsPrefix] = nsItem;
                        }
                        parentItem = nsItem;
                    }
                }

                if (nsItem != null)
                {
                    ClassItem classItem = new ClassItem(nsItem,klass.name,klass);
                    classItem.SetPixmap(0,classPixmap);
                    if (klass.ChildCount > 0)
                    {
                        classItem.SetExpandable(true);
                    }
                }
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 30
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);
        }