| 134 | } |
| 135 | |
| 136 | bool Matrix::exportView() const { |
| 137 | #ifndef SDK |
| 138 | auto* dlg = new ExportSpreadsheetDialog(m_view); |
| 139 | dlg->setFileName(name()); |
| 140 | dlg->setMatrixMode(true); |
| 141 | |
| 142 | // TODO FITS filter to decide if it can be exported to both |
| 143 | dlg->setExportTo(QStringList() << i18n("FITS image") << i18n("FITS table")); |
| 144 | if (m_view->selectedColumnCount() == 0) |
| 145 | dlg->setExportSelection(false); |
| 146 | |
| 147 | bool ret; |
| 148 | if ((ret = (dlg->exec() == QDialog::Accepted))) { |
| 149 | const QString path = dlg->path(); |
| 150 | WAIT_CURSOR; |
| 151 | |
| 152 | if (dlg->format() == ExportSpreadsheetDialog::Format::LaTeX) { |
| 153 | const bool verticalHeader = dlg->matrixVerticalHeader(); |
| 154 | const bool horizontalHeader = dlg->matrixHorizontalHeader(); |
| 155 | const bool latexHeader = dlg->exportHeader(); |
| 156 | const bool gridLines = dlg->gridLines(); |
| 157 | const bool entire = dlg->entireSpreadheet(); |
| 158 | const bool captions = dlg->captions(); |
| 159 | m_view->exportToLaTeX(path, verticalHeader, horizontalHeader, latexHeader, gridLines, entire, captions); |
| 160 | } else if (dlg->format() == ExportSpreadsheetDialog::Format::FITS) { |
| 161 | const int exportTo = dlg->exportToFits(); |
| 162 | m_view->exportToFits(path, exportTo); |
| 163 | } else { |
| 164 | const QString separator = dlg->separator(); |
| 165 | const QLocale::Language format = dlg->numberFormat(); |
| 166 | m_view->exportToFile(path, separator, format); |
| 167 | } |
| 168 | RESET_CURSOR; |
| 169 | } |
| 170 | delete dlg; |
| 171 | |
| 172 | return ret; |
| 173 | #else |
| 174 | return 0; |
| 175 | #endif |
| 176 | } |
| 177 | |
| 178 | bool Matrix::printView() { |
| 179 | #ifndef SDK |
nothing calls this directly
no test coverage detected