dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
workspacesettings.h
Go to the documentation of this file.
1 
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
27 #ifndef WORKSPACESETTINGS_H
28 #define WORKSPACESETTINGS_H
29 
31 #include <QtCore/QObject>
32 #include <QtCore/QStringList>
33 #include <QTabWidget>
34 
35 class QSettings;
36 
37 namespace Core {
38 
39 class ModeManager;
40 class IMode;
41 
42 namespace Internal {
43 
44  namespace Ui {
45  class WorkspaceSettings;
46  }
47 
49  {
50  Q_OBJECT
51  public:
52  WorkspaceSettings(QObject *parent = nullptr);
54 
55  // IOptionsPage
56  QString id() const;
57  QString trName() const;
58  QString category() const;
59  QString trCategory() const;
60 
61  QWidget *createPage(QWidget *parent);
62  void apply();
63  void finish();
64  void readSettings(QSettings *qs);
65  void saveSettings(QSettings *qs);
66  int numberOfWorkspaces() const { return m_numberOfWorkspaces; }
67  QString iconName(int i) const { return m_iconNames.at(i); }
68  QString name(int i) const { return m_names.at(i); }
69  QString modeName(int i) const { return m_modeNames.at(i); }
70 
71  signals:
72  void tabBarSettingsApplied(QTabWidget::TabPosition pos, bool movable);
73 
74  public slots:
75  void selectWorkspace(int index, bool store = false);
76  void numberOfWorkspacesChanged(int value);
77  void textEdited(QString string);
78  void iconChanged();
79  void newModeOrder(QVector<IMode *> modes);
80 
81  private:
82  Ui::WorkspaceSettings *m_page;
83  QStringList m_iconNames;
84  QStringList m_names;
85  QStringList m_modeNames;
86  int m_currentIndex;
87  int m_previousNumberOfWorkspaces;
88  int m_numberOfWorkspaces;
89  int m_tabBarPlacementIndex;
90  bool m_allowTabBarMovement;
91  static const int MAX_WORKSPACES;
92  };
93 
94 } // namespace Internal
95 } // namespace Core
96 
97 #endif // WORKSPACESETTINGS_H
void selectWorkspace(int index, bool store=false)
void tabBarSettingsApplied(QTabWidget::TabPosition pos, bool movable)
QWidget * createPage(QWidget *parent)
for i
Definition: OPPlots.m:140
void newModeOrder(QVector< IMode * > modes)
WorkspaceSettings(QObject *parent=nullptr)
The IOptionsPage is an interface for providing options pages.
Definition: ioptionspage.h:42