// PARAVIS : ParaView wrapper SALOME module
//
-// Copyright (C) 2010-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2010-2023 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <QtxPagePrefMgr.h>
-#include <QWidget>
-
-#include "vtkPVConfig.h"
-
-class pqOptionsContainer;
-class OptionsDialogForm;
-class pqOptionsPage;
-class QString;
-
-
+class QAbstractButton;
+class vtkSMProperty;
+class QShowEvent;
+class QHideEvent;
+class LightApp_Application;
+
+/**!
+ * This class is (almost) a copy/paste of what is found in
+ * *[PARAVIEW]/Qt/Components/pqSettingsDialog.h*
+ * This is (almost) the same, except for the inheritance to QtxUserDefinedContent providing the link
+ * to SALOME preference mechanism.
+ * The UI content of pqSettingsDialog is put in a (PARAVIS) widget called pqCustomSettingsWidget.
+ */
class PVGUI_ParaViewSettingsPane : public QtxUserDefinedContent
{
Q_OBJECT
public:
- PVGUI_ParaViewSettingsPane(QWidget *parent=0);
+ PVGUI_ParaViewSettingsPane(QWidget *parent, LightApp_Application * app);
virtual ~PVGUI_ParaViewSettingsPane();
- /// \brief
- /// Gets whether or not there are changes to apply.
- /// \return
- /// True if there are changes to apply.
- //bool isApplyNeeded() const;
-
- /// \brief
- /// Sets whether or not there are changes to apply.
- /// \param applyNeeded True if there are changes to apply.
- //void setApplyNeeded(bool applyNeeded);
-
- /// \brief
- /// Adds a page to the options dialog.
- ///
- /// When the options object is a page container, the path parameter
- /// becomes the path prefix for the container pages.
- ///
- /// \param path The name hierarchy for the options page.
- /// \param options The options page.
- void addOptions(const QString &path, pqOptionsPage *options);
-
- /// \brief
- /// Adds a container to the options dialog.
- ///
- /// Each page listed for the container is added to the root of the
- /// selection tree.
- ///
- /// \param options The options container to add.
- void addOptions(pqOptionsContainer *options);
-
- /// \brief
- /// Removes the options page from the options dialog.
- ///
- /// The page name is removed from the selection tree. If the page
- /// is an options container, all the names are removed.
- ///
- /// \param options The options page/container to remove.
- void removeOptions(pqOptionsPage *options);
-
/// Implementation of QtxUserDefinedContent interface
virtual void store(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
virtual void retrieve(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
+ signals:
+ void accepted(); // emulate the initial QDialogBox signal since some stuff are connected to it.
-public slots:
- /// \brief
- /// Sets the current options page.
- /// \param path The name of the options page to show.
- void setCurrentPage(const QString &path);
+protected:
+ virtual void showEvent(QShowEvent * ev);
+ virtual void hideEvent(QHideEvent * ev);
- /// Calls each page to apply any changes.
- void applyChanges();
+ // ---- From now on, this the same interface as in pqSettingsDialog
+ private slots:
+ void clicked(QAbstractButton*);
+ void onAccepted();
+ void onRejected();
+ void onRestoreDefaults();
- /// Calls each page to reset any changes.
- void resetChanges();
+ void onTabIndexChanged(int index);
+ void onChangeAvailable();
+ void showRestartRequiredMessage();
-signals:
- /// Emitted before the option changes are applied.
- void aboutToApplyChanges();
+ void filterPanelWidgets();
- /// Emitted after the option changes have been applied.
- void appliedChanges();
+ signals:
+ void filterWidgets(bool showAdvanced, const QString& text);
-protected slots:
- void pluginLoaded(QObject* plugin_interface);
+ private:
+ void saveInQSettings(const char* key, vtkSMProperty* smproperty);
-private slots:
- /// Changes the current page to match the user selection.
- void changeCurrentPage();
+ private:
+ Q_DISABLE_COPY(PVGUI_ParaViewSettingsPane)
+ class pqInternals;
+ pqInternals* Internals;
-private:
- OptionsDialogForm *Form; /// Stores the form and class data.
+ /// Set to true if a setting that requires a restart to take effect
+ /// is modified. Made static to persist across instantiations of
+ /// this class.
+ static bool ShowRestartRequired;
};
#endif