Salome HOME
Fixing menus.
[modules/paravis.git] / src / PVGUI / PVGUI_ParaViewSettingsPane.h
1 // PARAVIS : ParaView wrapper SALOME module
2 //
3 // Copyright (C) 2010-2014  CEA/DEN, EDF R&D
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 //
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 // File   : PVGUI_ParaViewSettingsPane.h
22 // Author : Vitaly Smetannikov
23 //
24
25
26 #ifndef PVGUI_ParaViewSettingsPane_H
27 #define PVGUI_ParaViewSettingsPane_H
28
29 #include <QtxPagePrefMgr.h>
30
31 class QAbstractButton;
32 class vtkSMProperty;
33 class QShowEvent;
34 class QHideEvent;
35
36 /**!
37  * Almost identical copy/paste of what is found in
38  *    <PARAVIEW>/Qt/Components/pqSettingsDialog.h
39  * This is (almost) the same, except for the inheritance to QtxUserDefinedContent providing the link
40  * to SALOME preference mechanism.
41  * The UI content of pqSettingsDialog is put in a (PARAVIS) widget called pqCustomSettingsWidget.
42  */
43 class PVGUI_ParaViewSettingsPane : public QtxUserDefinedContent
44 {
45   Q_OBJECT
46
47 public:
48   PVGUI_ParaViewSettingsPane(QWidget *parent=0);
49   virtual ~PVGUI_ParaViewSettingsPane();
50
51   /// Implementation of QtxUserDefinedContent interface
52   virtual void store(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
53   virtual void retrieve(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
54
55   signals:
56     void accepted(); // emulate the initial QDialogBox signal since some stuff are connected to it.
57
58 protected:
59     virtual void showEvent(QShowEvent * ev);
60     virtual void hideEvent(QHideEvent * ev);
61
62   // ---- From now on, this the same interface as in pqSettingsDialog
63   private slots:
64     void clicked(QAbstractButton*);
65     void onAccepted();
66     void onRejected();
67     void onRestoreDefaults();
68
69     void onTabIndexChanged(int index);
70     void onChangeAvailable();
71     void showRestartRequiredMessage();
72
73     void filterPanelWidgets();
74
75   signals:
76     void filterWidgets(bool showAdvanced, const QString& text);
77
78   private:
79     void saveInQSettings(const char* key, vtkSMProperty* smproperty);
80
81   private:
82     Q_DISABLE_COPY(PVGUI_ParaViewSettingsPane);
83     class pqInternals;
84     pqInternals* Internals;
85
86     /// Set to true if a setting that requires a restart to take effect
87     /// is modified. Made static to persist across instantiations of
88     /// this class.
89     static bool ShowRestartRequired;
90 };
91
92 #endif