Salome HOME
Copyright update 2022
[modules/paravis.git] / src / PVGUI / PVGUI_ParaViewSettingsPane.h
1 // PARAVIS : ParaView wrapper SALOME module
2 //
3 // Copyright (C) 2010-2022  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 class LightApp_Application;
36
37 /**!
38  * This class is (almost) a copy/paste of what is found in
39  *    *[PARAVIEW]/Qt/Components/pqSettingsDialog.h*
40  * This is (almost) the same, except for the inheritance to QtxUserDefinedContent providing the link
41  * to SALOME preference mechanism.
42  * The UI content of pqSettingsDialog is put in a (PARAVIS) widget called pqCustomSettingsWidget.
43  */
44 class PVGUI_ParaViewSettingsPane : public QtxUserDefinedContent
45 {
46   Q_OBJECT
47
48 public:
49   PVGUI_ParaViewSettingsPane(QWidget *parent, LightApp_Application * app);
50   virtual ~PVGUI_ParaViewSettingsPane();
51
52   /// Implementation of QtxUserDefinedContent interface
53   virtual void store(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
54   virtual void retrieve(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
55
56   signals:
57     void accepted(); // emulate the initial QDialogBox signal since some stuff are connected to it.
58
59 protected:
60     virtual void showEvent(QShowEvent * ev);
61     virtual void hideEvent(QHideEvent * ev);
62
63   // ---- From now on, this the same interface as in pqSettingsDialog
64   private slots:
65     void clicked(QAbstractButton*);
66     void onAccepted();
67     void onRejected();
68     void onRestoreDefaults();
69
70     void onTabIndexChanged(int index);
71     void onChangeAvailable();
72     void showRestartRequiredMessage();
73
74     void filterPanelWidgets();
75
76   signals:
77     void filterWidgets(bool showAdvanced, const QString& text);
78
79   private:
80     void saveInQSettings(const char* key, vtkSMProperty* smproperty);
81
82   private:
83     Q_DISABLE_COPY(PVGUI_ParaViewSettingsPane)
84     class pqInternals;
85     pqInternals* Internals;
86
87     /// Set to true if a setting that requires a restart to take effect
88     /// is modified. Made static to persist across instantiations of
89     /// this class.
90     static bool ShowRestartRequired;
91 };
92
93 #endif