Isis 3 Programmer Reference
|
History Widget for ipce. More...
#include <HistoryTreeWidget.h>
Public Member Functions | |
HistoryTreeWidget (Project *project, QWidget *parent=0) | |
Construct a history tree widget. More... | |
virtual | ~HistoryTreeWidget () |
Clean up allocated memory. More... | |
void | addToHistory (QString historyEntry) |
Add a non-workorder history to the display. More... | |
Protected Member Functions | |
int | sizeHintForColumn (int column) const |
Get the preferred size of a given column. More... | |
Private Slots | |
void | addToHistory (WorkOrder *) |
Add a single work order to the display. More... | |
void | updateProgressWidgets () |
We need to manually manage these progress widgets because QTreeWidget does a poor job of it. More... | |
void | markNotUndone (QTreeWidgetItem *) |
Display the item as not an item that has been undone - it's working or done. More... | |
void | markUndone (QTreeWidgetItem *) |
Display the item as an item that has been undone. More... | |
void | handleUndoIndexChanged (int) |
The project's undo stack has changed. More... | |
void | removeFromHistory (QObject *) |
A work order was lost... More... | |
void | showHistory () |
This resets the tree widget and re-initializes. More... | |
void | updateStatus (WorkOrder *) |
QTreeWidgetItem * | undoCommandToTreeItem (const QUndoCommand *) |
Get the QTreeWidgetItem associated with the given undo command (work order). More... | |
Private Member Functions | |
void | refit () |
This resizes the columns to an okay width for viewing all of the data cleanly. More... | |
void | updateStatus (QTreeWidgetItem *) |
Q_DISABLE_COPY (HistoryTreeWidget) | |
Private Attributes | |
QMutex | m_mutex |
Project * | m_project |
History Widget for ipce.
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.
2017-02-06 Tracie Sucharski - Work orders that are not on the QUndoStack are greyed out and italicized.
2017-04-05 Tracie Sucharski - For the last change, method name was changed from onUndoStack to isUndoable.
2017-07-24 Cole Neubauer - Added check in addToHistory() to check if a WorkOrder should be added to the HistoryTree Fixes #4715
2017-08-10 Tyler Wilson - Changed some code in addToHistory function which was causing a segfault. This is a bandaid fix which addresses the immediate problem, but will have to be tackled in a future ticket. Fixes #5096. References #4492.
2017-08-11 Cole Neubauer - Added some checks to avoid segfaults Fixes #5064
2017-11-08 Tyler Wilson - Reverted the code change in #5096 to restore the ProgressBar, and changed code in OpenRecentProjectsWorkOrder.cpp to prevent the segfault which #5096 was addressing. Fixes #5149.
2018-04-07 Tracie Sucharski - Added method to force a history entry using a string rather than a WorkOrder. This should be a temporary method until saving a control is turned into a WorkOrder. This was done for the alpha release simply to notify the user that the control was saved. However, this history entry is not saved/restored to a project.
2018-06-28 Makayla Shepherd - Restored the ProgressBar. Fixes #5228.
Definition at line 50 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(), showHistory(), and Isis::Project::undoStack().
|
virtual |
Clean up allocated memory.
Definition at line 43 of file HistoryTreeWidget.cpp.
void Isis::HistoryTreeWidget::addToHistory | ( | QString | historyEntry | ) |
Add a non-workorder history to the display.
(QString) | historyEntry The string displayed in the history tree |
Definition at line 165 of file HistoryTreeWidget.cpp.
References refit().
Referenced by HistoryTreeWidget(), and showHistory().
|
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 107 of file HistoryTreeWidget.cpp.
References Isis::WorkOrder::bestText(), Isis::WorkOrder::createsCleanState(), Isis::WorkOrder::executionTime(), Isis::WorkOrder::isUndoable(), Isis::WorkOrder::progressBar(), refit(), removeFromHistory(), and updateProgressWidgets().
|
privateslot |
The project's undo stack has changed.
Display the changed states appropriately.
Definition at line 251 of file HistoryTreeWidget.cpp.
References markNotUndone(), markUndone(), undoCommandToTreeItem(), and Isis::Project::undoStack().
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 226 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 240 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 86 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 269 of file HistoryTreeWidget.cpp.
References undoCommandToTreeItem().
Referenced by addToHistory().
|
privateslot |
This resets the tree widget and re-initializes.
Definition at line 317 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 57 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 294 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 205 of file HistoryTreeWidget.cpp.
References Isis::WorkOrder::progressBar().
Referenced by addToHistory().