7 #include "DlgImportAdvanced.h"
9 #include "MainWindow.h"
10 #include <QGridLayout>
12 #include <QRadioButton>
20 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgImportAdvanced::DlgImportAdvanced";
32 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgImportAdvanced::createOptionalSaveDefault";
37 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgImportAdvanced::createSubPanel";
39 QWidget *subPanel =
new QWidget ();
40 QGridLayout *layout =
new QGridLayout (subPanel);
41 subPanel->setLayout (layout);
46 QLabel *labelCoordCount =
new QLabel (tr (
"Coordinate System Count:"));
47 layout->addWidget (labelCoordCount, row, 1);
49 m_spinCoordSystemCount =
new QSpinBox;
50 m_spinCoordSystemCount->setMinimum (1);
51 m_spinCoordSystemCount->setValue (1);
52 m_spinCoordSystemCount->setWhatsThis (tr (
"Coordinate System Count\n\n"
53 "Specifies the total number of coordinate systems that will be used in the imported image. "
54 "There can be one or more graphs in the image, and each graph can have one or more "
55 "coordinate systems. Each coordinate system is defined by a pair of coordinate axes."));
56 connect (m_spinCoordSystemCount, SIGNAL (valueChanged (
const QString &)),
this, SLOT (slotImportAdvanced (
const QString &)));
57 layout->addWidget (m_spinCoordSystemCount, row++, 2);
60 QLabel *labelPointCount =
new QLabel (tr (
"Axes Points Count:"));
61 layout->addWidget (labelPointCount, row, 1);
63 m_btnAxesPointCount3 =
new QRadioButton (tr (
"3 points"));
64 m_btnAxesPointCount3->setChecked (
true);
65 m_btnAxesPointCount3->setWhatsThis (tr (
"Three axes points will define the coordinate system. Each will have both "
66 "x and y coordinates.\n\n"
67 "This setting is always used when importing images in non-advanced mode.\n\n"
68 "In total, there will be three points as (x1,y1), (x2,y2) "
70 connect (m_btnAxesPointCount3, SIGNAL (toggled (
bool)),
this, SLOT (slotAxesPointCount (
bool)));
71 layout->addWidget (m_btnAxesPointCount3, row++, 2);
73 m_btnAxesPointCount4 =
new QRadioButton (tr (
"4 points"));
74 m_btnAxesPointCount4->setWhatsThis (tr (
"Four axes points will define the coordinate system. Each will have a single "
75 "x or y coordinate.\n\n"
76 "This setting is required when the x coordinate of the y axis is unknown, and/or "
77 "the y coordinate of the x axis is unknown.\n\n"
78 "In total, there will be two points on the x axis as (x1) and "
79 "(x2), and two points on the y axis as (y1) and (y2)."));
80 connect (m_btnAxesPointCount4, SIGNAL (toggled (
bool)),
this, SLOT (slotAxesPointCount (
bool)));
81 layout->addWidget (m_btnAxesPointCount4, row++, 2);
88 if (m_btnAxesPointCount3->isChecked ()) {
89 return DOCUMENT_AXES_POINTS_REQUIRED_3;
91 return DOCUMENT_AXES_POINTS_REQUIRED_4;
97 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgImportAdvanced::handleOk";
99 setResult (QDialog::Accepted);
106 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgImportAdvanced::load";
111 return m_spinCoordSystemCount->value ();
114 void DlgImportAdvanced::slotAxesPointCount (
bool)
116 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgCoordSystem::slotAxesPointCount";
119 void DlgImportAdvanced::slotCoordSystemCount (
const QString &)
121 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgCoordSystem::slotImportAdvanced";
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
void setDisableOkAtStartup(bool disableOkAtStartup)
Override the default Ok button behavior applied in showEvent.
DocumentAxesPointsRequired documentAxesPointsRequired() const
Number of axes points selected by user.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
unsigned int numberCoordSystem() const
Number of coordinate systems selected by user.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void handleOk()
Process slotOk.
void finishPanel(QWidget *subPanel)
Add Ok and Cancel buttons to subpanel to get the whole dialog.
void enableOk(bool enable)
Let leaf subclass control the Ok button.
DlgImportAdvanced(MainWindow &mainWindow)
Single constructor.
Abstract base class for all Settings dialogs.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...