1 #include "CnetEditorSortConfigDialog.h" 12 #include "AbstractTableModel.h" 13 #include "CnetEditorWidget.h" 26 setWindowTitle(
"Table Sorting");
28 QGridLayout *mainLayout =
new QGridLayout;
29 mainLayout->setColumnMinimumWidth(0, 20);
30 setLayout(mainLayout);
34 QLabel *pointTableLabel =
new QLabel(
"<h3>Point Table</h3>");
35 mainLayout->addWidget(pointTableLabel, row, 0, 1, 3);
38 QLabel *pointSortEnableLabel =
new QLabel(
"Sorting Enabled");
39 mainLayout->addWidget(pointSortEnableLabel, row, 1);
47 QLabel *pointLimitLabel =
new QLabel(
"Table Size Limit");
48 mainLayout->addWidget(pointLimitLabel, row, 1);
61 QLabel *measureTableLabel =
new QLabel(
"<h3>Measure Table</h3>");
62 mainLayout->addWidget(measureTableLabel, row, 0, 1, 3);
65 QLabel *measureSortEnableLabel =
new QLabel(
"Sorting Enabled");
66 mainLayout->addWidget(measureSortEnableLabel, row, 1);
74 QLabel *measureLimitLabel =
new QLabel(
"Table Size Limit");
75 mainLayout->addWidget(measureLimitLabel, row, 1);
89 QHBoxLayout *buttonsAreaLayout =
new QHBoxLayout;
91 buttonsAreaLayout->addStretch();
93 QPushButton *okayButton =
new QPushButton(
"&Ok");
94 okayButton->setIcon(QIcon::fromTheme(
"dialog-ok"));
95 buttonsAreaLayout->addWidget(okayButton);
96 connect(okayButton, SIGNAL(clicked()),
98 connect(okayButton, SIGNAL(clicked()),
99 this, SLOT(accept()));
101 QPushButton *applyButton =
new QPushButton(
"&Apply");
102 applyButton->setIcon(QIcon::fromTheme(
"dialog-ok-apply"));
103 buttonsAreaLayout->addWidget(applyButton);
104 connect(applyButton, SIGNAL(clicked()),
107 QPushButton *cancelButton =
new QPushButton(
"&Cancel");
108 cancelButton->setIcon(QIcon::fromTheme(
"dialog-cancel"));
109 buttonsAreaLayout->addWidget(cancelButton);
110 connect(cancelButton, SIGNAL(clicked()),
111 this, SLOT(reject()));
114 buttonsAreaWidget->setLayout(buttonsAreaLayout);
115 mainLayout->addWidget(buttonsAreaWidget, row, 0, 1, 3);
157 QString disabledWarning = tr(
"<font color='red'>Sorting is currently disabled because the " 158 "number of visible rows (%L1) exceeds the applied table size limit option (%L2).</font>");
161 pointModel->sortLimit() < pointModel->getVisibleRowCount()) {
163 disabledWarning.arg(pointModel->getVisibleRowCount()).arg(pointModel->sortLimit()));
179 measureModel->sortLimit() < measureModel->getVisibleRowCount()) {
181 disabledWarning.arg(measureModel->getVisibleRowCount()).arg(measureModel->sortLimit()));
void applySettings()
Apply the user's current settings to the cneteditor widget.
QPointer< QSpinBox > m_pointTableLimitSpinBox
When less than this number, sorting is enabled on the point table.
void refreshWidgetStates()
Enable or disable inputs based on what the user has selected for options so far.
QPointer< CnetEditorWidget > m_cnetWidget
The cneteditor widget we're configuring.
QPointer< QCheckBox > m_pointSortingCheckBox
Enable sorting on the point table.
void readSettings()
Read the cneteditor widget's current settings and set the widget states to match. ...
QPointer< QSpinBox > m_measureTableLimitSpinBox
When less than this number, sorting is enabled on the measure table.
Translates the tree model into a table model.
QPointer< QCheckBox > m_measureSortingCheckBox
Enable sorting on the measure table.
QPointer< QLabel > m_measureTableWarningsLabel
Say (very clearly) if sorting is disabled and why.
Namespace for ISIS/Bullet specific routines.
QPointer< QLabel > m_pointTableWarningsLabel
Say (very clearly) if sorting is disabled and why.
CnetEditorSortConfigDialog(CnetEditorWidget *cnetWidget)
Create a config dialog that configures the given FeatureCnetEditorSort.
~CnetEditorSortConfigDialog()
Clean up allocated memory.