Commit 71922157 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

In qview's FindTool fixed CTRL+F shortcut to activate dialog. Fixes #2087.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@5840 41f8697f-d340-4b68-9986-7bafba869bb8
parent 62ab3142
Loading
Loading
Loading
Loading
+36 −18
Original line number Diff line number Diff line
@@ -58,7 +58,19 @@ namespace Isis {
    p_findPoint->setShortcut(Qt::CTRL + Qt::Key_F);
    p_findPoint->setText("&Find Point");
    p_findPoint->setIcon( QPixmap(toolIconDir() + "/find.png") );
    QString text =
      "<b>Function:</b> Centers all linked viewports to the selected lat/lon. \
      The user can click anywhere on the image to have that point centered, or \
      they can use the shortcut or button to bring up a window that they can \
      enter a specific lat/lon position into. \
      <p><b>Shortcut: </b> Ctrl+F </p> \
      <p><b>Hint: </b> This option will only work if the image has a camera \
            model or is projected, and will only center the point on images  \
            where the selected lat/lon position exists.</p>";
    p_findPoint->setWhatsThis(text);
    p_findPoint->setEnabled(false); 
    connect( p_findPoint, SIGNAL( triggered() ),
             p_dialog, SLOT( show() ) ); 
  }

  FindTool::~FindTool() {
@@ -66,6 +78,7 @@ namespace Isis {
    delete p_groundTab->p_lonLineEdit->validator();
  }

  
  /**
   * Creates the dialog used by this tool
   *
@@ -83,13 +96,16 @@ namespace Isis {

    // Create the action buttons
    QPushButton *okButton = new QPushButton("Ok");
    connect(okButton, SIGNAL(clicked()), this, SLOT(handleOkClicked()));
    connect( okButton, SIGNAL( clicked() ), 
             this, SLOT( handleOkClicked() ) );

    QPushButton *recordButton = new QPushButton("Record Point");
    connect(recordButton, SIGNAL(clicked()), this, SLOT(handleRecordClicked()));
    connect( recordButton, SIGNAL( clicked() ), 
             this, SLOT( handleRecordClicked() ) );

    QPushButton *closeButton = new QPushButton("Close");
    connect(closeButton, SIGNAL(clicked()), p_dialog, SLOT(hide()));
    connect( closeButton, SIGNAL( clicked() ), 
             p_dialog, SLOT( hide() ) );

    // Put the buttons in a horizontal orientation
    QHBoxLayout *actionLayout = new QHBoxLayout();
@@ -128,6 +144,7 @@ namespace Isis {
    setLayout(gridLayout);
  }

  
  /**
   * The image tab used by the dialog in the FindTool
   *
@@ -148,9 +165,9 @@ namespace Isis {
    gridLayout->addWidget(lineLabel, 1, 0);
    gridLayout->addWidget(p_lineLineEdit, 1, 1);
    setLayout(gridLayout);

  }

 
  /**
   * Adds the find tool to the toolpad
   *
@@ -170,6 +187,7 @@ namespace Isis {
    return action;
  }

  
  /**
   * Adds the find tool to the menu
   *
@@ -179,6 +197,7 @@ namespace Isis {
    menu->addAction(p_findPoint);
  }

  
  /**
   * Creates the tool bar for the find tool
   *
@@ -202,7 +221,8 @@ namespace Isis {
            model or is projected, and will only center the point on images  \
            where the selected lat/lon position exists.</p>";
    p_showDialogButton->setWhatsThis(text);
    connect(p_showDialogButton, SIGNAL(clicked()), p_dialog, SLOT(show()));
    connect( p_showDialogButton, SIGNAL( clicked() ), 
             p_dialog, SLOT( show() ) );
    p_showDialogButton->setAutoRaise(true);
    p_showDialogButton->setIconSize( QSize(22, 22) );

@@ -217,8 +237,8 @@ namespace Isis {
    p_linkViewportsButton->setToolTip("Link Georeferenced Images");
    p_linkViewportsButton->setWhatsThis("<b>Function: </b> Links all open images that have\
                              a camera model or are map projections");
    connect(p_linkViewportsButton, SIGNAL(clicked()), this,
            SLOT(handleLinkClicked()));
    connect( p_linkViewportsButton, SIGNAL( clicked() ), 
             this, SLOT( handleLinkClicked() ) );
    p_linkViewportsButton->setAutoRaise(true);
    p_linkViewportsButton->setIconSize( QSize(22, 22) );

@@ -227,8 +247,8 @@ namespace Isis {
    p_togglePointVisibleButton->setToolTip("Hide red dot");
    p_togglePointVisibleButton->setCheckable(true);
    p_togglePointVisibleButton->setChecked(true);
    connect(p_togglePointVisibleButton, SIGNAL(clicked()), this,
            SLOT(togglePointVisible()));
    connect( p_togglePointVisibleButton, SIGNAL( clicked() ), 
             this, SLOT( togglePointVisible() ) );

    p_statusEdit = new QLineEdit();
    p_statusEdit->setReadOnly(true);
@@ -251,6 +271,7 @@ namespace Isis {
    return hbox;
  }
  
  
  /**
   * Overriden method to update this tool - Checks if cube is open and
   * checks if the image has camera and/or projection or none and sets
@@ -352,7 +373,6 @@ namespace Isis {
    p_lat = DBL_MAX;
    p_lon = DBL_MAX;


    if (p_tabWidget->tabText( p_tabWidget->currentIndex() ) == "Ground") {
      p_lat = p_groundTab->p_latLineEdit->text().toDouble();
      p_lon = p_groundTab->p_lonLineEdit->text().toDouble();
@@ -367,6 +387,7 @@ namespace Isis {
    updateTool();
  }

  
  /**
   * Slot called when the record button is clicked.  It creates a
   * QPoint from the current line/sample in the active cube
@@ -486,6 +507,7 @@ namespace Isis {
    }
  }

  
  //! toggles visibility of the red circle
  void FindTool::togglePointVisible() {
    // toggle the member boolean that specifies visibility
@@ -533,8 +555,7 @@ namespace Isis {
    //   otherViewportZoomFactor = activeViewportZoomFactor *
    //       (otherViewportResolution / activeViewportResolution)
    if (syncScale) {
      viewportResolutionToMatch = distancePerPixel(activeViewport, p_lat,
                                                   p_lon);
      viewportResolutionToMatch = distancePerPixel(activeViewport, p_lat, p_lon);
    }

    for (int i = 0; i < cubeViewportList()->size(); i++) {
@@ -596,8 +617,7 @@ namespace Isis {
         lat != DBL_MAX && lon != DBL_MAX &&
         groundMap->SetUniversalGround(lat, lon) ) {
      // Distance/pixel
      viewportResolution = Distance(groundMap->Resolution(),
                                    Distance::Meters);
      viewportResolution = Distance(groundMap->Resolution(), Distance::Meters);
      double samp = groundMap->Sample();
      double line = groundMap->Line();

@@ -613,13 +633,11 @@ namespace Isis {
              groundMap->Projection()->LocalRadius() :
              groundMap->Camera()->LocalRadius().meters();

          SurfacePoint point1(
              Latitude(lat1, Angle::Degrees),
          SurfacePoint point1( Latitude(lat1, Angle::Degrees),
                               Longitude(lon1, Angle::Degrees),
                               Distance(radius, Distance::Meters) );

          SurfacePoint point2(
              Latitude(lat2, Angle::Degrees),
          SurfacePoint point2( Latitude(lat2, Angle::Degrees),
                               Longitude(lon2, Angle::Degrees),
                               Distance(radius, Distance::Meters) );

+4 −0
Original line number Diff line number Diff line
@@ -117,6 +117,10 @@ namespace Isis {
   *                          image coordinates - is it supposed to?
   *  @history 2013-01-10 Steven Lambright - Improved sync scale calculations
   *                          to work in more cases. Fixes #953.
   *  @history 2014-05-19 Ian Humphrey - Fixed CTRL+F shortcut and menu option to open Find Tool's
   *                          Find Latitude/Longitude Coordinate dialog window. Added help text
   *                          to Find Tool menu option. Minor coding standards fixes. 
   *                          Fixes #2087.
   */
  class FindTool : public Tool {
      Q_OBJECT