Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/printwidget.cpp
Show All 37 Lines | 31 | if (showAllControls) { | |||
---|---|---|---|---|---|
38 | connect(newButton, &QPushButton::clicked, this, [this] { | 38 | connect(newButton, &QPushButton::clicked, this, [this] { | ||
39 | emit emergencyStopPressed(); | 39 | emit emergencyStopPressed(); | ||
40 | }); | 40 | }); | ||
41 | 41 | | |||
42 | hBoxLayout = new QHBoxLayout; | 42 | hBoxLayout = new QHBoxLayout; | ||
43 | hBoxLayout->addWidget(buttonPrint); | 43 | hBoxLayout->addWidget(buttonPrint); | ||
44 | hBoxLayout->addWidget(newButton); | 44 | hBoxLayout->addWidget(newButton); | ||
45 | mainLayout->addLayout(hBoxLayout); | 45 | mainLayout->addLayout(hBoxLayout); | ||
46 | | ||||
47 | newLabel = new QLabel(tr("On Pause:"), this); | | |||
48 | | ||||
49 | linePostPause = new QLineEdit(this); | | |||
50 | linePostPause->setPlaceholderText(QStringLiteral("G91,G0 Z1,G90,G1 X0 Y195")); | | |||
51 | | ||||
52 | hBoxLayout = new QHBoxLayout; | | |||
53 | hBoxLayout->addWidget(newLabel); | | |||
54 | hBoxLayout->addWidget(linePostPause); | | |||
55 | mainLayout->addLayout(hBoxLayout); | | |||
56 | } | 46 | } | ||
57 | 47 | | |||
58 | newLabel = new QLabel(tr("Printer Speed"), this); | 48 | newLabel = new QLabel(tr("Printer Speed"), this); | ||
59 | sbPrintSpeed = new QSpinBox(this); | 49 | sbPrintSpeed = new QSpinBox(this); | ||
60 | sbPrintSpeed->setRange(1, 300); | 50 | sbPrintSpeed->setRange(1, 300); | ||
61 | sbPrintSpeed->setValue(100); | 51 | sbPrintSpeed->setValue(100); | ||
62 | sbPrintSpeed->setSuffix(QStringLiteral("%")); | 52 | sbPrintSpeed->setSuffix(QStringLiteral("%")); | ||
63 | 53 | | |||
Show All 40 Lines | |||||
104 | hBoxLayout->addWidget(comboFanSelect, 60); | 94 | hBoxLayout->addWidget(comboFanSelect, 60); | ||
105 | hBoxLayout->addWidget(sbFanSpeed, 20); | 95 | hBoxLayout->addWidget(sbFanSpeed, 20); | ||
106 | hBoxLayout->addWidget(newButton, 20); | 96 | hBoxLayout->addWidget(newButton, 20); | ||
107 | mainLayout->addLayout(hBoxLayout); | 97 | mainLayout->addLayout(hBoxLayout); | ||
108 | 98 | | |||
109 | setLayout(mainLayout); | 99 | setLayout(mainLayout); | ||
110 | } | 100 | } | ||
111 | 101 | | |||
112 | QString PrintWidget::postPauseCommand() const | | |||
113 | { | | |||
114 | return linePostPause->text(); | | |||
115 | } | | |||
116 | | ||||
117 | void PrintWidget::setPrintText(const QString &text) | 102 | void PrintWidget::setPrintText(const QString &text) | ||
118 | { | 103 | { | ||
119 | buttonPrint->setText(text); | 104 | buttonPrint->setText(text); | ||
120 | } | 105 | } | ||
121 | 106 | | |||
122 | void PrintWidget::updateFanCount(const int count) | 107 | void PrintWidget::updateFanCount(const int count) | ||
123 | { | 108 | { | ||
124 | comboFanSelect->clear(); | 109 | comboFanSelect->clear(); | ||
125 | for (int i = 0; i < count; i++) { | 110 | for (int i = 0; i < count; i++) { | ||
126 | comboFanSelect->insertItem(i, tr("Fan %1 speed").arg(i)); | 111 | comboFanSelect->insertItem(i, tr("Fan %1 speed").arg(i)); | ||
127 | } | 112 | } | ||
128 | } | 113 | } |