Commit 8efb1ece authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

PROG: Added new method to allow a non-WorkORder entry to be added to the history tree widget.

parent 4893638e
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -159,6 +159,43 @@ namespace Isis {
  }


  /**
   * Add a non-workorder history to the display.
   *
   * @param (QString) historyEntry The string displayed in the history tree
   */
  void HistoryTreeWidget::addToHistory(QString historyEntry) {

    QString data = historyEntry;

    QStringList columnData;
    columnData.append(data);

    QTreeWidgetItem *newItem = new QTreeWidgetItem(columnData);


    // Do font for progress text
    QFont progressFont = newItem->font(1);
    progressFont.setItalic(true);
    newItem->setFont(1, progressFont);
    newItem->setForeground(1, Qt::gray);

    this->insertTopLevelItem(0, newItem);
//      invisibleRootItem()->addChild(newItem);

    //Sometimes the pointer returned by this call is 0 (hence the check).
    //So we are not creating a progress bar for every work order which would
    //include those that do not need it.

//    if(workOrder->progressBar() )  {
//      setItemWidget(newItem, 1, new ProgressBar);
////        this->setItemWidget(newItem, 1, workOrder->progressBar() );
//    }
    scrollToItem(newItem);
    refit();
  }


  /**
   * 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
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ namespace Isis {
      HistoryTreeWidget(Project *project, QWidget *parent = 0);
      virtual ~HistoryTreeWidget();

      void addToHistory(QString historyEntry);

    protected:
      int sizeHintForColumn(int column) const;