Commit 524acf4a authored by Kaitlyn Lee's avatar Kaitlyn Lee
Browse files

Set focus to views when they are added.

parent f9f7fd55
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ namespace Isis {
    //centralWidget->hide();
    setDockNestingEnabled(true);

    //activateWindow();

    try {
      m_directory = new Directory(this);
      connect(m_directory, SIGNAL( newWidgetAvailable(QWidget *) ),
@@ -197,6 +199,7 @@ namespace Isis {
    dock->setAttribute(Qt::WA_DeleteOnClose);
    dock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable |
                      QDockWidget::DockWidgetFloatable);
    dock->setFocusPolicy(Qt::ClickFocus);

    if ( qobject_cast<SensorInfoWidget *>(newWidget) ||
         qobject_cast<TargetInfoWidget *>(newWidget) ||
@@ -206,7 +209,6 @@ namespace Isis {
    else {
      addDockWidget(area, dock, orientation);
    }

    // Connections for cleanup in both directions to make sure both views and docks are cleaned up
    connect(newWidget, SIGNAL(destroyed(QObject *)), dock, SLOT(deleteLater()));
    connect(dock, SIGNAL(destroyed(QObject *)), newWidget, SLOT(deleteLater()));
+2 −0
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ namespace Isis {

    m_toolPad = new ToolPad("Tool Pad", this);
    m_toolPad->setObjectName("toolPad");
     m_toolPad->setFocusPolicy(Qt::ClickFocus);
    addToolBar(Qt::RightToolBarArea, m_toolPad);

    // Create tools
@@ -236,6 +237,7 @@ namespace Isis {
    zoomTool->activate(true);
  }


  /**
   * A slot function that is called when directory emits a siganl that an active
   * control network is set. It enables the control network editor tool in the
+2 −1
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@ namespace Isis {
    action->setIcon(getIcon("viewmag.png"));
    action->setToolTip("Zoom (z)");
    action->setShortcut(Qt::Key_Z);
    action->setShortcutContext(Qt::WidgetShortcut);

    QString text  =
      "<b>Function:</b>  Zoom in or out of the current cube.<br><br>"
      "This tool gives you a <b>click</b> to zoom by 2X and center on the "
@@ -413,4 +415,3 @@ namespace Isis {
  }

}
+16 −8
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ namespace Isis {
    // try to use US locale for numbers so we don't end up printing "," instead
    //   of "." where it might count.

    connect(this, SIGNAL(focusChanged(QWidget *, QWidget *)), this, SLOT(print(QWidget *, QWidget *)));


    for (int i = 1; i < argc; i++) {
        QString arg(argv[i]);
@@ -59,6 +61,12 @@ namespace Isis {
    QDesktopServices::setUrlHandler("http", this, "openUrl");
  }

  void QIsisApplication::print(QWidget *old, QWidget *now) {
    // std::cout<<"OLD: " + old->windowTitle() + ", NEW: " + now->windowTitle()<<std::endl;
    if (old && now) {
      qDebug()<<"OLD: " + old->windowTitle() + ", NEW: " + now->windowTitle();
    }
  }

  /**
  * notify - this function overrides the QApplication notify as
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ namespace Isis {

    public slots:
      void openUrl(QUrl url);
      void print(QWidget *old, QWidget *now);

  };
};

Loading