Changeset View
Changeset View
Standalone View
Standalone View
testclient/mainwindow.cpp
| Show First 20 Lines • Show All 511 Lines • ▼ Show 20 Line(s) | 510 | { | |||
|---|---|---|---|---|---|
| 512 | switch (core->state()) { | 512 | switch (core->state()) { | ||
| 513 | 513 | | |||
| 514 | case AtCore::DISCONNECTED: | 514 | case AtCore::DISCONNECTED: | ||
| 515 | QMessageBox::information(this, tr("Error"), tr("Not Connected To a Printer")); | 515 | QMessageBox::information(this, tr("Error"), tr("Not Connected To a Printer")); | ||
| 516 | break; | 516 | break; | ||
| 517 | 517 | | |||
| 518 | case AtCore::CONNECTING: | 518 | case AtCore::CONNECTING: | ||
| 519 | QMessageBox::information(this, tr("Error"), tr(" A Firmware Plugin was not loaded!\n Please send the command M115 and let us know what your firmware returns, so we can improve our firmware detection. Edit your profile to use \"marlin\" and try again.")); | 519 | QMessageBox::information(this, tr("Error"), tr(" A Firmware Plugin was not loaded!\n Please send the command M115 and let us know what your firmware returns, so we can improve our firmware detection. Edit your profile to use \"marlin\" and try again.")); | ||
| 520 | //comboPlugin->setCurrentText(QStringLiteral("marlin")); | | |||
| 521 | break; | 520 | break; | ||
| 522 | 521 | | |||
| 523 | case AtCore::IDLE: | 522 | case AtCore::IDLE: | ||
| 524 | fileName = QFileDialog::getOpenFileName(this, tr("Select a file to print"), QDir::homePath(), tr("*.gcode")); | 523 | fileName = QFileDialog::getOpenFileName(this, tr("Select a file to print"), QDir::homePath(), tr("*.gcode")); | ||
| 525 | if (fileName.isNull()) { | 524 | if (fileName.isNull()) { | ||
| 526 | logWidget->appendLog(tr("No File Selected")); | 525 | logWidget->appendLog(tr("No File Selected")); | ||
| 527 | } else { | 526 | } else { | ||
| 528 | logWidget->appendLog(tr("Print: %1").arg(fileName)); | 527 | logWidget->appendLog(tr("Print: %1").arg(fileName)); | ||
| Show All 15 Lines | |||||
| 544 | } | 543 | } | ||
| 545 | 544 | | |||
| 546 | void MainWindow::printerStateChanged(AtCore::STATES state) | 545 | void MainWindow::printerStateChanged(AtCore::STATES state) | ||
| 547 | { | 546 | { | ||
| 548 | QString stateString; | 547 | QString stateString; | ||
| 549 | switch (state) { | 548 | switch (state) { | ||
| 550 | case AtCore::IDLE: | 549 | case AtCore::IDLE: | ||
| 551 | if (connectionTimer->isActive()) { | 550 | if (connectionTimer->isActive()) { | ||
| 551 | core->setAutoTemperatureReport(MachineInfo::instance()->readKey(comboProfile->currentText(), MachineInfo::KEY::AUTOTEMPREPORT).toBool()); | ||||
| 552 | connectionTimer->stop(); | 552 | connectionTimer->stop(); | ||
| 553 | } | 553 | } | ||
| 554 | buttonConnect->setText(tr("Disconnect")); | 554 | buttonConnect->setText(tr("Disconnect")); | ||
| 555 | printWidget->setPrintText(tr("Print File")); | 555 | printWidget->setPrintText(tr("Print File")); | ||
| 556 | stateString = tr("Connected to ") + core->connectedPort(); | 556 | stateString = tr("Connected to ") + core->connectedPort(); | ||
| 557 | sdDock->setVisible(core->firmwarePlugin()->isSdSupported()); | 557 | sdDock->setVisible(core->firmwarePlugin()->isSdSupported()); | ||
| 558 | break; | 558 | break; | ||
| 559 | 559 | | |||
| ▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines | |||||