1 #include "MatchToolNewPointDialog.h"
39 QLabel *ptIdLabel =
new QLabel(
"Point ID:");
40 ptIdLineEdit =
new QLineEdit;
41 ptIdLineEdit->setText(defaultPointId);
42 ptIdLineEdit->selectAll();
43 ptIdLabel->setBuddy(ptIdLineEdit);
44 connect(ptIdLineEdit, SIGNAL(textChanged(
const QString &)),
47 QLabel *listLabel =
new QLabel(
"Displayed Cubes / Selected measures: \n"
48 "Right click on the cube viewport to select approximate measure "
49 "location.\nCubes will be highlighted below as you select "
50 "measure locations.");
52 m_fileList =
new QListWidget;
53 m_fileList->setSelectionMode(QAbstractItemView::NoSelection);
56 m_doneButton =
new QPushButton(
"Done selecting measures");
57 m_doneButton->setToolTip(
"All measures have been selected. Load the new point into the "
58 "control point editor for refinement.");
59 m_doneButton->setWhatsThis(
"You have right-clicked on all cube viewports you want to create "
60 "as a control measure. The new point will be loaded into the "
61 "control point editor for refinement.");
64 if (defaultPointId.isEmpty() || cnet.
ContainsPoint(defaultPointId)) {
65 m_doneButton->setEnabled(
false);
67 QPushButton *cancelButton =
new QPushButton(
"Cancel");
68 cancelButton->setToolTip(
"Cancel without creating a new point.");
69 QHBoxLayout *buttonLayout =
new QHBoxLayout;
70 buttonLayout->addWidget(m_doneButton);
71 buttonLayout->addWidget(cancelButton);
73 connect(m_doneButton, SIGNAL(clicked()),
this, SLOT(accept()));
74 connect(m_doneButton, SIGNAL(clicked()),
this, SIGNAL(measuresFinished()));
76 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
77 connect(cancelButton, SIGNAL(clicked()),
this, SIGNAL(newPointCanceled()));
79 QHBoxLayout *ptIdLayout =
new QHBoxLayout;
80 ptIdLayout->addWidget(ptIdLabel);
81 ptIdLayout->addWidget(ptIdLineEdit);
83 QVBoxLayout *vLayout =
new QVBoxLayout;
84 vLayout->addLayout(ptIdLayout);
85 vLayout->addWidget(listLabel);
86 vLayout->addWidget(m_fileList);
87 vLayout->addLayout(buttonLayout);
90 setWindowTitle(
"Create New ControlPoint");
105 m_fileList->addItems(pointFiles);
111 void MatchToolNewPointDialog::highlightFile(QString file) {
114 if (!found.isEmpty()) {
115 m_fileList->setSelectionMode(QAbstractItemView::ExtendedSelection);
116 found.at(0)->setSelected(
true);
117 m_fileList->setSelectionMode(QAbstractItemView::NoSelection);
123 QString MatchToolNewPointDialog::pointId()
const {
124 return ptIdLineEdit->text();
137 m_doneButton->setEnabled(!text.isEmpty());