Isis 3.0 Object Programmers' Reference |
Home |
History Widget for cnetsuite. More...
#include <HistoryTreeWidget.h>
Public Member Functions | |
HistoryTreeWidget (Project *project, QWidget *parent=0) | |
Construct a history tree widget. | |
virtual | ~HistoryTreeWidget () |
Clean up allocated memory. | |
Protected Member Functions | |
int | sizeHintForColumn (int column) const |
Get the preferred size of a given column. | |
Private Slots | |
void | addToHistory (WorkOrder *) |
Add a single work order to the display. | |
void | updateProgressWidgets () |
We need to manually manage these progress widgets because QTreeWidget does a poor job of it. | |
void | markNotUndone (QTreeWidgetItem *) |
Display the item as not an item that has been undone - it's working or done. | |
void | markUndone (QTreeWidgetItem *) |
Display the item as an item that has been undone. | |
void | handleUndoIndexChanged (int) |
The project's undo stack has changed. | |
void | removeFromHistory (QObject *) |
A work order was lost... | |
void | showHistory () |
This resets the tree widget and re-initializes. | |
void | updateStatus (WorkOrder *) |
QTreeWidgetItem * | undoCommandToTreeItem (const QUndoCommand *) |
Get the QTreeWidgetItem associated with the given undo command (work order). | |
Private Member Functions | |
void | refit () |
This resizes the columns to an okay width for viewing all of the data cleanly. | |
void | updateStatus (QTreeWidgetItem *) |
Q_DISABLE_COPY (HistoryTreeWidget) | |
Private Attributes | |
Project * | m_project |
History Widget for cnetsuite.
This widget shows the history of work orders performed on the project.
2012-07-23 Steven Lambright - Added/fixed documentation, improved implementation of addToHistory to look for alternative text/not display blank items.
2012-07-23 Steven Lambright and Stuart Sides - Added display of undo stack
2012-07-27 Kimberly Oyama and Steven Lambright - Added resizeEvent() and improved implementation of refit(). 2012-07-31 Kimberly Oyama - Added comments to some of the methods.
Definition at line 28 of file HistoryTreeWidget.h.
Construct a history tree widget.
project | The project to show history for |
parent | The Qt-relationship parent |
Definition at line 17 of file HistoryTreeWidget.cpp.
References addToHistory(), handleUndoIndexChanged(), refit(), and showHistory().
|
virtual |
Clean up allocated memory.
Definition at line 44 of file HistoryTreeWidget.cpp.
|
privateslot |
Add a single work order to the display.
This uses the QUndoCommand text (if it's blank, it uses the QAction text). If there is no text, this does nothing.
workOrder | The work order to display the history for |
Definition at line 108 of file HistoryTreeWidget.cpp.
References refit(), removeFromHistory(), and updateProgressWidgets().
Referenced by HistoryTreeWidget(), and showHistory().
|
privateslot |
The project's undo stack has changed.
Display the changed states appropriately.
Definition at line 206 of file HistoryTreeWidget.cpp.
References markNotUndone(), markUndone(), and undoCommandToTreeItem().
Referenced by HistoryTreeWidget().
|
privateslot |
Display the item as not an item that has been undone - it's working or done.
This colors it black and sets the text to completed (only visible if there is no progress bar).
treeItem | The given GUI tree item/row to color appropriately. |
Definition at line 181 of file HistoryTreeWidget.cpp.
Referenced by handleUndoIndexChanged().
|
privateslot |
Display the item as an item that has been undone.
This colors it gray and sets the text to Undone.
treeItem | The given GUI tree item/row to color appropriately. |
Definition at line 195 of file HistoryTreeWidget.cpp.
Referenced by handleUndoIndexChanged().
|
private |
This resizes the columns to an okay width for viewing all of the data cleanly.
This method depends on sizeHintForColumn() for good column sizes.
Definition at line 87 of file HistoryTreeWidget.cpp.
Referenced by addToHistory(), and HistoryTreeWidget().
|
privateslot |
A work order was lost...
compensate by removing it from the tree.
Definition at line 224 of file HistoryTreeWidget.cpp.
References undoCommandToTreeItem().
Referenced by addToHistory().
|
privateslot |
This resets the tree widget and re-initializes.
Definition at line 272 of file HistoryTreeWidget.cpp.
References addToHistory(), and Isis::Project::workOrderHistory().
Referenced by HistoryTreeWidget().
|
protected |
Get the preferred size of a given column.
This is used by resizeColumnToContents().
The work order name column prefers space not taken by other columns. The progress column prefers 200. The date column prefers a little more than the text size of a date.
Definition at line 58 of file HistoryTreeWidget.cpp.
|
privateslot |
Get the QTreeWidgetItem associated with the given undo command (work order).
Returns NULL if none found or given NULL.
undoCommand | A work order |
Definition at line 249 of file HistoryTreeWidget.cpp.
Referenced by handleUndoIndexChanged(), and removeFromHistory().
|
privateslot |
We need to manually manage these progress widgets because QTreeWidget does a poor job of it.
This should be called when the progress bar instances have changed (new progress, lost a progress, etc...). This is not necessary when the progress values have changed.
Failing to call this method results in seg faults when other events occur - such as a resize event.
Definition at line 163 of file HistoryTreeWidget.cpp.
Referenced by addToHistory().