Commit 5e6f7116 authored by Cole Neubauer's avatar Cole Neubauer
Browse files

Warnings Tab now becomes active on new warning Fixes #5041

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7859 41f8697f-d340-4b68-9986-7bafba869bb8
parent b43dcf32
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ namespace Isis {
              this, SLOT( addView(QWidget *) ) );
      connect(m_directory->project(), SIGNAL(projectLoaded(Project *)),
              this, SLOT(readSettings(Project *)));
      connect(m_directory, SIGNAL( newWarning() ),
              this, SLOT( raiseWarningTab() ) );
    }
    catch (IException &e) {
      throw IException(e, IException::Programmer,
@@ -110,16 +112,16 @@ namespace Isis {

    addDockWidget(Qt::LeftDockWidgetArea, m_projectDock, Qt::Horizontal);

    QDockWidget *warningsDock = new QDockWidget("Warnings", this, Qt::SubWindow);
    warningsDock->setObjectName("warningsDock");
    warningsDock->setFeatures(QDockWidget::DockWidgetClosable |
    m_warningsDock = new QDockWidget("Warnings", this, Qt::SubWindow);
    m_warningsDock->setObjectName("m_warningsDock");
    m_warningsDock->setFeatures(QDockWidget::DockWidgetClosable |
                         QDockWidget::DockWidgetMovable |
                         QDockWidget::DockWidgetFloatable);
    warningsDock->setWhatsThis(tr("This shows notices and warnings from all operations "
    m_warningsDock->setWhatsThis(tr("This shows notices and warnings from all operations "
                          "on the current project."));
    warningsDock->setAllowedAreas(Qt::BottomDockWidgetArea);
    m_directory->setWarningContainer(warningsDock);
    addDockWidget(Qt::BottomDockWidgetArea, warningsDock);
    m_warningsDock->setAllowedAreas(Qt::BottomDockWidgetArea);
    m_directory->setWarningContainer(m_warningsDock);
    addDockWidget(Qt::BottomDockWidgetArea, m_warningsDock);

    QDockWidget *historyDock = new QDockWidget("History", this, Qt::SubWindow);
    historyDock->setObjectName("historyDock");
@@ -130,7 +132,7 @@ namespace Isis {
    historyDock->setAllowedAreas(Qt::BottomDockWidgetArea);
    addDockWidget(Qt::BottomDockWidgetArea, historyDock);
    m_directory->setHistoryContainer(historyDock);
    tabifyDockWidget(warningsDock, historyDock);
    tabifyDockWidget(m_warningsDock, historyDock);

    QDockWidget *progressDock = new QDockWidget("Progress", this, Qt::SubWindow);
    progressDock->setObjectName("progressDock");
@@ -142,7 +144,7 @@ namespace Isis {
    addDockWidget(Qt::BottomDockWidgetArea, progressDock);
    tabifyDockWidget(historyDock, progressDock);

    warningsDock->raise();
    m_warningsDock->raise();

    // Read settings from the default project, "Project"
    readSettings(m_directory->project());
@@ -881,4 +883,11 @@ namespace Isis {
    addView(view);
  }

/**
 * Raises the warningWidget to the front of the tabs. Connected to warning signal from directory.
 */
  void IpceMainWindow::raiseWarningTab() {
    m_warningsDock->raise();
  }

}
+6 −2
Original line number Diff line number Diff line
@@ -87,6 +87,9 @@ namespace Isis {
   *                           (which indicates why it is disabled by default). Fixes #4749.
   *   @history 2017-06-22 Tracie Sucharski - Renamed from CNetSuiteMainWindow when application was
   *                           renamed to ipce from cnetsuite.
   *  @history 2017-07-14 Cole Neubauer - Added private slot raiseWarningTab to be able to raise
   *                           the warning tab when a new warning happens.
   *                           Fixes #5041 
   */
  class IpceMainWindow : public QMainWindow {
      Q_OBJECT
@@ -117,6 +120,7 @@ namespace Isis {
      void detachActiveView();
      void reattachView();

      void raiseWarningTab();
    private:
      Q_DISABLE_COPY(IpceMainWindow);

@@ -134,7 +138,7 @@ namespace Isis {
      QPointer<Directory> m_directory;

      QDockWidget *m_projectDock;

      QDockWidget *m_warningsDock;
      /**
       * This is the "goal" or "estimated" maximum number of active threads running in this program
       *   at once. For now, the GUI consumes 1 thread and QtConcurrent
+8 −7
Original line number Diff line number Diff line
@@ -1168,6 +1168,7 @@ namespace Isis {
   */
  void Directory::showWarning(QString text) {
    m_warningTreeWidget->showWarning(text);
    emit newWarning();
  }


+4 −0
Original line number Diff line number Diff line
@@ -142,6 +142,9 @@ namespace Isis {
   *                           doing anything.  However, I'm leaving the method for now, because
   *                           once the views are connected, we will probably need to cleanup the
   *                           connections when the view is closed.  Fixes #4959.
   *  @history 2017-07-14 Cole Neubauer - Added a signal for IpceMainWindow to listen to to be
   *                           available to bring the Warning tab to the top when a new warning
   *                           is added Fixes #5041 
   */
  class Directory : public QObject {
    Q_OBJECT
@@ -251,6 +254,7 @@ namespace Isis {
      void save(QXmlStreamWriter &stream, FileName newProjectRoot) const;

    signals:
      void newWarning();
      void newWidgetAvailable(QWidget *newWidget);

      void controlPointAdded(QString newPointId);