| 1586 | } |
| 1587 | |
| 1588 | void SpreadsheetView::checkColumnMenus(const QVector<Column*>& columns) { |
| 1589 | bool numeric = true; |
| 1590 | bool plottable = true; |
| 1591 | bool datetime = false; |
| 1592 | bool text = false; |
| 1593 | bool hasValues = false; |
| 1594 | bool hasFormat = false; |
| 1595 | bool hasEnoughValues = false; // enough for statistics (> 1) |
| 1596 | |
| 1597 | for (const auto* col : columns) { |
| 1598 | if (!col->isNumeric()) { |
| 1599 | datetime = (col->columnMode() == AbstractColumn::ColumnMode::DateTime); |
| 1600 | if (!datetime) |
| 1601 | plottable = false; |
| 1602 | |
| 1603 | numeric = false; |
| 1604 | break; |
| 1605 | } |
| 1606 | } |
| 1607 | |
| 1608 | for (const auto* col : columns) { |
| 1609 | if (col->columnMode() == AbstractColumn::ColumnMode::Text) { |
| 1610 | text = true; |
| 1611 | break; |
| 1612 | } |
| 1613 | } |
| 1614 | |
| 1615 | for (const auto* col : columns) { |
| 1616 | if (col->hasValues()) { |
| 1617 | hasValues = true; |
| 1618 | break; |
| 1619 | } |
| 1620 | } |
| 1621 | |
| 1622 | for (const auto* col : columns) { |
| 1623 | if (col->availableRowCount() > 1) { |
| 1624 | hasEnoughValues = true; |
| 1625 | break; |
| 1626 | } |
| 1627 | } |
| 1628 | |
| 1629 | for (const auto* col : columns) { |
| 1630 | if (col->hasHeatmapFormat()) { |
| 1631 | hasFormat = true; |
| 1632 | break; |
| 1633 | } |
| 1634 | } |
| 1635 | |
| 1636 | if (isColumnSelected(0, true)) { |
| 1637 | action_freeze_columns->setVisible(true); |
| 1638 | if (m_frozenTableView) { |
| 1639 | if (!m_frozenTableView->isVisible()) { |
| 1640 | action_freeze_columns->setText(i18n("Freeze Column")); |
| 1641 | action_insert_column_left->setEnabled(true); |
| 1642 | action_insert_columns_left->setEnabled(true); |
| 1643 | } else { |
| 1644 | action_freeze_columns->setText(i18n("Unfreeze Column")); |
| 1645 | action_insert_column_left->setEnabled(false); |
nothing calls this directly
no test coverage detected