Commit 76e142b2 authored by Summer Stapleton's avatar Summer Stapleton
Browse files

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

parents fa7e7a2a efe9fa1d
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -80,24 +80,20 @@ namespace Isis {
      QMainWindow(parent) {
    m_maxThreadCount = -1;

    //  Set the initialize size of the mainwindow to fullscreen so that created views do not
    //  get squished.  Saved projects with view had the internal widgets squished because the
    //  initial size of this mainwindow was small and it does not get restored to the saved project
    //  size until after views are created.  For instance, the viewports within a CubeDnView were
    //  restored to a small size based on the original mainwindow size.  If the internal state
    //  of the views such as the viewport sizes, zooms, etc get serialized, this code will not be
    //  needed.
    QDesktopWidget deskTop;
    QRect mainScreenSize = deskTop.availableGeometry(deskTop.primaryScreen());
    resize(mainScreenSize.width(), mainScreenSize.height());

    QWidget *centralWidget = new QWidget;
    setCentralWidget(centralWidget);

    setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::South);

    // This was causing some buggy behavior, but this is what we would ultimately like.
    // Allows a user to undock a group of tabs.
    //setDockOptions(GroupedDragging | AllowTabbedDocks);

    //centralWidget->hide();
    setDockNestingEnabled(true);

    //  Set the splitter frames to a reasonable color/size for resizing the docks.
    setStyleSheet("QMainWindow::separator {background: gray; width: 10; height: 10px;}");
    setStyleSheet("QMainWindow::separator {background: black; width: 3; height: 3px;}");

    try {
      m_directory = new Directory(this);
@@ -528,7 +524,12 @@ namespace Isis {
    QSettings globalSettings(FileName("$HOME/.Isis/" + appName + "/ipce.config").expanded(),
        QSettings::NativeFormat);

    if (project->isTemporaryProject()) {
    // If no config file exists and a user immediately opens a project,
    // the project's geometry will be saved as a default for when ipce is
    // opened again. Previously, the ipce's default size was small,
    // until a user opened ipce (but not a project) and resized to how they
    // wanted it to be sized, then closed ipce.
    if (project->isTemporaryProject() || !globalSettings.contains("geometry")) {
      globalSettings.setValue("geometry", QVariant(geometry()));
    }

+27 −17
Original line number Diff line number Diff line
@@ -141,20 +141,21 @@ namespace Isis {
   *   @history 2018-06-13 Tracie Sucharski - Fixed cleanup of views and QDockWidgets.
   *   @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. Removed code adding the save active control net button and
   *                           the toolpad, since control nets can be saved with the project save button.
   *                           not needed. Removed code adding the save active control net button
   *                           and the toolpad, since control nets can be saved with the project
   *                           save button.
   *   @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-18 Makayla Shepherd - Set the QApplication name so that BundleAdjust does
   *                           not output text to the command line for ipce. Fixes #4171.
   *   @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.
   *                           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.
   *   @history 2018-06-22 Tracie Sucharski - Cleanup destruction of dock widgets and the views they
   *                           hold.  Extra destroy slots were causing double deletion of memory.
   *   @history 2018-06-22 Tracie Sucharski - Added a showEvent handler so that the project clean
@@ -164,18 +165,27 @@ namespace Isis {
   *   @history 2018-07-07 Summer Stapleton - Added check in the closeEvent() for changes to any
   *                           TemplateEditorWidget currently open to create a pop-up warning/
   *                           option to save.
   *   @history 2018-07-09 Kaitlyn Lee - Added tileViews() and the menu option to tile all docked/undocked
   *                           and tabbed/untabbed views. Changed removeView() to delete the parent dock widget.
   *                           If we do not delete the dock widget, an empty dock widget will remain where the
   *                           view used to be.
   *   @history 2018-07-09 Kaitlyn Lee - Added tileViews() and the menu option to tile all
   *                           docked/undocked and tabbed/untabbed views. Changed removeView() to
   *                           delete the parent dock widget. If we do not delete the dock widget,
   *                           an empty dock widget will remain where the view used to be.
   *   @history 2018-07-10 Tracie Sucharski - Change initial interface of views to tabbed view.
   *                           Changed the QMainWindow separator to a different color and wider size
   *                           for ease of use.  Create the QMainWindow initial size to prevent the
   *                           Viewports in CubeDnView from being created as a small size.
   *   @history 2018-07-11 Kaitlyn Lee - Added a value in the project settings that stores whether a
   *                           project was in fullscreen or not when saved. If not, we call showNormal()
   *                           to restore the poject's window size. This also fixes the warning/history tabs
   *                           being misplaced when opening a project. Fixes #5175.
   *                           project was in fullscreen or not when saved. If not, we call
   *                           showNormal() to restore the poject's window size. This also fixes the
   *                           warning/history tabs being misplaced when opening a project.
   *                           Fixes #5175. References #5436.
   *   @history 2018-07-12 Kaitlyn Lee - Removed code that makes the window fullscreen in memory,
   *                           since this was causing a project's window size to not be restored
   *                           when opening from the command line. Decreased the size and changed
   *                           the color of the splitter. In writeGlobalSettings(), check to see if
   *                           the geometry value does not exist in the config file. This allows the
   *                           geometry to be saved if the config file does not exist and a user
   *                           opens a project. Before, it would not save the geometry because the
   *                           opened project was not temporary. References #5433
   */
  class IpceMainWindow : public QMainWindow {
      Q_OBJECT
+7 −5
Original line number Diff line number Diff line
@@ -24,11 +24,13 @@

#include <QAction>
#include <QDebug>
#include <QDesktopWidget>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QList>
#include <QMainWindow>
#include <QRect>
#include <QSizePolicy>
#include <QWidget>

@@ -64,11 +66,11 @@ namespace Isis {
   */
  QSize AbstractProjectItemView::sizeHint() const {

    //  Size hint is make ridiculously large as a hack to have the views fill the available dock
    //  Size hint is made ridiculously large as a hack to have the views fill the available dock
    //  space. SizePolicy alone did not work.
    // TODO:  There should be a better way to do this.
    //return QSize(800, 600);
    return QSize(3000, 1500);
    QDesktopWidget deskTop;
    QRect availableSpace = deskTop.availableGeometry(deskTop.primaryScreen());
    return QSize( .89 * availableSpace.width(), .5 * availableSpace.height() );
  }


+15 −9
Original line number Diff line number Diff line
@@ -62,22 +62,28 @@ namespace Isis {
   *                           to be main windows themselves, changing from an mdi interface to an
   *                           sdi interface.
   *   @history 2018-05-30 Tracie Sucharski - Added the WindowFlag to set this as a Widget.
   *   @history 2018-06-15 Kaitlyn Lee - Removed methods returing toolbar and menu actions because each
   *                            individual has its own toolbar. These methods are not needed anymore.
   *   @history 2018-06-15 Kaitlyn Lee - Removed methods returing toolbar and menu actions because
   *                            each individual has its own toolbar. These methods are not needed
   *                            anymore.
   *   @history 2018-06-18 Summer Stapleton - Overloaded moveEvent and resizeEvent and added a
   *                           windowChangeEvent signal to allow project to recognize a new save
   *                           state. Fixes #5114
   *   @history 2018-06-25 Kaitlyn Lee - When multiple views are open, there is a possibility of getting
   *                           ambiguous shortcut errors. To counter this, we need a way to focus on one
   *                           widget. Giving the views focus did not work completely. Instead,
   *                           enabling/disabling actions was the best option. Added enableActions(),
   *                           disableActions(), enterEvent(), and leaveEvent(). On default, a view's
   *                           actions are disabled. To enable the actions, move the cursor over the view.
   *                           When a user moves the cursor outside of the view, the actions are disabled.
   *   @history 2018-06-25 Kaitlyn Lee - When multiple views are open, there is a possibility of
   *                           getting ambiguous shortcut errors. To counter this, we need a way to
   *                           focus on one widget. Giving the views focus did not work completely.
   *                           Instead, enabling/disabling actions was the best option. Added
   *                           enableActions(), disableActions(), enterEvent(), and leaveEvent(). On
   *                           default, a view's actions are disabled. To enable the actions, move
   *                           the cursor over the view. When a user moves the cursor outside of the
   *                           view, the actions are disabled.
   *   @history 2018-07-05 Tracie Sucharski - Added SizePolicy and a large sizeHint.  The large
   *                           sizeHint() is because using sizePolicy with a reasonable sizeHint did
   *                           not work to have views fill the available space in the dock area.
   *                           References #5433.
   *   @history 2018-07-12 Kaitlyn Lee - Changed the sizeHint to be calculated based on the deskTop
   *                           size, instead of being hard-coded. The percentages chosen allow for 2
   *                           CubeDnViews to be opened at once, since CubeDnView has an internal
   *                           size policy. References #5433
   */
  class AbstractProjectItemView : public QMainWindow {

+6 −0
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ namespace Isis {
    m_workspace = new Workspace(false, this);
    m_workspace->mdiArea()->setActivationOrder(QMdiArea::StackingOrder);

    m_directory = directory;

    // Since this is a QMainWindow, set the workspace as the central widget.
    setCentralWidget(m_workspace);

@@ -304,9 +306,13 @@ namespace Isis {

  /**
   * Enables toolbars and toolpad actions/widgets. Overriden method.
   * If an active control network has not been set, do not enable the cnet tool.
   */
  void CubeDnView::enableActions() {
    foreach (QAction *action, actions()) {
      if (action->objectName() == "ControlNetTool" && !m_directory->project()->activeControl()) {
        continue;
      }
      action->setEnabled(true);
    }
    foreach (QWidget *widget, m_childWidgets) {
Loading