Engauge Digitizer 2
Loading...
Searching...
No Matches
DlgSettingsCurveAddRemove.h
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef DLG_SETTINGS_CURVE_ADD_REMOVE_H
8#define DLG_SETTINGS_CURVE_ADD_REMOVE_H
9
10#include "DlgSettingsAbstractBase.h"
11#include <QItemSelection>
12#include <QModelIndex>
13
14class CurveNameList;
15class QGridLayout;
16class QListView;
17class QPushButton;
18
21{
22 Q_OBJECT;
23
24public:
28
29 virtual void createOptionalSaveDefault (QHBoxLayout *layout);
30 virtual QWidget *createSubPanel ();
32
33private slots:
34 void slotDataChanged (const QModelIndex &topLeft,
35 const QModelIndex &bottomRight,
36 const QVector<int> &roles);
37 void slotNew ();
38 void slotRemove ();
39 void slotSaveDefault();
40 void slotSelectionChanged (QItemSelection, QItemSelection);
41
42protected:
43 virtual void handleOk ();
44
45private:
46
47 void appendCurveName (const QString &curveNameNew,
48 const QString &curveNameOriginal,
49 int numPoints);
50 void createButtons (QGridLayout *layout, int &row);
51 void createListCurves (QGridLayout *layout, int &row);
52 bool endsWithNumber (const QString &str) const;
53 void insertCurveName (int row,
54 const QString &curveNameNew,
55 const QString &curveNameOriginal,
56 int numPoints);
57 QString nextCurveName () const; // Pick good curve name to go at currentRow()
58 int numberAtEnd (const QString &str) const;
59 void removeSelectedCurves();
60 void updateControls ();
61
62 CurveNameList *m_curveNameList; // Model for m_listCurves
63 QListView *m_listCurves; // Use QListView instead of QListWidget so validators can be used
64
65 QPushButton *m_btnAdd;
66 QPushButton *m_btnRemove;
67 QPushButton *m_btnRename;
68
69 QPushButton *m_btnSaveDefault;
70};
71
72#endif // DLG_SETTINGS_CURVE_ADD_REMOVE_H
Command queue stack.
Definition CmdMediator.h:24
Model for DlgSettingsCurveAddRemove and CmdSettingsCurveAddRemove.
Abstract base class for all Settings dialogs.
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
MainWindow & mainWindow()
Get method for MainWindow.
Dialog for editing curve names settings.
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.
virtual void handleOk()
Process slotOk.
void load(CmdMediator &cmdMediator)
Load settings from Document.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:78