Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use empty() to check for emptiness. #6

Open
wants to merge 16 commits into
base: next
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Qt/Components/pqSettingsDialog.cxx
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqProxyWidget.h"
#include "pqSearchBox.h"
#include "pqServer.h"
#include "pqServerManagerModel.h"
#include "pqSettings.h"
#include "pqUndoStack.h"
#include "vtkNew.h"
@@ -52,6 +53,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <QKeyEvent>
#include <QMap>
#include <QPointer>
#include <QPushButton>
#include <QScrollArea>
#include <QSpacerItem>
@@ -65,6 +67,8 @@ class pqSettingsDialog::pqInternals
// Map from tab indices to stack widget indices. This is needed because there
// are more widgets in the stacked widgets than just what we add.
QMap<int, int> TabToStackedWidgets;

QPointer<pqServer> Server;
};

bool pqSettingsDialog::ShowRestartRequired = false;
@@ -87,6 +91,8 @@ pqSettingsDialog::pqSettingsDialog(QWidget* parentObject, Qt::WindowFlags f)
QList<vtkSMProxy*> proxies_to_show;

pqServer* server = pqActiveObjects::instance().activeServer();
this->Internals->Server = server;

vtkNew<vtkSMProxyIterator> iter;
iter->SetSession(server->session());
iter->SetModeToOneGroup();
@@ -167,6 +173,9 @@ pqSettingsDialog::pqSettingsDialog(QWidget* parentObject, Qt::WindowFlags f)
this->onTabIndexChanged(0);

this->filterPanelWidgets();

pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel();
this->connect(smmodel, SIGNAL(serverRemoved(pqServer*)), SLOT(serverRemoved(pqServer*)));
}

//-----------------------------------------------------------------------------
@@ -176,6 +185,16 @@ pqSettingsDialog::~pqSettingsDialog()
this->Internals = NULL;
}

//-----------------------------------------------------------------------------
void pqSettingsDialog::serverRemoved(pqServer* server)
{
// BUG #14957: Close this dialog if the server session closes.
if (this->Internals->Server == server)
{
this->close();
}
}

//-----------------------------------------------------------------------------
void pqSettingsDialog::clicked(QAbstractButton *button)
{
5 changes: 5 additions & 0 deletions Qt/Components/pqSettingsDialog.h
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QDialog>
#include "pqComponentsModule.h"

class pqServer;
class QAbstractButton;
class vtkSMProperty;

@@ -62,6 +63,10 @@ private slots:

void filterPanelWidgets();

/// Callback for when pqServerManagerModel notifies the application that the
/// server is being removed. We close the dialog.
void serverRemoved(pqServer*);

signals:
void filterWidgets(bool showAdvanced, const QString& text);