Commit 988090d3 authored by whitlocb's avatar whitlocb

Better color table support.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@17998 18c085ea-50e0-402c-830e-de6fd14e8384
parent 4a4e9884
......@@ -525,6 +525,9 @@ reverse_alphas(unsigned char *a, int na)
// Jeremy Meredith, Wed Mar 22 13:44:25 PST 2006
// Added molecular color tables.
//
// Brad Whitlock, Fri Apr 27 15:00:48 PDT 2012
// Change smoothing method.
//
// ****************************************************************************
avtColorTables::avtColorTables()
......@@ -568,7 +571,7 @@ avtColorTables::avtColorTables()
fptr += 4;
}
ccpl.SetSmoothingFlag(predef_ct_smooth[i] == 1);
ccpl.SetSmoothing(ColorControlPointList::SmoothingMethod(predef_ct_smooth[i]));
ccpl.SetEqualSpacingFlag(predef_ct_equal[i] == 1);
ccpl.SetDiscreteFlag(predef_ct_discrete[i] == 1);
ctAtts->AddColorTable(predef_ct_names[i], ccpl);
......
......@@ -423,6 +423,63 @@ GetSystemVisItHostsDirectory()
return retVal;
}
// ****************************************************************************
// Method: GetSystemVisItResourcesDirectory
//
// Purpose:
// Get the installation directory's resources subdirectory.
//
// Arguments:
//
// Returns:
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Fri Apr 27 17:31:12 PDT 2012
//
// Modifications:
//
// ****************************************************************************
std::string
GetSystemVisItResourcesDirectory()
{
const char *d = GetDefaultConfigFile("resources", "VISITHOME");
std::string retVal(d);
delete [] d;
return retVal;
}
// ****************************************************************************
// Method: GetSystemVisItColorTableDirectory
//
// Purpose:
// Get the installation directory's resources subdirectory.
//
// Arguments:
//
// Returns:
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Fri Apr 27 17:31:12 PDT 2012
//
// Modifications:
//
// ****************************************************************************
std::string
GetSystemVisItColorTableDirectory()
{
std::string retval(GetSystemVisItResourcesDirectory());
retval += VISIT_SLASH_STRING;
retval += "ct";
return retval;
}
#if defined(_WIN32)
// ***************************************************************************
//
......@@ -944,7 +1001,7 @@ ReadInstallationInfo(std::string &distName, std::string &configName, std::string
if(lastSlash != -1)
{
arch = arch.substr(lastSlash+1, arch.length() - lastSlash - 1);
for(int i = 0; i < NARCH; ++i)
for(size_t i = 0; i < NARCH; ++i)
{
if(arch == archNames[i])
{
......
......@@ -66,6 +66,9 @@ std::string MISC_API GetSystemVisItRCFile();
std::string MISC_API GetAndMakeUserVisItHostsDirectory();
std::string MISC_API GetSystemVisItHostsDirectory();
std::string MISC_API GetSystemVisItResourcesDirectory();
std::string MISC_API GetSystemVisItColorTableDirectory();
int MISC_API ConfigStateGetRunCount(ConfigStateEnum &code);
void MISC_API ConfigStateIncrementRunCount(ConfigStateEnum &code);
......
This diff is collapsed.
This diff is collapsed.
......@@ -39,6 +39,7 @@
#ifndef COLORCONTROLPOINTLIST_H
#define COLORCONTROLPOINTLIST_H
#include <state_exports.h>
#include <string>
#include <AttributeSubject.h>
class ColorControlPoint;
......@@ -61,6 +62,13 @@ class ColorControlPoint;
class STATE_API ColorControlPointList : public AttributeSubject
{
public:
enum SmoothingMethod
{
None,
Linear,
CubicSpline
};
// These constructors are for objects of this class
ColorControlPointList();
ColorControlPointList(const ColorControlPointList &obj);
......@@ -89,7 +97,7 @@ public:
void SelectControlPoints();
// Property setting methods
void SetSmoothingFlag(bool smoothingFlag_);
void SetSmoothing(SmoothingMethod smoothing_);
void SetEqualSpacingFlag(bool equalSpacingFlag_);
void SetDiscreteFlag(bool discreteFlag_);
void SetExternalFlag(bool externalFlag_);
......@@ -97,7 +105,7 @@ public:
// Property getting methods
const AttributeGroupVector &GetControlPoints() const;
AttributeGroupVector &GetControlPoints();
bool GetSmoothingFlag() const;
SmoothingMethod GetSmoothing() const;
bool GetEqualSpacingFlag() const;
bool GetDiscreteFlag() const;
bool GetExternalFlag() const;
......@@ -118,6 +126,12 @@ public:
ColorControlPoint &operator [] (int i);
const ColorControlPoint &operator [] (int i) const;
// Enum conversion functions
static std::string SmoothingMethod_ToString(SmoothingMethod);
static bool SmoothingMethod_FromString(const std::string &, SmoothingMethod &);
protected:
static std::string SmoothingMethod_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
......@@ -126,13 +140,15 @@ public:
virtual bool FieldsEqual(int index, const AttributeGroup *rhs) const;
// User-defined methods
float EvalCubicSpline(float t, const float *allX, const float *allY, int n) const;
void GetColorsCubicSpline(unsigned char *rgb, int ncolors, unsigned char *alpha=NULL) const;
void GetColors(unsigned char *rgb, int ncolors, unsigned char *alpha=NULL) const;
bool CompactCreateNode(DataNode *parentNode, bool completeSave, bool forceAdd);
// IDs that can be used to identify fields in case statements
enum {
ID_controlPoints = 0,
ID_smoothingFlag,
ID_smoothing,
ID_equalSpacingFlag,
ID_discreteFlag,
ID_externalFlag,
......@@ -143,7 +159,7 @@ protected:
AttributeGroup *CreateSubAttributeGroup(int index);
private:
AttributeGroupVector controlPoints;
bool smoothingFlag;
int smoothing;
bool equalSpacingFlag;
bool discreteFlag;
bool externalFlag;
......@@ -152,6 +168,6 @@ private:
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define COLORCONTROLPOINTLIST_TMFS "a*bbbb"
#define COLORCONTROLPOINTLIST_TMFS "a*ibbb"
#endif
<?xml version="1.0"?>
<Attribute name="ColorControlPointList" codefile="ColorControlPointList.code" purpose="This class contains a list of ColorControlPoint objects." exportAPI="STATE_API" exportInclude="state_exports.h">
<Field name="controlPoints" type="attVector" subtype="ColorControlPoint"></Field>
<Field name="smoothingFlag" type="bool">true</Field>
<Field name="equalSpacingFlag" type="bool">false</Field>
<Field name="discreteFlag" type="bool">false</Field>
<Field name="externalFlag" type="bool">false</Field>
<Function name="GetColors" user="true" member="true"></Function>
<Function name="SetFromNode" user="false" member="true"></Function>
<Function name="CompactCreateNode" user="true" member="true"></Function>
<Attribute name="ColorControlPointList" purpose="This class contains a list of ColorControlPoint objects." persistent="true" keyframe="true" exportAPI="STATE_API" exportInclude="state_exports.h" codefile="ColorControlPointList.code">
<Enum name="SmoothingMethod">
None
Linear
CubicSpline
</Enum>
<Field name="controlPoints" label="controlPoints" type="attVector" subtype="ColorControlPoint">
</Field>
<Field name="smoothing" label="smoothing" type="enum" subtype="SmoothingMethod">
Linear
</Field>
<Field name="equalSpacingFlag" label="equalSpacingFlag" type="bool">
false
</Field>
<Field name="discreteFlag" label="discreteFlag" type="bool">
false
</Field>
<Field name="externalFlag" label="externalFlag" type="bool">
false
</Field>
<Function name="EvalCubicSpline" user="true" member="true" access="private">
</Function>
<Function name="GetColorsCubicSpline" user="true" member="true" access="private">
</Function>
<Function name="GetColors" user="true" member="true">
</Function>
<Function name="SetFromNode" user="false" member="true">
</Function>
<Function name="CompactCreateNode" user="true" member="true">
</Function>
</Attribute>
......@@ -488,6 +488,9 @@ ColorTableAttributes::CreateSubAttributeGroup(int)
// Hank Childs, Thu Jul 1 14:20:26 PDT 2010
// Write out opacities.
//
// Brad Whitlock, Fri Apr 27 14:16:01 PDT 2012
// Change smoothing.
//
// ****************************************************************************
bool
......@@ -516,8 +519,8 @@ ColorTableAttributes::CreateNode(DataNode *parentNode, bool, bool)
ctNode->AddNode(new DataNode("ctName", names[i]));
if(!ccpl.FieldsEqual(ColorControlPointList::ID_equalSpacingFlag, &defaultObject))
ctNode->AddNode(new DataNode("equal", ccpl.GetEqualSpacingFlag()));
if(!ccpl.FieldsEqual(ColorControlPointList::ID_smoothingFlag, &defaultObject))
ctNode->AddNode(new DataNode("smooth", ccpl.GetSmoothingFlag()));
if(!ccpl.FieldsEqual(ColorControlPointList::ID_smoothing, &defaultObject))
ctNode->AddNode(new DataNode("smoothing", ccpl.GetSmoothing()));
if(!ccpl.FieldsEqual(ColorControlPointList::ID_discreteFlag, &defaultObject))
ctNode->AddNode(new DataNode("discrete", ccpl.GetDiscreteFlag()));
......@@ -608,9 +611,13 @@ ColorTableAttributes::SetFromNode(DataNode *parentNode)
DataNode *tmpNode;
if((tmpNode = node->GetNode("equal")) != 0)
ccpl.SetEqualSpacingFlag(tmpNode->AsBool());
// Try and set the smooth flag.
// Try and set the smooth flag. (old way)
if((tmpNode = node->GetNode("smooth")) != 0)
ccpl.SetSmoothingFlag(tmpNode->AsBool());
ccpl.SetSmoothing(tmpNode->AsBool()?ColorControlPointList::Linear:ColorControlPointList::None);
// (new way)
if((tmpNode = node->GetNode("smoothing")) != 0)
ccpl.SetSmoothing(static_cast<ColorControlPointList::SmoothingMethod>(tmpNode->AsInt()));
if((tmpNode = node->GetNode("discrete")) != 0)
ccpl.SetDiscreteFlag(tmpNode->AsBool());
......
......@@ -323,6 +323,9 @@ Definition:
// Hank Childs, Thu Jul 1 14:20:26 PDT 2010
// Write out opacities.
//
// Brad Whitlock, Fri Apr 27 14:16:01 PDT 2012
// Change smoothing.
//
// ****************************************************************************
bool
......@@ -351,8 +354,8 @@ ColorTableAttributes::CreateNode(DataNode *parentNode, bool, bool)
ctNode->AddNode(new DataNode("ctName", names[i]));
if(!ccpl.FieldsEqual(ColorControlPointList::ID_equalSpacingFlag, &defaultObject))
ctNode->AddNode(new DataNode("equal", ccpl.GetEqualSpacingFlag()));
if(!ccpl.FieldsEqual(ColorControlPointList::ID_smoothingFlag, &defaultObject))
ctNode->AddNode(new DataNode("smooth", ccpl.GetSmoothingFlag()));
if(!ccpl.FieldsEqual(ColorControlPointList::ID_smoothing, &defaultObject))
ctNode->AddNode(new DataNode("smoothing", ccpl.GetSmoothing()));
if(!ccpl.FieldsEqual(ColorControlPointList::ID_discreteFlag, &defaultObject))
ctNode->AddNode(new DataNode("discrete", ccpl.GetDiscreteFlag()));
......@@ -449,9 +452,13 @@ ColorTableAttributes::SetFromNode(DataNode *parentNode)
DataNode *tmpNode;
if((tmpNode = node->GetNode("equal")) != 0)
ccpl.SetEqualSpacingFlag(tmpNode->AsBool());
// Try and set the smooth flag.
// Try and set the smooth flag. (old way)
if((tmpNode = node->GetNode("smooth")) != 0)
ccpl.SetSmoothingFlag(tmpNode->AsBool());
ccpl.SetSmoothing(tmpNode->AsBool()?ColorControlPointList::Linear:ColorControlPointList::None);
// (new way)
if((tmpNode = node->GetNode("smoothing")) != 0)
ccpl.SetSmoothing(static_cast<ColorControlPointList::SmoothingMethod>(tmpNode->AsInt()));
if((tmpNode = node->GetNode("discrete")) != 0)
ccpl.SetDiscreteFlag(tmpNode->AsBool());
......
......@@ -144,7 +144,9 @@ ColorTableManager::Export(const std::string &ctName,
// Creation: Thu Jul 3 18:24:52 PST 2003
//
// Modifications:
//
// Brad Whitlock, Fri Apr 27 17:36:00 PDT 2012
// Look in a system place too.
//
// ****************************************************************************
bool
......@@ -154,8 +156,11 @@ ColorTableManager::ImportColorTables(ColorTableAttributes *cta)
// Read the user's home VisIt directory and import all of the color tables.
//
ctAtts = cta;
return ReadAndProcessDirectory(GetUserVisItDirectory(), ImportHelper,
(void*)this, false);
bool r1 = ReadAndProcessDirectory(GetSystemVisItColorTableDirectory(), ImportHelper,
(void*)this, false);
bool r2 = ReadAndProcessDirectory(GetUserVisItDirectory(), ImportHelper,
(void*)this, false);
return r1 || r2;
}
// ****************************************************************************
......
......@@ -113,6 +113,7 @@ ColorTableObserver::Update(Subject *)
colorAtts->IsSelected(ColorTableAttributes::ID_colorTables))
{
// Clear all of the color tables.
QvisColorTableButton::setColorTableAttributes(colorAtts);
QvisColorTableButton::clearAllColorTables();
int nNames = colorAtts->GetNames().size();
......
......@@ -173,6 +173,9 @@ QvisColorTableWindow::~QvisColorTableWindow()
// Jeremy Meredith, Fri Feb 20 15:03:25 EST 2009
// Added alpha channel support.
//
// Brad Whitlock, Fri Apr 27 15:07:13 PDT 2012
// I changed smoothing method to a combo box.
//
// ****************************************************************************
void
......@@ -279,11 +282,15 @@ QvisColorTableWindow::CreateWindowContents()
seLayout->addWidget(alignPointButton);
seLayout->addStretch(10);
smoothCheckBox = new QCheckBox(tr("Smooth"), colorWidgetGroup);
smoothCheckBox->setChecked(true);
connect(smoothCheckBox, SIGNAL(toggled(bool)),
this, SLOT(smoothToggled(bool)));
seLayout->addWidget(smoothCheckBox);
QLabel *smoothLabel = new QLabel(tr("Smoothing"), colorWidgetGroup);
seLayout->addWidget(smoothLabel);
smoothingMethod = new QComboBox(colorWidgetGroup);
smoothingMethod->addItem(tr("None"));
smoothingMethod->addItem(tr("Linear"));
smoothingMethod->addItem(tr("Cubic Spline"));
connect(smoothingMethod, SIGNAL(activated(int)),
this, SLOT(smoothingMethodChanged(int)));
seLayout->addWidget(smoothingMethod);
equalCheckBox = new QCheckBox(tr("Equal"), colorWidgetGroup);
connect(equalCheckBox, SIGNAL(toggled(bool)),
......@@ -632,7 +639,7 @@ QvisColorTableWindow::UpdateEditor()
{
UpdateDiscreteSettings();
smoothCheckBox->hide();
smoothingMethod->hide();
equalCheckBox->hide();
spectrumBar->hide();
alignPointButton->hide();
......@@ -644,7 +651,7 @@ QvisColorTableWindow::UpdateEditor()
{
UpdateColorControlPoints();
smoothCheckBox->show();
smoothingMethod->show();
equalCheckBox->show();
spectrumBar->show();
alignPointButton->show();
......@@ -785,7 +792,10 @@ QvisColorTableWindow::GetActiveColorControlPoints()
// Modifications:
// Jeremy Meredith, Fri Feb 20 15:03:25 EST 2009
// Added alpha channel support.
//
//
// Brad Whitlock, Fri Apr 27 15:09:27 PDT 2012
// I added more smoothing types.
//
// ****************************************************************************
void
......@@ -859,16 +869,28 @@ QvisColorTableWindow::UpdateColorControlPoints()
// Set the smoothing and equal spacing flags in the spectrumbar.
spectrumBar->setEqualSpacing(cpts.GetEqualSpacingFlag());
spectrumBar->setSmoothing(cpts.GetSmoothingFlag());
switch(cpts.GetSmoothing())
{
case ColorControlPointList::None:
spectrumBar->setSmoothing(QvisSpectrumBar::None);
break;
default:
case ColorControlPointList::Linear:
spectrumBar->setSmoothing(QvisSpectrumBar::Linear);
break;
case ColorControlPointList::CubicSpline:
spectrumBar->setSmoothing(QvisSpectrumBar::CubicSpline);
break;
}
spectrumBar->blockSignals(false);
spectrumBar->setSuppressUpdates(false);
spectrumBar->update();
// Update the equalSpacing and smoothing toggle buttons.
smoothCheckBox->blockSignals(true);
smoothCheckBox->setChecked(cpts.GetSmoothingFlag());
smoothCheckBox->blockSignals(false);
// Update equalSpacing and smoothingMethod.
smoothingMethod->blockSignals(true);
smoothingMethod->setCurrentIndex((int)cpts.GetSmoothing());
smoothingMethod->blockSignals(false);
equalCheckBox->blockSignals(true);
equalCheckBox->setChecked(cpts.GetEqualSpacingFlag());
......@@ -1204,6 +1226,9 @@ QvisColorTableWindow::GetNextColor()
// Jeremy Meredith, Fri Feb 20 15:03:25 EST 2009
// Added alpha channel support.
//
// Brad Whitlock, Fri Apr 27 15:12:21 PDT 2012
// Added other smoothing types.
//
// ****************************************************************************
void
......@@ -1218,7 +1243,20 @@ QvisColorTableWindow::GetCurrentValues(int which_widget)
// Store the widget's control points.
ColorControlPointList cpts;
cpts.ClearControlPoints();
cpts.SetSmoothingFlag(spectrumBar->smoothing());
switch(spectrumBar->smoothing())
{
case QvisSpectrumBar::None:
cpts.SetSmoothing(ColorControlPointList::None);
break;
default:
case QvisSpectrumBar::Linear:
cpts.SetSmoothing(ColorControlPointList::Linear);
break;
case QvisSpectrumBar::CubicSpline:
cpts.SetSmoothing(ColorControlPointList::CubicSpline);
break;
}
cpts.SetEqualSpacingFlag(spectrumBar->equalSpacing());
for(i = 0; i < spectrumBar->numControlPoints(); ++i)
{
......@@ -1465,28 +1503,30 @@ QvisColorTableWindow::selectedColor(const QColor &color)
}
// ****************************************************************************
// Method: QvisColorTableWindow::smoothToggled
// Method: QvisColorTableWindow::smoothingMethodChanged
//
// Purpose:
// This is a Qt slot function that is called when the window's smooth
// toggle is clicked.
// combobox is activated.
//
// Programmer: Brad Whitlock
// Creation: Mon Jun 11 15:38:06 PST 2001
//
// Modifications:
//
// Brad Whitlock, Fri Apr 27 15:14:20 PDT 2012
// Added more types of smoothing.
//
// ****************************************************************************
void
QvisColorTableWindow::smoothToggled(bool)
QvisColorTableWindow::smoothingMethodChanged(int val)
{
// Get a pointer to the active color table's control points.
ColorControlPointList *ccpl = GetActiveColorControlPoints();
if(ccpl)
{
ccpl->SetSmoothingFlag(!ccpl->GetSmoothingFlag());
ccpl->SetSmoothing(ColorControlPointList::SmoothingMethod(val));
colorAtts->SelectColorTables();
Apply();
}
......@@ -1558,6 +1598,9 @@ QvisColorTableWindow::equalSpacingToggled(bool)
// Brad Whitlock, Tue Apr 8 09:27:26 PDT 2008
// Support for internationalization.
//
// Brad Whitlock, Fri Apr 27 15:15:12 PDT 2012
// Add other smoothing types.
//
// ****************************************************************************
void
......@@ -1588,7 +1631,7 @@ QvisColorTableWindow::addColorTable()
cpts.AddControlPoints(ColorControlPoint(0.5, 0,255,0,255));
cpts.AddControlPoints(ColorControlPoint(0.75, 0,255,255,255));
cpts.AddControlPoints(ColorControlPoint(1., 0,0,255,255));
cpts.SetSmoothingFlag(true);
cpts.SetSmoothing(ColorControlPointList::Linear);
cpts.SetEqualSpacingFlag(false);
cpts.SetDiscreteFlag(false);
colorAtts->AddColorTable(currentColorTable.toStdString(), cpts);
......
......@@ -100,6 +100,9 @@ class QvisColorGridWidget;
// Jeremy Meredith, Fri Feb 20 15:03:25 EST 2009
// Added alpha channel support.
//
// Brad Whitlock, Fri Apr 27 15:03:10 PDT 2012
// Add smoothing method instead of a check box for it.
//
// ****************************************************************************
class GUI_API QvisColorTableWindow : public QvisPostableWindowObserver
......@@ -151,7 +154,7 @@ private slots:
void alignControlPoints();
void controlPointMoved(int index, float position);
void selectedColor(const QColor &color);
void smoothToggled(bool val);
void smoothingMethodChanged(int val);
void equalSpacingToggled(bool val);
void addColorTable();
void deleteColorTable();
......@@ -179,19 +182,17 @@ private:
QPushButton *deleteButton;
QPushButton *exportButton;
QLineEdit *nameLineEdit;
QListWidget *nameListBox;
QListWidget *nameListBox;
QGroupBox *colorWidgetGroup;
QSpinBox *colorNumColors;
QButtonGroup *colorTableTypeGroup;
QCheckBox *smoothCheckBox;
QComboBox *smoothingMethod;
QCheckBox *equalCheckBox;
QvisSpectrumBar *spectrumBar;
QvisColorSelectionWidget *colorSelect;
// QPushButton *addPointButton;
// QPushButton *rmPointButton;
QPushButton *alignPointButton;
QCheckBox *showIndexHintsCheckBox;
......
......@@ -41,6 +41,7 @@
#include <QButtonGroup>
#include <QCheckBox>
#include <QComboBox>
#include <QFont>
#include <QGroupBox>
#include <QLabel>
#include <QLayout>
......@@ -51,8 +52,11 @@
#include <QSpinBox>
#include <QStringList>
#include <QTabWidget>
#include <QTextEdit>
#include <QWidget>
#include <QvisPythonSyntaxHighlighter.h>
#include <snprintf.h>
#include <MachineProfile.h>
......@@ -150,42 +154,86 @@ QvisHostProfileWindow::~QvisHostProfileWindow()
// Rename New/Copy/Delete to New Host/Copy Host/Delete Host.
// This removes ambiguity with profile controls.
//
// Brad Whitlock, Tue Apr 24 22:36:35 PDT 2012
// Use group boxes instead of tabs. Add custom script.
//
// ****************************************************************************
void
QvisHostProfileWindow::CreateWindowContents()
{
QGridLayout *mainLayout = new QGridLayout(NULL);
mainLayout->setSpacing(5);
topLayout->addLayout(mainLayout);
topLayout->setStretchFactor(mainLayout, 100);
mainLayout->addWidget(new QLabel(tr("Hosts")), 0,0, 1,3);
hostList = new QListWidget(central);
hostList->setSortingEnabled(true);
mainLayout->addWidget(hostList, 1,0, 1,3);
connect(hostList, SIGNAL(itemSelectionChanged()),
this, SLOT(currentHostChanged()));
QGroupBox *hSettings = new QGroupBox(tr("Hosts"), central);
mainLayout->addWidget(hSettings, 0,0);
QVBoxLayout *hLayout = new QVBoxLayout(hSettings);
hLayout->setMargin(0);
hLayout->setSpacing(HOST_PROFILE_SPACING);
hostGroup = CreateHostListGroup();
hLayout->addWidget(hostGroup);
QGroupBox *hpSettings = new QGroupBox(tr("Host Profiles"), central);
mainLayout->addWidget(hpSettings, 0,1);
QGridLayout *hpLayout = new QGridLayout(hpSettings);
hpLayout->setMargin(5);
hpLayout->setSpacing(HOST_PROFILE_SPACING);
hostProfileGroup = hpSettings;
QGroupBox *mSettings = new QGroupBox(tr("Host Settings"), hpSettings);
hpLayout->addWidget(mSettings, 0,0);
QVBoxLayout *mLayout = new QVBoxLayout(mSettings);
mLayout->setMargin(0);
mLayout->setSpacing(HOST_PROFILE_SPACING);
machineSettingsGroup = CreateMachineSettingsGroup();
mLayout->addWidget(machineSettingsGroup);
addHost = new QPushButton(tr("New Host"), central);
mainLayout->addWidget(addHost, 2,0);
QGroupBox *pSettings = new QGroupBox(tr("Launch Profiles"), hpSettings);
hpLayout->addWidget(pSettings, 0,1);
QVBoxLayout *pLayout = new QVBoxLayout(pSettings);
pLayout->setMargin(0);
pLayout->setSpacing(HOST_PROFILE_SPACING);
launchProfilesGroup = CreateLaunchProfilesGroup();
pLayout->addWidget(launchProfilesGroup);
#if 1
QGroupBox *cslSettings = new QGroupBox(tr("Custom Launch Script"), hpSettings);
hpLayout->addWidget(cslSettings, 1,0, 1,2);
QVBoxLayout *cslLayout = new QVBoxLayout(cslSettings);
cslLayout->setMargin(0);
cslLayout->setSpacing(HOST_PROFILE_SPACING);
customScriptGroup = CreateCustomScriptGroup();
cslLayout->addWidget(customScriptGroup);
#endif
}
QWidget *
QvisHostProfileWindow::CreateHostListGroup()
{
QWidget *currentGroup = new QWidget();
QGridLayout *layout = new QGridLayout(currentGroup);
layout->setMargin(5);
addHost = new QPushButton(tr("New Host"), currentGroup);
layout->addWidget(addHost, 0,0);
connect(addHost, SIGNAL(clicked()), this, SLOT(addMachineProfile()));
delHost = new QPushButton(tr("Delete Host"), central);
mainLayout->addWidget(delHost, 2,1);
delHost = new QPushButton(tr("Delete Host"), currentGroup);
layout->addWidget(delHost, 1,0);
connect(delHost, SIGNAL(clicked()), this, SLOT(delMachineProfile()));
copyHost = new QPushButton(tr("Copy Host"), central);
mainLayout->addWidget(copyHost, 2,2);
copyHost = new QPushButton(tr("Copy Host"), currentGroup);
layout->addWidget(copyHost, 2,0);
connect(copyHost, SIGNAL(clicked()), this, SLOT(copyMachineProfile()));
machineTabs = new QTabWidget(central);
mainLayout->addWidget(machineTabs, 0,3, 3,1);
machineSettingsGroup = CreateMachineSettingsGroup();
machineTabs->addTab(machineSettingsGroup, tr("Host Settings"));
hostList = new QListWidget(currentGroup);
hostList->setSortingEnabled(true);
layout->addWidget(hostList, 3,0);
connect(hostList, SIGNAL(itemSelectionChanged()),
this, SLOT(currentHostChanged()));
launchProfilesGroup = CreateLaunchProfilesGroup();
machineTabs->addTab(launchProfilesGroup, tr("Launch Profiles"));
return currentGroup;
}
// ****************************************************************************
......@@ -353,8 +401,10 @@ QvisHostProfileWindow::CreateMachineSettingsGroup()
clientHostNameMethod->addButton(chnParseFromSSHClient,1);
clientHostNameMethod->addButton(chnSpecifyManually,2);
clientHostNameMethodLabel =
new QLabel(tr("Method used to determine local host name when not tunneling:"),
new QLabel(tr("Determine local host using:"),
connectionGroup);