This commit is contained in:
RebeccaStankus 2017-12-20 16:52:56 -08:00
parent 5d0eeabf3d
commit 95d94e1c8f
7 changed files with 109 additions and 15 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

View file

@ -69,6 +69,11 @@ QPushButton#revealLogButton {
QCheckBox {
font-family: Helvetica, Arial, sans-serif;
text-align: center;
color: #3d3d3d;
border-width: 0;
border-radius: 9px;
font-size: 11px;
}
QCheckBox::indicator:unchecked {
@ -77,4 +82,25 @@ QCheckBox::indicator:unchecked {
QCheckBox::indicator:checked {
image: url(styles/checked.svg);
}
QComboBox {
font-family: Helvetica, Arial, sans-serif;
text-align: center;
background-color: #CCCCCC;
color: #3d3d3d;
border-width: 0;
border-radius: 9px;
font-size: 11px;
padding-left: 7px;
}
QComboBox::drop-down {
border-width: 0px;
padding-right: 7px;
}
QComboBox::down-arrow {
image: url(styles/filter.png);
border-width: 0px;
}

View file

@ -20,7 +20,7 @@
#include <PathUtils.h>
const int TOP_BAR_HEIGHT = 46;
const int TOP_BAR_HEIGHT = 85;
const int INITIAL_WIDTH = 720;
const int INITIAL_HEIGHT = 480;
const int MINIMAL_WIDTH = 700;

View file

@ -17,7 +17,8 @@
const int ELEMENT_MARGIN = 7;
const int ELEMENT_HEIGHT = 32;
const int CHECKBOX_MARGIN = 12;
const int CHECKBOX_WIDTH = 140;
const int CHECKBOX_WIDTH = 110;
const int COMBOBOX_WIDTH = 160;
const int BUTTON_MARGIN = 8;
class QPushButton;

View file

@ -13,23 +13,20 @@
#include <QCheckBox>
#include <QPushButton>
#include <QComboBox>
#include <shared/AbstractLoggerInterface.h>
const int REVEAL_BUTTON_WIDTH = 122;
const int DEBUG_CHECKBOX_LEFT = 25;
const int DEBUG_CHECKBOX_WIDTH = 70;
const int INFO_CHECKBOX_WIDTH = 65;
const int CRITICAL_CHECKBOX_WIDTH = 85;
LogDialog::LogDialog(QWidget* parent, AbstractLoggerInterface* logger) : BaseLogDialog(parent) {
_logger = logger;
setWindowTitle("Log");
_extraDebuggingBox = new QCheckBox("Extra debugging", this);
_extraDebuggingBox->setGeometry(_leftPad, ELEMENT_MARGIN, CHECKBOX_WIDTH, ELEMENT_HEIGHT);
if (_logger->extraDebugging()) {
_extraDebuggingBox->setCheckState(Qt::Checked);
}
_extraDebuggingBox->show();
connect(_extraDebuggingBox, SIGNAL(stateChanged(int)), SLOT(handleExtraDebuggingCheckbox(int)));
_revealLogButton = new QPushButton("Reveal log file", this);
// set object name for css styling
_revealLogButton->setObjectName("revealLogButton");
@ -37,14 +34,79 @@ LogDialog::LogDialog(QWidget* parent, AbstractLoggerInterface* logger) : BaseLog
connect(_revealLogButton, SIGNAL(clicked()), SLOT(handleRevealButton()));
connect(_logger, SIGNAL(logReceived(QString)), this, SLOT(appendLogLine(QString)), Qt::QueuedConnection);
_leftPad = DEBUG_CHECKBOX_LEFT;
_debugPrintBox = new QCheckBox("DEBUG", this);
_debugPrintBox->setGeometry(_leftPad, ELEMENT_MARGIN + ELEMENT_MARGIN + ELEMENT_HEIGHT, DEBUG_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
/*if (_logger->extraDebugging()) {
_extraDebuggingBox->setCheckState(Qt::Checked);
}*/
_debugPrintBox->show();
//connect(_extraDebuggingBox, SIGNAL(stateChanged(int)), SLOT(handleExtraDebuggingCheckbox(int)));
_leftPad += DEBUG_CHECKBOX_WIDTH + BUTTON_MARGIN;
_infoPrintBox = new QCheckBox("INFO", this);
_infoPrintBox->setGeometry(_leftPad, ELEMENT_MARGIN + ELEMENT_MARGIN + ELEMENT_HEIGHT, INFO_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
/*if (_logger->extraDebugging()) {
_extraDebuggingBox->setCheckState(Qt::Checked);
}*/
_infoPrintBox->show();
//connect(_infoPrintBox, SIGNAL(stateChanged(int)), SLOT(handleExtraDebuggingCheckbox(int)));
_leftPad += INFO_CHECKBOX_WIDTH + BUTTON_MARGIN;
_criticalPrintBox = new QCheckBox("CRITICAL", this);
_criticalPrintBox->setGeometry(_leftPad, ELEMENT_MARGIN + ELEMENT_MARGIN + ELEMENT_HEIGHT, CRITICAL_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
/*if (_logger->extraDebugging()) {
_extraDebuggingBox->setCheckState(Qt::Checked);
}*/
_criticalPrintBox->show();
//connect(_criticalPrintBox, SIGNAL(stateChanged(int)), SLOT(handleExtraDebuggingCheckbox(int)));
_leftPad += CRITICAL_CHECKBOX_WIDTH + BUTTON_MARGIN;
_extraDebuggingBox = new QCheckBox("Extra debugging", this);
_extraDebuggingBox->setGeometry(_leftPad, ELEMENT_MARGIN + ELEMENT_MARGIN + ELEMENT_HEIGHT, CHECKBOX_WIDTH, ELEMENT_HEIGHT);
if (_logger->extraDebugging()) {
_extraDebuggingBox->setCheckState(Qt::Checked);
}
_extraDebuggingBox->show();
connect(_extraDebuggingBox, SIGNAL(stateChanged(int)), SLOT(handleExtraDebuggingCheckbox(int)));
_leftPad += CHECKBOX_WIDTH + BUTTON_MARGIN;
_filterDropdown = new QComboBox(this);
_filterDropdown->setGeometry(_leftPad, ELEMENT_MARGIN + ELEMENT_MARGIN + ELEMENT_HEIGHT, COMBOBOX_WIDTH, ELEMENT_HEIGHT);
_filterDropdown->addItem("Select filter...");
_filterDropdown->addItem("hifi.scriptengine");
_filterDropdown->addItem("hifi.scriptengine.module");
_filterDropdown->addItem("hifi.shared");
_filterDropdown->addItem("hifi.interface.deadlock");
_filterDropdown->addItem("hifi.scriptengine.script");
_filterDropdown->addItem("hifi.audioclient");
_filterDropdown->addItem("hifi.networking");
_filterDropdown->addItem("hifi.networking.resource");
_filterDropdown->addItem("hifi.modelformat");
_filterDropdown->addItem("default");
_filterDropdown->addItem("qml");
_filterDropdown->addItem("hifi.ui");
_filterDropdown->addItem("hifi.avatars");
}
void LogDialog::resizeEvent(QResizeEvent* event) {
BaseLogDialog::resizeEvent(event);
_revealLogButton->setGeometry(width() - ELEMENT_MARGIN - REVEAL_BUTTON_WIDTH,
ELEMENT_MARGIN,
REVEAL_BUTTON_WIDTH,
ELEMENT_HEIGHT);
ELEMENT_MARGIN,
REVEAL_BUTTON_WIDTH,
ELEMENT_HEIGHT);
_filterDropdown->setGeometry(width() - ELEMENT_MARGIN - COMBOBOX_WIDTH,
ELEMENT_MARGIN + ELEMENT_MARGIN + ELEMENT_HEIGHT,
COMBOBOX_WIDTH,
ELEMENT_HEIGHT);
}
void LogDialog::handleRevealButton() {

View file

@ -16,6 +16,7 @@
class QCheckBox;
class QPushButton;
class QComboBox;
class QResizeEvent;
class AbstractLoggerInterface;
@ -25,17 +26,21 @@ class LogDialog : public BaseLogDialog {
public:
LogDialog(QWidget* parent, AbstractLoggerInterface* logger);
private slots:
private slots:
void handleRevealButton();
void handleExtraDebuggingCheckbox(int);
protected:
void resizeEvent(QResizeEvent* event) override;
QString getCurrentLog() override;
private:
QCheckBox* _extraDebuggingBox;
QPushButton* _revealLogButton;
QCheckBox* _debugPrintBox;
QCheckBox* _infoPrintBox;
QCheckBox* _criticalPrintBox;
QComboBox* _filterDropdown;
AbstractLoggerInterface* _logger;
};