#include </home/clem/local/src/opie/libopie2/opieui/big-screen/omodalhelper.h>
Inheritance diagram for Opie::OModalHelper< Dialog, Record, Id >:


Public Types | |
| typedef QValueList< Record > | RecordList |
| typedef QMap< Id, Record > | IdMap |
| typedef QMap< TransactionID, Id > | TransactionMap |
| enum | Mode { Queue, New } |
Public Member Functions | |
| OModalHelper (enum Mode mode, QObject *parnet) | |
| bool | handles (Id id) const |
| TransactionID | transactionID (Id id) const |
| void | suspend (bool=true) |
| void | cancel () |
| void | cancel (TransactionID) |
| void | connectDone (QObject *rec, const char *slot) |
| void | connectAccepted (QObject *rec, const char *slot) |
| void | connectRejected (QObject *rec, const char *slot) |
| TransactionID | handle (Id id, const Record &rec=Record()) |
| void | edited (Id, int what, const QVariant &data) |
| Record | record (TransactionID) const |
| RecordList | recordsDone () const |
Private Member Functions | |
| virtual void | done (int, TransactionID) |
| virtual void | next (TransactionID) |
| virtual void | prev (TransactionID) |
| Record | nextRecord (TransactionID &, int &) const |
| Record | prevRecord (TransactionID &, int &) const |
| int | pos (TransactionID) const |
| Dialog * | newDialogRecord (const Record &) |
| OModalHelperDialog * | queuedDialog () const |
Private Attributes | |
| OModalHelperDialog * | m_dialog |
| OModalHelperSignal * | m_signal |
| OModalHelperControler * | m_controler |
| IdMap | m_ids |
| IdMap | m_doneIds |
| TransactionMap | m_transactions |
| TransactionMap | m_done |
| DialogMap | m_editing |
| enum Mode | m_mode |
| bool | m_disabled:1 |
Friends | |
| class | OModalHelperSignal |
| class | OModalHelperControler |
Modality sucks! ;) But it is easy to work with do exec() on a dialog and you know everything is funky. You only need to have one Dialog loaded and so on. This class helps you to work like with modality and help you to keep things in sync It's a template class but it sends signals once one Item is ready the signals contains the status and id of the item and then you need fetch it. Handled Records will stay available until the first call to retrieve either the record via the TransactionID or via the QValueList<Record>. Note that most functions do not take handled records into account. Also if you edit an record external you can tell this class and it'll call the merge() function of your widget to maybe merge in these changes. It also supports multiple modes. Either it can create new dialogs for each item or it can queue them depending on your usage. But it is so smart that if only one item is shown that the queue bar is not shown See the example for simple usage.
Definition at line 80 of file omodalhelper.h.
|
|||||
|
Definition at line 86 of file omodalhelper.h. |
|
|||||
|
Definition at line 85 of file omodalhelper.h. |
|
|||||
|
Definition at line 87 of file omodalhelper.h. |
|
|||||
|
Definition at line 89 of file omodalhelper.h. |
|
||||||||||||||||
|
This is the simple Template c'tor. It takes the mode this helper should operate in and the parent object. This helper will be deleted when the parent gets deleted or you delete it yourself.
Definition at line 223 of file omodalhelper.h. References Opie::OModalHelper< Dialog, Record, Id >::m_controler, Opie::OModalHelper< Dialog, Record, Id >::m_disabled, Opie::OModalHelper< Dialog, Record, Id >::m_mode, Opie::OModalHelper< Dialog, Record, Id >::m_signal, Opie::OModalHelper< Dialog, Record, Id >::OModalHelperControler, and Opie::OModalHelper< Dialog, Record, Id >::OModalHelperSignal. |
|
||||||||||
|
This cancels editing of the record behind the Transaction Number Note that if editing is already done it will also be removed from this list Definition at line 327 of file omodalhelper.h. References QMap< Key, T >::contains(), Opie::OModalHelper< Dialog, Record, Id >::m_done, Opie::OModalHelper< Dialog, Record, Id >::m_doneIds, Opie::OModalHelper< Dialog, Record, Id >::m_editing, Opie::OModalHelper< Dialog, Record, Id >::m_ids, Opie::OModalHelper< Dialog, Record, Id >::m_mode, Opie::OModalHelper< Dialog, Record, Id >::m_transactions, Opie::OModalHelper< Dialog, Record, Id >::New, Opie::OModalHelper< Dialog, Record, Id >::next(), and QMap< Key, T >::remove(). |
|
|||||||||
|
Cancel will cancel all current operations and clear the list of done operations as well. This also clears all done operations you did not popped Definition at line 299 of file omodalhelper.h. References QMap< Key, T >::clear(), Opie::OModalHelper< Dialog, Record, Id >::m_controler, Opie::OModalHelper< Dialog, Record, Id >::m_dialog, Opie::OModalHelper< Dialog, Record, Id >::m_done, Opie::OModalHelper< Dialog, Record, Id >::m_doneIds, Opie::OModalHelper< Dialog, Record, Id >::m_editing, Opie::OModalHelper< Dialog, Record, Id >::m_ids, Opie::OModalHelper< Dialog, Record, Id >::m_mode, Opie::OModalHelper< Dialog, Record, Id >::m_transactions, Opie::OModalHelper< Dialog, Record, Id >::New, Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(), and Opie::OModalHelperControler::setTransactionID(). |
|
||||||||||||||||
|
Connect to the accepted Signal. SIGNAL( accepted(TransactionID ) ) This signal gets emitted whenever a Record was accepted
Definition at line 377 of file omodalhelper.h. References Opie::OModalHelper< Dialog, Record, Id >::m_signal. |
|
||||||||||||||||
|
Connect to the done Signal. SIGNAL( done(int, TransactionID ) ) This signal gets emitted whenever a Record was accepted or rejected
Definition at line 363 of file omodalhelper.h. References Opie::OModalHelper< Dialog, Record, Id >::done(), and Opie::OModalHelper< Dialog, Record, Id >::m_signal. |
|
||||||||||||||||
|
Same as the accepted method but this one gets emitted if the dialog got rejected. SIGNAL( rejected(TransactionID) )
Definition at line 392 of file omodalhelper.h. References Opie::OModalHelper< Dialog, Record, Id >::m_signal. |
|
||||||||||||||||
|
||||||||||||||||||||
|
The goal of this helper is to help you to create non blocking GUIs. In the example of the todolist you can have the edit dialog but still change the priority or completion inline even if you currently edit the record. Your Dialog needs to have a Method setData(int,const QVariant& ) which will be called in these cases. If you edit anything while a record is edited call this function to merge the change in. Note if the record is not handled here we will ignore the request Definition at line 471 of file omodalhelper.h. References QMap< Key, T >::count(), Opie::OModalHelper< Dialog, Record, Id >::m_editing, Opie::OModalHelper< Dialog, Record, Id >::m_ids, Opie::OModalHelper< Dialog, Record, Id >::m_mode, Opie::OModalHelper< Dialog, Record, Id >::m_transactions, Opie::OModalHelper< Dialog, Record, Id >::New, Opie::OModalHelper< Dialog, Record, Id >::pos(), Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(), and Opie::OModalHelper< Dialog, Record, Id >::transactionID(). |
|
||||||||||||||||
|
||||||||||
|
This functions looks for your record and sees if it is handled with this helper. Note that done records will not be returned.
Definition at line 242 of file omodalhelper.h. References QMap< Key, T >::begin(), QMap< Key, T >::end(), QMap< Key, T >::isEmpty(), and Opie::OModalHelper< Dialog, Record, Id >::m_transactions. |
|
||||||||||
|
For internal use only.
Definition at line 741 of file omodalhelper.h. References Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::m_controler, and Opie::OModalHelper< Dialog, Record, Id >::m_disabled. Referenced by Opie::OModalHelper< Dialog, Record, Id >::handle(). |
|
||||||||||
|
For internal use only.
Implements Opie::OModalHelperBase. Definition at line 583 of file omodalhelper.h. References QMap< Key, T >::count(), Opie::OModalHelper< Dialog, Record, Id >::m_controler, Opie::OModalHelper< Dialog, Record, Id >::m_ids, Opie::OModalHelper< Dialog, Record, Id >::m_mode, Opie::OModalHelper< Dialog, Record, Id >::m_transactions, Opie::OModalHelper< Dialog, Record, Id >::New, Opie::OModalHelper< Dialog, Record, Id >::nextRecord(), Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(), rec, QMap< Key, T >::replace(), and Opie::OModalHelperControler::setTransactionID(). Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::done(), and Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(). |
|
||||||||||||||||
|
Referenced by Opie::OModalHelper< Dialog, Record, Id >::next(). |
|
||||||||||
|
For internal use only.
Definition at line 726 of file omodalhelper.h. References QMap< Key, T >::begin(), QMap< Key, T >::end(), i, and Opie::OModalHelper< Dialog, Record, Id >::m_transactions. Referenced by Opie::OModalHelper< Dialog, Record, Id >::edited(), and Opie::OModalHelper< Dialog, Record, Id >::handle(). |
|
||||||||||
|
For internal use only.
Implements Opie::OModalHelperBase. Definition at line 618 of file omodalhelper.h. References QMap< Key, T >::count(), Opie::OModalHelper< Dialog, Record, Id >::m_controler, Opie::OModalHelper< Dialog, Record, Id >::m_ids, Opie::OModalHelper< Dialog, Record, Id >::m_mode, Opie::OModalHelper< Dialog, Record, Id >::m_transactions, Opie::OModalHelper< Dialog, Record, Id >::New, Opie::OModalHelper< Dialog, Record, Id >::prevRecord(), Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(), rec, QMap< Key, T >::replace(), and Opie::OModalHelperControler::setTransactionID(). Referenced by Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(). |
|
||||||||||||||||
|
Referenced by Opie::OModalHelper< Dialog, Record, Id >::prev(). |
|
|||||||||
|
Definition at line 755 of file omodalhelper.h. References Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::m_controler, Opie::OModalHelper< Dialog, Record, Id >::m_dialog, Opie::OModalHelper< Dialog, Record, Id >::m_disabled, Opie::OModalHelper< Dialog, Record, Id >::next(), and Opie::OModalHelper< Dialog, Record, Id >::prev(). Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::edited(), Opie::OModalHelper< Dialog, Record, Id >::handle(), Opie::OModalHelper< Dialog, Record, Id >::next(), Opie::OModalHelper< Dialog, Record, Id >::prev(), and Opie::OModalHelper< Dialog, Record, Id >::suspend(). |
|
||||||||||
|
This functions either returns the unedited record the done record or a new empty Record using Record(). If a done record is retrieved all traces are removed inside this class. This is what was called popping a record. This means when you call this function with the same TransactionID an Empty record is retrieved. Definition at line 502 of file omodalhelper.h. References QMap< Key, T >::contains(), Opie::OModalHelper< Dialog, Record, Id >::m_done, Opie::OModalHelper< Dialog, Record, Id >::m_doneIds, Opie::OModalHelper< Dialog, Record, Id >::m_ids, Opie::OModalHelper< Dialog, Record, Id >::m_transactions, rec, and QMap< Key, T >::remove(). |
|
|||||||||
|
Returns all done Records and removes all references to them internally. A 2nd call to this will only contain done record that where edited past the point Definition at line 522 of file omodalhelper.h. References QValueList< T >::append(), QMap< Key, T >::begin(), QMap< Key, T >::clear(), QMap< Key, T >::end(), list, Opie::OModalHelper< Dialog, Record, Id >::m_done, and Opie::OModalHelper< Dialog, Record, Id >::m_doneIds. |
|
||||||||||
|
If you're requested to flush your data and you do not want to call cancel with this method you can disable and enabled all dialogs. The state gets saved so if you want to handle a new record the dialog will be disabled as well.
Definition at line 283 of file omodalhelper.h. References Opie::OModalHelper< Dialog, Record, Id >::m_dialog, Opie::OModalHelper< Dialog, Record, Id >::m_disabled, Opie::OModalHelper< Dialog, Record, Id >::m_editing, Opie::OModalHelper< Dialog, Record, Id >::m_mode, Opie::OModalHelper< Dialog, Record, Id >::New, and Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(). |
|
||||||||||
|
just like handles( Id ) but returns the TransactionId Definition at line 260 of file omodalhelper.h. References QMap< Key, T >::begin(), QMap< Key, T >::contains(), QMap< Key, T >::end(), QMap< Key, T >::isEmpty(), Opie::OModalHelper< Dialog, Record, Id >::m_ids, and Opie::OModalHelper< Dialog, Record, Id >::m_transactions. Referenced by Opie::OModalHelper< Dialog, Record, Id >::edited(), and Opie::OModalHelper< Dialog, Record, Id >::handle(). |
|
|||||
|
Definition at line 83 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::OModalHelper(). |
|
|||||
|
Definition at line 82 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::OModalHelper(). |
|
|||||
|
Definition at line 124 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::handle(), Opie::OModalHelper< Dialog, Record, Id >::newDialogRecord(), Opie::OModalHelper< Dialog, Record, Id >::next(), Opie::OModalHelper< Dialog, Record, Id >::OModalHelper(), Opie::OModalHelper< Dialog, Record, Id >::prev(), and Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(). |
|
|||||
|
Definition at line 122 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(), and Opie::OModalHelper< Dialog, Record, Id >::suspend(). |
|
|||||
|
Definition at line 131 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::newDialogRecord(), Opie::OModalHelper< Dialog, Record, Id >::OModalHelper(), Opie::OModalHelper< Dialog, Record, Id >::queuedDialog(), and Opie::OModalHelper< Dialog, Record, Id >::suspend(). |
|
|||||
|
Definition at line 128 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::record(), and Opie::OModalHelper< Dialog, Record, Id >::recordsDone(). |
|
|||||
|
Definition at line 126 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::record(), and Opie::OModalHelper< Dialog, Record, Id >::recordsDone(). |
|
|||||
|
Definition at line 129 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::edited(), Opie::OModalHelper< Dialog, Record, Id >::handle(), and Opie::OModalHelper< Dialog, Record, Id >::suspend(). |
|
|||||
|
Definition at line 125 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::edited(), Opie::OModalHelper< Dialog, Record, Id >::handle(), Opie::OModalHelper< Dialog, Record, Id >::next(), Opie::OModalHelper< Dialog, Record, Id >::prev(), Opie::OModalHelper< Dialog, Record, Id >::record(), and Opie::OModalHelper< Dialog, Record, Id >::transactionID(). |
|
|||||
|
Definition at line 130 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::edited(), Opie::OModalHelper< Dialog, Record, Id >::handle(), Opie::OModalHelper< Dialog, Record, Id >::next(), Opie::OModalHelper< Dialog, Record, Id >::OModalHelper(), Opie::OModalHelper< Dialog, Record, Id >::prev(), and Opie::OModalHelper< Dialog, Record, Id >::suspend(). |
|
|||||
|
Definition at line 123 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::connectAccepted(), Opie::OModalHelper< Dialog, Record, Id >::connectDone(), Opie::OModalHelper< Dialog, Record, Id >::connectRejected(), Opie::OModalHelper< Dialog, Record, Id >::done(), and Opie::OModalHelper< Dialog, Record, Id >::OModalHelper(). |
|
|||||
|
Definition at line 127 of file omodalhelper.h. Referenced by Opie::OModalHelper< Dialog, Record, Id >::cancel(), Opie::OModalHelper< Dialog, Record, Id >::done(), Opie::OModalHelper< Dialog, Record, Id >::edited(), Opie::OModalHelper< Dialog, Record, Id >::handle(), Opie::OModalHelper< Dialog, Record, Id >::handles(), Opie::OModalHelper< Dialog, Record, Id >::next(), Opie::OModalHelper< Dialog, Record, Id >::pos(), Opie::OModalHelper< Dialog, Record, Id >::prev(), Opie::OModalHelper< Dialog, Record, Id >::record(), and Opie::OModalHelper< Dialog, Record, Id >::transactionID(). |
1.4.2