| 83 | } |
| 84 | |
| 85 | void ConsoleWidget::createUI() |
| 86 | { |
| 87 | searchWidget = new QWidget(this); |
| 88 | searchWidget->setVisible(false); |
| 89 | |
| 90 | prevButton = new ClickableLabel("<"); |
| 91 | prevButton->setCursor( Qt::PointingHandCursor ); |
| 92 | |
| 93 | nextButton = new ClickableLabel(">"); |
| 94 | nextButton->setCursor( Qt::PointingHandCursor ); |
| 95 | |
| 96 | searchLabel = new QLabel("0 of 0"); |
| 97 | searchLineEdit = new QLineEdit(); |
| 98 | searchLineEdit->setPlaceholderText("Find"); |
| 99 | searchLineEdit->setMaximumWidth(300); |
| 100 | |
| 101 | searchInput = new KPH_SearchInput(searchLineEdit, this); |
| 102 | |
| 103 | hideButton = new ClickableLabel("X"); |
| 104 | hideButton->setCursor( Qt::PointingHandCursor ); |
| 105 | |
| 106 | spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); |
| 107 | |
| 108 | searchLayout = new QHBoxLayout(searchWidget); |
| 109 | searchLayout->setContentsMargins(0, 3, 0, 0); |
| 110 | searchLayout->setSpacing(4); |
| 111 | searchLayout->addWidget(prevButton); |
| 112 | searchLayout->addWidget(nextButton); |
| 113 | searchLayout->addWidget(searchLabel); |
| 114 | searchLayout->addWidget(searchLineEdit); |
| 115 | searchLayout->addWidget(hideButton); |
| 116 | searchLayout->addSpacerItem(spacer); |
| 117 | |
| 118 | QString prompt = QString("%1 >").arg(agent->data.Name); |
| 119 | CmdLabel = new QLabel(this ); |
| 120 | CmdLabel->setStyleSheet("padding: 4px; color: #BEBEBE; background-color: transparent;"); |
| 121 | CmdLabel->setText( prompt ); |
| 122 | |
| 123 | InputLineEdit = new QLineEdit(this); |
| 124 | InputLineEdit->setStyleSheet("background-color: #151515; color: #BEBEBE; border: 1px solid #2A2A2A; padding: 4px; border-radius: 4px;"); |
| 125 | InputLineEdit->setFont( FontManager::instance().getFont("Hack") ); |
| 126 | |
| 127 | QString info = ""; |
| 128 | if ( agent->data.Domain == "" || agent->data.Computer == agent->data.Domain ) |
| 129 | info = QString("[%1] %2 @ %3").arg( agent->data.Id ).arg( agent->data.Username ).arg( agent->data.Computer ); |
| 130 | else |
| 131 | info = QString("[%1] %2 @ %3.%4").arg( agent->data.Id ).arg( agent->data.Username ).arg( agent->data.Computer ).arg( agent->data.Domain ); |
| 132 | |
| 133 | InfoLabel = new QLabel(this); |
| 134 | InfoLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); |
| 135 | InfoLabel->setStyleSheet("padding: 4px; color: #BEBEBE; background-color: transparent;"); |
| 136 | InfoLabel->setText ( info ); |
| 137 | |
| 138 | OutputTextEdit = new TextEditConsole(this, GlobalClient->settings->data.ConsoleBufferSize, GlobalClient->settings->data.ConsoleNoWrap, GlobalClient->settings->data.ConsoleAutoScroll); |
| 139 | OutputTextEdit->setReadOnly(true); |
| 140 | OutputTextEdit->setStyleSheet("background-color: #151515; color: #BEBEBE; border: 1px solid #2A2A2A; border-radius: 4px;"); |
| 141 | OutputTextEdit->setFont( FontManager::instance().getFont("Hack") ); |
| 142 |
no test coverage detected