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

Merge branch 'ipceDocks' of https://github.com/USGS-Astrogeology/ISIS3 into ipceDocks

parents 87a73f90 c55e380d
Loading
Loading
Loading
Loading
+26 −8
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@
#include <QDateTime>
#include <QTreeView>
#include <QVariant>
#include <QTabWidget>


#include "AbstractProjectItemView.h"
#include "Directory.h"
@@ -85,6 +87,8 @@ namespace Isis {

    QWidget *centralWidget = new QWidget;
    setCentralWidget(centralWidget);
    setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);
    //setDockOptions(GroupedDragging | AllowTabbedDocks);
    //centralWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    //centralWidget->hide();
    setDockNestingEnabled(true);
@@ -338,6 +342,10 @@ namespace Isis {
    m_fileMenuActions.append(exitAction);
    m_permToolBarActions.append(exitAction);

    QAction *tabViewsAction = new QAction("Tab Views", this);
    connect( tabViewsAction, SIGNAL(triggered()), this, SLOT(tabViews()) );
    m_viewMenuActions.append(tabViewsAction);

    QAction *undoAction = m_directory->undoAction();
    undoAction->setShortcut(Qt::Key_Z | Qt::CTRL);

@@ -761,13 +769,23 @@ namespace Isis {


  /**
   * PlaceHolder for the option to tab all views. (This was setTabbedViewMode in the old code)
   * Tabs all open attached/detached views
   */
  void IpceMainWindow::tabAllViews() {
//  QMdiArea *mdiArea = qobject_cast<QMdiArea *>( centralWidget() );
//  mdiArea->setViewMode(QMdiArea::TabbedView);
//  m_cascadeViewsAction->setEnabled(false);
//  m_tileViewsAction->setEnabled(false);
  void IpceMainWindow::tabViews() {
    // tabifyDockWidget() takes two widgets and tabs them, so an easy way to do
    // this is to grab the first view and tab the rest with the first.
    QDockWidget *firstView = m_viewDocks.first();

    foreach (QDockWidget *currentView, m_viewDocks) {
      // We have to reattach a view before it can be tabbed. If it is attached,
      // this will have no affect.
      currentView->setFloating(false);

      if (currentView == firstView) {
        continue;
      }
      tabifyDockWidget(firstView, currentView);
    }
  }


+10 −2
Original line number Diff line number Diff line
@@ -145,6 +145,14 @@ namespace Isis {
   *   @history 2018-06-15 Tracie Sucharski - Fixed break to recent projects.  The readSettings
   *                           must be called before initializeActions to get the recent projects
   *                           from the config file.
   *   @history 2018-06-19 Kaitlyn Lee - Added tabViews() and the menu option under the View menu to
   *                           tab the views. Currently, this can tab all attached/detached views. I
   *                           left the line setting dock options to allow grouped dragging, but tabbing
   *                           views does not always work with this enabled. With this option enabled, the
   *                           type of a view will randomly change and setting its type has no effect.
   *                           Use windowType() to get the type. Also added the toolbar title in the
   *                           permanent toolbar constructor. 
   *
   *
   */
  class IpceMainWindow : public QMainWindow {
@@ -170,7 +178,7 @@ namespace Isis {
      void configureThreadLimit();
      void enterWhatsThisMode();

      void tabAllViews();
      void tabViews();

      void raiseWarningTab();
      void cleanupViewDockList(QObject *obj);