Engauge Digitizer 2
Loading...
Searching...
No Matches
DlgImportAdvanced Class Reference

Dialog for setting the advanced parameters in a newly imported Document. More...

#include <DlgImportAdvanced.h>

Inheritance diagram for DlgImportAdvanced:
Inheritance graph
Collaboration diagram for DlgImportAdvanced:
Collaboration graph

Public Member Functions

 DlgImportAdvanced (MainWindow &mainWindow)
 Single constructor.
virtual void createOptionalSaveDefault (QHBoxLayout *layout)
 Let subclass define an optional Save As Default button.
virtual QWidget * createSubPanel ()
 Create dialog-specific panel to which base class will add Ok and Cancel buttons.
DocumentAxesPointsRequired documentAxesPointsRequired () const
 Number of axes points selected by user.
virtual void handleOk ()
 Process slotOk.
virtual void load (CmdMediator &cmdMediator)
 Load settings from Document.
unsigned int numberCoordSystem () const
 Number of coordinate systems selected by user.
virtual void setSmallDialogs (bool smallDialogs)
 If false then dialogs have a minimum size so all controls are visible.
Public Member Functions inherited from DlgSettingsAbstractBase
 DlgSettingsAbstractBase (const QString &title, const QString &dialogName, MainWindow &mainWindow)
 Single constructor.
virtual ~DlgSettingsAbstractBase ()

Additional Inherited Members

Protected Member Functions inherited from DlgSettingsAbstractBase
CmdMediatorcmdMediator ()
 Provide access to Document information wrapped inside CmdMediator.
void addPixmap (QGraphicsScene &scene, const QPixmap &pixmap)
 Adds pixmap to the scene.
void createWhatsThis (QGridLayout *layout, ButtonWhatsThis *button, int row, int column)
 Create a WhatsThis button in a grid layout.
void enableOk (bool enable)
 Let leaf subclass control the Ok button.
void finishPanel (QWidget *subPanel, int minimumWidth=MINIMUM_DIALOG_WIDTH, int minimumHeightOrZero=0)
 Add Ok and Cancel buttons to subpanel to get the whole dialog.
MainWindowmainWindow ()
 Get method for MainWindow.
const MainWindowmainWindow () const
 Const get method for MainWindow.
void populateColorComboWithoutTransparent (QComboBox &combo)
 Add colors in color palette to combobox, without transparent entry at end.
void populateColorComboWithTransparent (QComboBox &combo)
 Add colors in color palette to combobox, with transparent entry at end.
void setCmdMediator (CmdMediator &cmdMediator)
 Store CmdMediator for easy access by the leaf class.
void setDisableOkAtStartup (bool disableOkAtStartup)
 Override the default Ok button behavior applied in showEvent.
Static Protected Attributes inherited from DlgSettingsAbstractBase
static int MINIMUM_DIALOG_WIDTH = 380
 Dialog layout constant that guarantees every widget has sufficient room. Can be increased by finishPanel.
static int MINIMUM_PREVIEW_HEIGHT = 100
 Dialog layout constant that guarantees preview has sufficent room.

Detailed Description

Dialog for setting the advanced parameters in a newly imported Document.

Definition at line 19 of file DlgImportAdvanced.h.

Constructor & Destructor Documentation

◆ DlgImportAdvanced()

DlgImportAdvanced::DlgImportAdvanced ( MainWindow & mainWindow)

Single constructor.

Definition at line 17 of file DlgImportAdvanced.cpp.

