Check if the notebook selected is read-only. With read-only notes the editor and a lot of actions are disabled.
| 1648 | //* read-only notes the editor and a lot of actions are disabled. |
| 1649 | //****************************************************************** |
| 1650 | void NixNote::checkReadOnlyNotebook() { |
| 1651 | qint32 lid = tabWindow->currentBrowser()->lid; |
| 1652 | Note n; |
| 1653 | NoteTable ntable(global.db); |
| 1654 | NotebookTable btable(global.db); |
| 1655 | ntable.get(n, lid, false, false); |
| 1656 | qint32 notebookLid = 0; |
| 1657 | if (n.notebookGuid.isSet()) |
| 1658 | notebookLid = btable.getLid(n.notebookGuid); |
| 1659 | if (btable.isReadOnly(notebookLid)) { |
| 1660 | newNoteButton->setEnabled(false); |
| 1661 | menuBar->deleteNoteAction->setEnabled(false); |
| 1662 | } else { |
| 1663 | newNoteButton->setEnabled(true); |
| 1664 | menuBar->deleteNoteAction->setEnabled(true); |
| 1665 | } |
| 1666 | } |
| 1667 | |
| 1668 | |
| 1669 |
nothing calls this directly
no test coverage detected