Commit f626f22b authored by Kaitlyn Lee's avatar Kaitlyn Lee
Browse files

Cleaned up IpceMainWindow and CubeDnView

parent f0d678b0
Loading
Loading
Loading
Loading
+6 −20
Original line number Diff line number Diff line
@@ -89,8 +89,6 @@ namespace Isis {
    //centralWidget->hide();
    setDockNestingEnabled(true);

    m_activeView = NULL;

    try {
      m_directory = new Directory(this);
      connect(m_directory, SIGNAL( newWidgetAvailable(QWidget *) ),
@@ -485,22 +483,10 @@ namespace Isis {
   */
  void IpceMainWindow::createToolBars() {
    m_permToolBar = new QToolBar(this);
    m_activeToolBar = new QToolBar(this);
    m_toolPad = new QToolBar(this);

    QSize iconSize(25, 45);

    m_permToolBar->setIconSize(iconSize);
    m_activeToolBar->setIconSize(iconSize);
    m_toolPad->setIconSize(iconSize);

    m_permToolBar->setObjectName("PermanentToolBar");
    m_activeToolBar->setObjectName("ActiveToolBar");
    m_toolPad->setObjectName("ToolPad");

    addToolBar(m_permToolBar);
    addToolBar(m_activeToolBar);
    addToolBar(m_toolPad);

    foreach ( QAction *action, m_directory->permToolBarActions() ) {
      m_permToolBar->addAction(action);
+4 −8
Original line number Diff line number Diff line
@@ -137,7 +137,9 @@ namespace Isis {
   *                           for cleanup because there is no way to get the dock from the view.
   *                           Cleanup connections are made for the views and the docks to ensure
   *                           that cleanup happens for both.  Fixes #5433.
   *  
   *   @history 2018-06-13 Kaitlyn Lee - Since views now inherit from QMainWindow, each individual
   *                           view has its own toolbar, so having an active toolbar and tool pad is
   *                           not needed.
   */
  class IpceMainWindow : public QMainWindow {
      Q_OBJECT
@@ -197,8 +199,6 @@ namespace Isis {
      static const int m_maxRecentProjects = 5;

      QToolBar *m_permToolBar; //!< The toolbar for actions that rarely need to be changed.
      QToolBar *m_activeToolBar; //<! The toolbar for the actions of the current tool.
      QToolBar *m_toolPad; //<! The toolbar for the actions that activate tools.

      QMenu *m_fileMenu; //!< Menu for the file actions
      QMenu *m_projectMenu; //!< Menu for the project actions
@@ -215,13 +215,9 @@ namespace Isis {
      QList<QAction *> m_helpMenuActions;//!< Internal list of help actions

      QList<QAction *> m_permToolBarActions;//!< Internal list of permanent toolbar actions
      QList<QAction *> m_activeToolBarActions;//!< Internal list of active toolbar actions
      QList<QAction *> m_toolPadActions;//!< Internal list of toolpad actions

      QAction *m_cascadeViewsAction; //!< Action that cascades the mdi area
      QAction *m_tileViewsAction; //!< Action that tiles the mdi area

      AbstractProjectItemView *m_activeView; //!< The active view
  };
}

+1 −88
Original line number Diff line number Diff line
@@ -296,7 +296,6 @@ namespace Isis {
    AbstractProjectItemView::addItem(item);
  }


  /**
   * Returns the suggested size
   *
@@ -318,92 +317,6 @@ namespace Isis {
    return item->isShape();
  }


  /**
   * Returns a list of actions appropriate for a file menu.
   *
   * @return @b QList<QAction*> The actions
   */
  QList<QAction *> CubeDnView::fileMenuActions() {
    return m_fileMenu->actions();
  }


  /**
   * Returns a list of actions appropriate for a project menu.
   *
   * @return @b QList<QAction*> The actions
   */
  QList<QAction *> CubeDnView::projectMenuActions() {
    return QList<QAction *>();
  }

  /**
   * Returns a list of actions appropriate for an edit menu.
   *
   * @return @b QList<QAction*> The actions
   */
  QList<QAction *> CubeDnView::editMenuActions() {
    return QList<QAction *>();
  }


  /**
   * Returns a list of actions appropriate for a view menu.
   *
   * @return @b QList<QAction*> The actions
   */
  QList<QAction *> CubeDnView::viewMenuActions() {
    QList<QAction *> result;
    result.append( m_viewMenu->actions() );
    result.append(m_separatorAction);
    result.append( m_windowMenu->actions() );
    return result;
  }


  /**
   * Returns a list of actions appropriate for a settings menu.
   *
   * @return @b QList<QAction*> The actions
   */
  QList<QAction *> CubeDnView::settingsMenuActions() {
    return m_optionsMenu->actions();
  }


  /**
   * Returns a list of actions appropriate for a help menu.
   *
   * @return @b QList<QAction*> The actions
   */
  QList<QAction *> CubeDnView::helpMenuActions() {
    return m_helpMenu->actions();
  }


  /**
   * Returns a list of actions for the permanent tool bar.
   *
   * @return @b QList<QAction*> The actions
   */
  QList<QAction *> CubeDnView::permToolBarActions() {
    return m_permToolBar->actions();
  }


  /**
   * Returns a list of actions for the active tool bar.
   *
   * @return @b QList<QAction*> The actions
   */
  QList<QAction *> CubeDnView::activeToolBarActions() {
    QList<QAction *> actions;
    actions.append(m_activeToolBarAction);
    return actions;
  }


  /**
   * Returns a list of actions for the tool pad.
   *
+4 −13
Original line number Diff line number Diff line
@@ -85,6 +85,10 @@ namespace Isis {
   *                           AbstractProjectItemView now inherits from QMainWindow, so the
   *                           Workspace of this view is the centralWidget. This needs further work
   *                           to cleanup and fit in with the new docked view interface.git
   *   @history 2018-06-13 Kaitlyn Lee - Since views now inherit from QMainWindow, each individual
   *                           view has its own toolbar, so having getters that return toolbar actions
   *                           are unnecessary. Removed methods that returned menu and toolbar actions.
   *                           toolPadActions() is still needed because it is used in Directory.
   */
  class CubeDnView : public AbstractProjectItemView {

@@ -94,15 +98,6 @@ namespace Isis {
      CubeDnView(Directory *directory, QWidget *parent=0);
      ~CubeDnView();

      virtual QList<QAction *> fileMenuActions();
      virtual QList<QAction *> projectMenuActions();
      virtual QList<QAction *> editMenuActions();
      virtual QList<QAction *> viewMenuActions();
      virtual QList<QAction *> settingsMenuActions();
      virtual QList<QAction *> helpMenuActions();

      virtual QList<QAction *> permToolBarActions();
      virtual QList<QAction *> activeToolBarActions();
      virtual QList<QAction *> toolPadActions();

      QSize sizeHint() const;
@@ -112,8 +107,6 @@ namespace Isis {
      void load(XmlStackedHandlerReader *xmlReader, Project *project);
      void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const;



    signals:
      void modifyControlPoint(ControlPoint *controlPoint, QString serialNumber);
      void deleteControlPoint(ControlPoint *controlPoint);
@@ -180,8 +173,6 @@ namespace Isis {
      QToolBar *m_activeToolBar; //!< A tool bar for storing actions
      ToolPad *m_toolPad; //!< A tool bar for storing actions

      QList<QAction *> m_permToolBarActions; //!< The permanent tool bar actions
      QWidgetAction *m_activeToolBarAction; //!< Widget of the active tool
      QList<QAction *> m_toolPadActions; //!< The tool pad actions
  };
}