17 :
18 DlgSettingsAbstractBase (tr ("Import Advanced"),
19 "DlgImportAdvanced",
21{
22 LOG4CPP_INFO_S ((*mainCat)) << "DlgImportAdvanced::DlgImportAdvanced";
23
24 QWidget *subPanel = createSubPanel ();
25 finishPanel (subPanel,
27
28 // Accept even the default value without any additional actions, rather than delay the Ok button to after a change
29 enableOk (true);
31}
const int MINIMUM_DIALOG_WIDTH_COORDS
log4cpp::Category * mainCat
Definition Logger.cpp:14
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
DlgSettingsAbstractBase(const QString &title, const QString &dialogName, MainWindow &mainWindow)
Single constructor.
void finishPanel(QWidget *subPanel, int minimumWidth=MINIMUM_DIALOG_WIDTH, int minimumHeightOrZero=0)
Add Ok and Cancel buttons to subpanel to get the whole dialog.
void enableOk(bool enable)
Let leaf subclass control the Ok button.
void setDisableOkAtStartup(bool disableOkAtStartup)
Override the default Ok button behavior applied in showEvent.
MainWindow & mainWindow()
Get method for MainWindow.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

Member Function Documentation

◆ createOptionalSaveDefault()

void DlgImportAdvanced::createOptionalSaveDefault ( QHBoxLayout * layout)
virtual

Let subclass define an optional Save As Default button.

Implements DlgSettingsAbstractBase.

Definition at line 33 of file DlgImportAdvanced.cpp.

34{
35 LOG4CPP_INFO_S ((*mainCat)) << "DlgImportAdvanced::createOptionalSaveDefault";
36}

◆ createSubPanel()

QWidget * DlgImportAdvanced::createSubPanel ( )
virtual

Create dialog-specific panel to which base class will add Ok and Cancel buttons.

Implements DlgSettingsAbstractBase.

Definition at line 38 of file DlgImportAdvanced.cpp.

39{
40 LOG4CPP_INFO_S ((*mainCat)) << "DlgImportAdvanced::createSubPanel";
41
42 QWidget *subPanel = new QWidget ();
43 QGridLayout *layout = new QGridLayout (subPanel);
44 subPanel->setLayout (layout);
45
46 int row = 0;
47
48 // Coordinate system count
49 QLabel *labelCoordCount = new QLabel (QString ("%1:").arg (tr ("Coordinate System Count")));
50 layout->addWidget (labelCoordCount, row, 1);
51
52 m_spinCoordSystemCount = new QSpinBox;
53 m_spinCoordSystemCount->setMinimum (1);
54 m_spinCoordSystemCount->setValue (1);
55 m_spinCoordSystemCount->setWhatsThis (tr ("Coordinate System Count\n\n"
56 "Specifies the total number of coordinate systems that will be used in the imported image. "
57 "There can be one or more graphs in the image, and each graph can have one or more "
58 "coordinate systems. Each coordinate system is defined by a pair of coordinate axes."));
59 connect (m_spinCoordSystemCount, SIGNAL (valueChanged (const QString &)), this, SLOT (slotCoordSystemCount (const QString &)));
60 layout->addWidget (m_spinCoordSystemCount, row++, 2);
61
62 // Axes point count
63 QLabel *labelPointCount = new QLabel (QString ("%1:").arg (tr ("Graph Coordinates Definition")));
64 layout->addWidget (labelPointCount, row, 1);
65
66 m_btnAxesPointCount2 = new QRadioButton (tr ("1 scale bar - Used for maps with a scale bar defining the map scale"));
67 m_btnAxesPointCount2->setWhatsThis (tr ("The two endpoints of the scale bar will define the scale of a map. The scale bar can "
68 "edited to set its length.\n\n"
69 "This setting is used when importing a map that has only a scale bar "
70 "to define distance, rather than a graph with axes that define two coordinates."));
71 connect (m_btnAxesPointCount2, SIGNAL (toggled (bool)), this, SLOT (slotAxesPointCount (bool)));
72 layout->addWidget (m_btnAxesPointCount2, row++, 2);
73
74 m_btnAxesPointCount3 = new QRadioButton (tr ("3 axis points - Used for graphs with both coordinates defined on each axis"));
75 m_btnAxesPointCount3->setChecked (true); // This is the traditional setting, and so is used as the default
76 m_btnAxesPointCount3->setWhatsThis (tr ("Three axes points will define the coordinate system. Each will have both "
77 "x and y coordinates.\n\n"
78 "This setting is always used when importing images in non-advanced mode.\n\n"
79 "In total, there will be three points as (x1,y1), (x2,y2) "
80 "and (x3,y3)."));
81 connect (m_btnAxesPointCount3, SIGNAL (toggled (bool)), this, SLOT (slotAxesPointCount (bool)));
82 layout->addWidget (m_btnAxesPointCount3, row++, 2);
83
84 m_btnAxesPointCount4 = new QRadioButton (tr ("4 axis points - Used for graphs with only one coordinate defined on each axis"));
85 m_btnAxesPointCount4->setWhatsThis (tr ("Four axes points will define the coordinate system. Each will have a single "
86 "x or y coordinate.\n\n"
87 "This setting is required when the x coordinate of the y axis is unknown, and/or "
88 "the y coordinate of the x axis is unknown.\n\n"
89 "In total, there will be two points on the x axis as (x1) and "
90 "(x2), and two points on the y axis as (y1) and (y2)."));
91 connect (m_btnAxesPointCount4, SIGNAL (toggled (bool)), this, SLOT (slotAxesPointCount (bool)));
92 layout->addWidget (m_btnAxesPointCount4, row++, 2);
93
94 return subPanel;
95}

◆ documentAxesPointsRequired()

DocumentAxesPointsRequired DlgImportAdvanced::documentAxesPointsRequired ( ) const

Number of axes points selected by user.

Definition at line 97 of file DlgImportAdvanced.cpp.

98{
99 if (m_btnAxesPointCount2->isChecked ()) {
101 } else if (m_btnAxesPointCount3->isChecked ()) {
103 } else {
105 }
106}
@ DOCUMENT_AXES_POINTS_REQUIRED_3
@ DOCUMENT_AXES_POINTS_REQUIRED_4
@ DOCUMENT_AXES_POINTS_REQUIRED_2

◆ handleOk()

void DlgImportAdvanced::handleOk ( )
virtual

Process slotOk.

Implements DlgSettingsAbstractBase.

Definition at line 108 of file DlgImportAdvanced.cpp.

109{
110 LOG4CPP_INFO_S ((*mainCat)) << "DlgImportAdvanced::handleOk";
111
112 setResult (QDialog::Accepted); // Set return value so Ok button is not handled like the Cancel button
113
114 hide ();
115}

◆ load()

void DlgImportAdvanced::load ( CmdMediator & cmdMediator)
virtual

Load settings from Document.

Implements DlgSettingsAbstractBase.

Definition at line 117 of file DlgImportAdvanced.cpp.

118{
119 LOG4CPP_INFO_S ((*mainCat)) << "DlgImportAdvanced::load";
120}

◆ numberCoordSystem()

unsigned int DlgImportAdvanced::numberCoordSystem ( ) const

Number of coordinate systems selected by user.

Definition at line 122 of file DlgImportAdvanced.cpp.

123{
124 return unsigned (m_spinCoordSystemCount->value ());
125}

◆ setSmallDialogs()

void DlgImportAdvanced::setSmallDialogs ( bool smallDialogs)
virtual

If false then dialogs have a minimum size so all controls are visible.

Implements DlgSettingsAbstractBase.

Definition at line 127 of file DlgImportAdvanced.cpp.

128{
129}

The documentation for this class was generated from the following files: