Exemple #1
0
        public ErrorDialog(string errorTitle, string errorMessage, string errorDetail, QWidget parentWindow) : base(parentWindow)
        {
            SetupUi();

            iconLabel.Pixmap = Gui.LoadIcon("dialog-error").Pixmap(32);

            titleLabel.Text   = "<b>" + Qt.Escape(errorTitle) + "</b>";
            messageLabel.Text = !String.IsNullOrEmpty(errorMessage) ? errorMessage : String.Empty;

            detailsTextEdit.Hide();

            if (!String.IsNullOrEmpty(errorDetail))
            {
                detailsTextEdit.PlainText = errorDetail;
            }
            else
            {
                showDetailsButtonContainer.Hide();
            }

            Gui.CenterWidgetOnScreen(this);
        }
Exemple #2
0
        public void HandleAccountAdded(Account account)
        {
            QApplication.Invoke(delegate {
                QTextEdit textEdit  = new QTextEdit(this);
                textEdit.FrameShape = QFrame.Shape.NoFrame;
                textEdit.ReadOnly   = true;

                QWidget widget = new QWidget();

                QVBoxLayout layout = new QVBoxLayout(widget);
                layout.Margin      = 0;
                layout.AddWidget(textEdit);

                m_XmlToolBox.AddItem(widget, account.Jid);

                m_AccountXmlWidgets.Add(account, widget);

                account.Client.OnWriteText += delegate(object sender, string txt) {
                    QApplication.Invoke(delegate {
                        if (enableConsoleCheckBox.Checked)
                        {
                            textEdit.Append("<b>" + Qt.Escape(txt) + "</b><br/>");
                        }
                    });
                };

                account.Client.OnReadText += delegate(object sender, string txt) {
                    QApplication.Invoke(delegate {
                        if (enableConsoleCheckBox.Checked)
                        {
                            textEdit.Append(Qt.Escape(txt) + "<br/>");
                        }
                    });
                };
            });
        }