| 1638 | } |
| 1639 | |
| 1640 | void TOPPViewBase::showTOPPDialog_(bool visible_area_only) |
| 1641 | { |
| 1642 | // warn if hidden layer => wrong layer selected... |
| 1643 | const LayerDataBase& layer = getActiveCanvas()->getCurrentLayer(); |
| 1644 | if (!layer.visible) |
| 1645 | { |
| 1646 | log_->appendNewHeader(LogWindow::LogState::NOTICE, "The current layer is not visible", "Have you selected the right layer for this action?"); |
| 1647 | } |
| 1648 | |
| 1649 | // create and store unique file name prefix for files |
| 1650 | topp_.file_name = File::getTempDirectory() + "/TOPPView_" + File::getUniqueName(); |
| 1651 | if (!File::writable(topp_.file_name + "_ini")) |
| 1652 | { |
| 1653 | log_->appendNewHeader(LogWindow::LogState::CRITICAL, "Cannot create temporary file", String("Cannot write to '") + topp_.file_name + "'_ini!"); |
| 1654 | return; |
| 1655 | } |
| 1656 | if (!param_.hasSection("tool_params:")) |
| 1657 | { |
| 1658 | tool_scanner_.waitForToolParams(); |
| 1659 | param_.insert("tool_params:", tool_scanner_.getToolParams()); |
| 1660 | } |
| 1661 | |
| 1662 | ToolsDialog tools_dialog(this, param_, |
| 1663 | topp_.file_name + "_ini", current_path_, layer.type, |
| 1664 | layer.getName(), &tool_scanner_); |
| 1665 | |
| 1666 | if (tools_dialog.exec() == QDialog::Accepted) |
| 1667 | { |
| 1668 | // Store tool name, input parameter and output parameter |
| 1669 | topp_.tool = tools_dialog.getTool(); |
| 1670 | topp_.in = tools_dialog.getInput(); |
| 1671 | topp_.out = tools_dialog.getOutput(); |
| 1672 | topp_.visible_area_only = visible_area_only; |
| 1673 | // run the tool |
| 1674 | runTOPPTool_(); |
| 1675 | } |
| 1676 | } |
| 1677 | |
| 1678 | void TOPPViewBase::rerunTOPPTool() |
| 1679 | { |
nothing calls this directly
no test coverage detected