| 1 | /*************************************************************************** |
| 2 | notepage.cpp |
| 3 | ------------------- |
| 4 | A dialog page for notes |
| 5 | ------------------- |
| 6 | Copyright 2003-2008, David Johnson |
| 7 | Please see the header file for copyright and license information |
| 8 | ***************************************************************************/ |
| 9 | |
| 10 | #include <QTextEdit> |
| 11 | |
| 12 | #include "recipe.h"cxx . . $ `<file>/src/recipe.h`/ |
| 13 | #include "notepage.h"cxx . . $ `<file>/src/notepage.h`/ |
| 14 | |
| 15 | ////////////////////////////////////////////////////////////////////////////// |
| 16 | // Construction, Destruction // |
| 17 | ////////////////////////////////////////////////////////////////////////////// |
| 18 | |
| 19 | ////////////////////////////////////////////////////////////////////////////// |
| 20 | // NotePage() |
| 21 | // ---------- |
| 22 | // Constructor |
| 23 | |
| 24 | NotePagecxx . . $ NotePage#::NotePagecxx . . $ NotePage#NotePage(77eff4164a28df1f).(QWidgetcxx . . $ QWidget# *parent, Recipecxx . . $ Recipe# *recipe) |
| 25 | : QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent), recipe_cxx . . $ NotePage#recipe_.(recipe) |
| 26 | { |
| 27 | uicxx . . $ NotePage#ui..setupUicxx . . $ Ui_NoteView#setupUi(108f35f7aa7f3cf9).(this); |
| 28 | |
| 29 | // set up connections |
| 30 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ NotePage#ui..recipeeditcxx . . $ Ui_NoteView#recipeedit., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(textChanged()), |
| 31 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(updateRecipeNotes())); |
| 32 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ NotePage#ui..batcheditcxx . . $ Ui_NoteView#batchedit., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(textChanged()), |
| 33 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(updateBatchNotes())); |
| 34 | } |
| 35 | |
| 36 | NotePagecxx . . $ NotePage#::~cxx . . $ NotePage#`~NotePage`(ced63f7c635d850d).NotePagecxx . . $ NotePage#() { ; } |
| 37 | |
| 38 | ////////////////////////////////////////////////////////////////////////////// |
| 39 | // refresh() |
| 40 | // --------- |
| 41 | // initialize |
| 42 | |
| 43 | void NotePagecxx . . $ NotePage#::refreshcxx . . $ NotePage#refresh(49f6e7a06ebc5aa8).() |
| 44 | { |
| 45 | uicxx . . $ NotePage#ui..recipeeditcxx . . $ Ui_NoteView#recipeedit.->blockSignalscxx . . $ QObject#blockSignals(4264aff4942d46ac).(true); |
| 46 | uicxx . . $ NotePage#ui..batcheditcxx . . $ Ui_NoteView#batchedit.->blockSignalscxx . . $ QObject#blockSignals(4264aff4942d46ac).(true); |
| 47 | uicxx . . $ NotePage#ui..recipeeditcxx . . $ Ui_NoteView#recipeedit.->setPlainTextcxx . . $ QTextEdit#setPlainText(3520e46b33348bf6).(recipe_cxx . . $ NotePage#recipe_.->recipeNotescxx . . $ Recipe#recipeNotes(a2fb7a6ce195d51).()); |
| 48 | uicxx . . $ NotePage#ui..batcheditcxx . . $ Ui_NoteView#batchedit.->setPlainTextcxx . . $ QTextEdit#setPlainText(3520e46b33348bf6).(recipe_cxx . . $ NotePage#recipe_.->batchNotescxx . . $ Recipe#batchNotes(a2fb7a6ce195d51).()); |
| 49 | uicxx . . $ NotePage#ui..recipeeditcxx . . $ Ui_NoteView#recipeedit.->blockSignalscxx . . $ QObject#blockSignals(4264aff4942d46ac).(false); |
| 50 | uicxx . . $ NotePage#ui..batcheditcxx . . $ Ui_NoteView#batchedit.->blockSignalscxx . . $ QObject#blockSignals(4264aff4942d46ac).(false); |
| 51 | } |
| 52 | |
| 53 | ////////////////////////////////////////////////////////////////////////////// |
| 54 | // updateRecipeNotes() |
| 55 | // ----------------- |
| 56 | // Update the notes in the model |
| 57 | |
| 58 | void NotePagecxx . . $ NotePage#::updateRecipeNotescxx . . $ NotePage#updateRecipeNotes(49f6e7a06ebc5aa8).() |
| 59 | { |
| 60 | // TODO: this is very inefficient, particularly for large amounts of text |
| 61 | // consider making character have a list of paragraphs, then only update |
| 62 | // the paragraph that changed. |
| 63 | recipe_cxx . . $ NotePage#recipe_.->setRecipeNotescxx . . $ Recipe#setRecipeNotes(3520e46b33348bf6).(uicxx . . $ NotePage#ui..recipeeditcxx . . $ Ui_NoteView#recipeedit.->toPlainTextcxx . . $ QTextEdit#toPlainText(6ef7b6c27b00b43d).()); |
| 64 | } |
| 65 | |
| 66 | ////////////////////////////////////////////////////////////////////////////// |
| 67 | // updateBatchNotes() |
| 68 | // ----------------- |
| 69 | // Update the notes in the model |
| 70 | |
| 71 | void NotePagecxx . . $ NotePage#::updateBatchNotescxx . . $ NotePage#updateBatchNotes(49f6e7a06ebc5aa8).() |
| 72 | { |
| 73 | // TODO: this is very inefficient, particularly for large amounts of text |
| 74 | // consider making character have a list of paragraphs, then only update |
| 75 | // the paragraph that changed. |
| 76 | recipe_cxx . . $ NotePage#recipe_.->setBatchNotescxx . . $ Recipe#setBatchNotes(3520e46b33348bf6).(uicxx . . $ NotePage#ui..batcheditcxx . . $ Ui_NoteView#batchedit.->toPlainTextcxx . . $ QTextEdit#toPlainText(6ef7b6c27b00b43d).()); |
| 77 | } |
| 78 |