| 1555 | } |
| 1556 | |
| 1557 | bool frmMain::saveProgramToFile(QString fileName, GCodeTableModel *model) |
| 1558 | { |
| 1559 | QFile file(fileName); |
| 1560 | QDir dir; |
| 1561 | |
| 1562 | qDebug() << "Saving program"; |
| 1563 | |
| 1564 | if (file.exists()) |
| 1565 | dir.remove(file.fileName()); |
| 1566 | |
| 1567 | if (!file.open(QIODevice::WriteOnly)) |
| 1568 | return false; |
| 1569 | |
| 1570 | QTextStream textStream(&file); |
| 1571 | |
| 1572 | for (int i = 0; i < model->rowCount() - 1; i++) |
| 1573 | { |
| 1574 | textStream << model->data(model->index(i, 1)).toString() << "\r\n"; |
| 1575 | } |
| 1576 | |
| 1577 | file.close(); |
| 1578 | |
| 1579 | return true; |
| 1580 | } |
| 1581 | |
| 1582 | void frmMain::on_actFileSaveTransformedAs_triggered() |
| 1583 | { |