Commit 4adbf71f authored by bonnell's avatar bonnell

Add a 'Clear all tabs on close' option to the SeedMe window. Defaults to...

Add a 'Clear all tabs on close' option to the SeedMe window.  Defaults to true.  Can be saved in config file

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@31347 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5cdff019
This diff is collapsed.
Function: SetFromNode
Declaration: virtual void SetFromNode(DataNode *parentNode);
Definition:
// ****************************************************************************
// Method: SeedMeAttributes::SetFromNode
//
// Purpose:
// This method sets attributes in this object from values in a DataNode
// representation of the object.
//
// Programmer: Kathleen Biagas
// Creation: August 14, 2017
//
// Modifications:
//
// ****************************************************************************
void
SeedMeAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("SeedMeAttributes");
if(searchNode == 0)
return;
// Prior to the Aug 14, 2017, SeedMeAttributes were not saved to config
// file. This was changed so that the new att, ClearAllTabsOnClose
// could be saved, but we don't necessarily want all the rest of
// the atts saved.
DataNode *node;
if((node = searchNode->GetNode("clearAllTabsOnClose")) != 0)
SetClearAllTabsOnClose(node->AsBool());
}
Function: CreateNode
Declaration: virtual bool CreateNode(DataNode *parentNode, bool, bool);
Definition:
// ****************************************************************************
// Method: SeedMeAttributes::CreateNode
//
// Purpose:
// This method creates a DataNode representation of the object so it can be
// saved to a config file.
//
// Programmer: Kathleen Biagas
// Creation: August 14, 2017
//
// Modifications:
//
// ****************************************************************************
bool
SeedMeAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
SeedMeAttributes defaultObject;
bool addToParent = false;
// Create a node for SeedMeAttributes.
DataNode *node = new DataNode("SeedMeAttributes");
// Prior to the Aug 14, 2017, SeedMeAttributes were not saved to config
// file. This was changed so that the new att, ClearAllTabsOnClose
// could be saved, but we don't necessarily want all the rest of
// the atts saved.
if(completeSave || !FieldsEqual(ID_clearAllTabsOnClose, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("clearAllTabsOnClose", clearAllTabsOnClose));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
else
delete node;
return (addToParent || forceAdd);
}
......@@ -172,6 +172,7 @@ public:
void SetQuickCollectionEmails(const std::string &quickCollectionEmails_);
void SetQuickFrameRate(int quickFrameRate_);
void SetQuickDownloadType(DownloadQuality quickDownloadType_);
void SetClearAllTabsOnClose(bool clearAllTabsOnClose_);
// Property getting methods
CollectionMode GetCollectionMode() const;
......@@ -217,6 +218,7 @@ public:
std::string &GetQuickCollectionEmails();
int GetQuickFrameRate() const;
DownloadQuality GetQuickDownloadType() const;
bool GetClearAllTabsOnClose() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -292,6 +294,7 @@ public:
ID_quickCollectionEmails,
ID_quickFrameRate,
ID_quickDownloadType,
ID_clearAllTabsOnClose,
ID__LAST
};
......@@ -325,11 +328,12 @@ private:
std::string quickCollectionEmails;
int quickFrameRate;
int quickDownloadType;
bool clearAllTabsOnClose;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define SEEDMEATTRIBUTES_TMFS "iiissbssbssbssbisissiiisissii"
#define SEEDMEATTRIBUTES_TMFS "iiissbssbssbssbisissiiisissiib"
#endif
<?xml version="1.0"?>
<Attribute name="SeedMeAttributes" purpose="This class contains the attributes needed to interact with SeedMe." exportAPI="STATE_API" exportInclude="state_exports.h">
<Attribute name="SeedMeAttributes" purpose="This class contains the attributes needed to interact with SeedMe." persistent="true" keyframe="true" exportAPI="STATE_API" exportInclude="state_exports.h" codefile="SeedMeAttributes.code">
<Enum name="CollectionMode">
COLLECTION_NEW
COLLECTION_UPDATE
......@@ -9,6 +9,31 @@
SHARING_GROUP
SHARING_PUBLIC
</Enum>
<Enum name="QueryAction">
LIST_COL
FIND_COL
QUERY_COL
</Enum>
<Enum name="QueryCollectionValues">
QUERY_ALL
QUERY_KEY_VALUE
QUERY_TICKER
QUERY_URL
</Enum>
<Enum name="Download">
DOWNLOAD_ALL
DOWNLOAD_VIDEO
DOWNLOAD_NAME
</Enum>
<Enum name="DownloadQuality">
DOWNLOAD_Q_ALL
DOWNLOAD_Q_BEST
DOWNLOAD_Q_HIGHEST
DOWNLOAD_Q_HIGH
DOWNLOAD_Q_MEDIUM
DOWNLOAD_Q_LOW
DOWNLOAD_Q_LOWEST
</Enum>
<Field name="collectionMode" label="collection mode" type="enum" subtype="CollectionMode">
COLLECTION_NEW
</Field>
......@@ -43,57 +68,31 @@
<Field name="sequenceDescription" label="Sequence description" type="string" enabler="uploadSequenceFile:true">
</Field>
<Field name="createVideo" label="Create video" type="bool" enabler="uploadSequenceFile:true">
false
false
</Field>
<Field name="frameRate" label="Frame rate" type="int" enabler="createVideo:true">
30
30
</Field>
<Field name="operationResult" label="Operation Result" type="string" enabler="createVideo:true">
</Field>
<Enum name="QueryAction">
LIST_COL
FIND_COL
QUERY_COL
</Enum>
<Enum name="QueryCollectionValues">
QUERY_ALL
QUERY_KEY_VALUE
QUERY_TICKER
QUERY_URL
</Enum>
<Field name="queryAction" label="Query" type="enum" subtype="QueryAction">
LIST_COL
</Field>
<Field name="queryColID" label="Query collection ID" type="string" enabler="queryAction:QUERY_COL">
</Field>
<Field name="queryKeyValue" label="Query key-value" type="string" enabler="queryAction:FIND_COL">
</Field>
<Field name="queryCollectionValues" label="Query" type="enum" subtype="QueryCollectionValues">
QUERY_ALL
</Field>
<Enum name="Download">
DOWNLOAD_ALL
DOWNLOAD_VIDEO
DOWNLOAD_NAME
</Enum>
<Field name="downloadCollectionID" label="Download collection id" type="int">
</Field>
<Field name="downloadType" label="Files" type="enum" subtype="Download">
DOWNLOAD_ALL
</Field>
<Field name="downloadName" label="Download name" type="string">
*
*
</Field>
<Field name="quickSharing" label="Sharing" type="enum" subtype="Sharing">
SHARING_PRIVATE
</Field>
......@@ -102,20 +101,16 @@
<Field name="quickCollectionEmails" label="Share emails" type="string">
</Field>
<Field name="quickFrameRate" label="Frame rate" type="int" enabler="createVideo:true">
10
10
</Field>
<Enum name="DownloadQuality">
DOWNLOAD_Q_ALL
DOWNLOAD_Q_BEST
DOWNLOAD_Q_HIGHEST
DOWNLOAD_Q_HIGH
DOWNLOAD_Q_MEDIUM
DOWNLOAD_Q_LOW
DOWNLOAD_Q_LOWEST
</Enum>
<Field name="quickDownloadType" label="Quality" type="enum" subtype="DownloadQuality">
DOWNLOAD_Q_ALL
</Field>
<Field name="clearAllTabsOnClose" label="Clear all tabs on close" type="bool">
true
</Field>
<Function name="SetFromNode" user="false" member="true">
</Function>
<Function name="CreateNode" user="false" member="true">
</Function>
</Attribute>
......@@ -57,12 +57,6 @@
#include <QTextStream>
#include <QComboBox>
#include <QvisColorTableButton.h>
#include <QvisOpacitySlider.h>
#include <QvisColorButton.h>
#include <QvisLineStyleWidget.h>
#include <QvisLineWidthWidget.h>
#include <QvisVariableButton.h>
#include <InstallationFunctions.h>
#include <QFileDialog>
......@@ -554,6 +548,13 @@ QvisSeedMeWindow::CreateDownloadTab()
return w;
}
// ****************************************************************************
// Modifications:
// Kathleen Biagas, Mon Aug 14 10:43:08 MST 2017
// Added clearTabsOnClose.
//
// ****************************************************************************
QWidget *
QvisSeedMeWindow::CreateSettingsTab()
{
......@@ -587,6 +588,11 @@ QvisSeedMeWindow::CreateSettingsTab()
mainLayout->addWidget(label, 3,0);
mainLayout->addWidget(button, 3,1);
clearTabsOnClose = new QCheckBox(tr("Clear all tabs on close"),w);
connect(clearTabsOnClose, SIGNAL(toggled(bool)),
this, SLOT(clearTabsOnCloseChanged(bool)));
mainLayout->addWidget(clearTabsOnClose, 4,0);
return w;
}
......@@ -596,10 +602,41 @@ void QvisSeedMeWindow::directoryChanged(const QString & path)
helpLabelWarning->setVisible(!(checkFile.exists() && checkFile.isFile()));
}
// ****************************************************************************
// Method: QvisSeedMeWindow::hide
//
// Purpose:
// Override default method so that forms may be cleared.
//
// Programmer: Kathleen Biagas
// Creation: August 14, 2017
//
// Modifications:
//
// ****************************************************************************
void
QvisSeedMeWindow::hide()
{
if (clearTabsOnClose->isChecked())
{
for (int i = 0; i < tabs->count(); ++i)
this->ResetForm2(tabs->currentIndex());
this->ClearLog();
}
QvisPostableWindow::hide();
}
void
QvisSeedMeWindow::ResetForm()
{
switch(tabs->currentIndex())
this->ResetForm2(tabs->currentIndex());
}
void
QvisSeedMeWindow::ResetForm2(int index)
{
switch(index)
{
case 0: // QuickUpload
{
......@@ -667,6 +704,8 @@ QvisSeedMeWindow::ClearLog()
// Creation: omitted
//
// Modifications:
// Kathleen Biagas, Mon Aug 14 10:43:08 MST 2017
// Added clearTabsOnClose.
//
// ****************************************************************************
......@@ -798,6 +837,11 @@ QvisSeedMeWindow::UpdateWindow(bool doAll)
case SeedMeAttributes::ID_quickFrameRate:
quickFrameRate->setText(IntToQString(atts->GetQuickFrameRate()));
break;
case SeedMeAttributes::ID_clearAllTabsOnClose:
clearTabsOnClose->blockSignals(true);
clearTabsOnClose->setChecked(atts->GetClearAllTabsOnClose());
clearTabsOnClose->blockSignals(false);
break;
}
}
}
......@@ -1526,3 +1570,10 @@ QvisSeedMeWindow::quickDownloadTypeChanged(int val)
Apply();
}
}
void
QvisSeedMeWindow::clearTabsOnCloseChanged(bool val)
{
atts->SetClearAllTabsOnClose(val);
atts->Notify();
}
......@@ -47,21 +47,11 @@ class QCheckBox;
class QLabel;
class QTextBrowser;
class QLineEdit;
class QSpinBox;
class QTabWidget;
class QVBox;
class QScrollBar;
class QPushButton;
class QFileSystemWatcher;
class QComboBox;
class QvisColorTableButton;
class QvisOpacitySlider;
class QvisColorButton;
class QvisLineStyleWidget;
class QvisLineWidthWidget;
class QvisVariableButton;
// ****************************************************************************
// Class: QvisSeedMeWindow
//
......@@ -74,7 +64,9 @@ class QvisVariableButton;
// Creation: omitted
//
// Modifications:
//
// Kathleen Biagas, Mon Aug 14 10:43:08 MST 2017
// Added clearTabsOnClose, hide slot.
//
// ****************************************************************************
class QvisSeedMeWindow : public QvisPostableWindowSimpleObserver
......@@ -93,6 +85,7 @@ signals:
void runCommand(const QString &);
public slots:
virtual void apply();
virtual void hide();
protected:
void UpdateWindow(bool doAll);
void GetCurrentValues(int which_widget);
......@@ -127,11 +120,13 @@ private slots:
void quickFrameRateProcessText();
void quickDownloadTypeChanged(int val);
void quickDownload();
void clearTabsOnCloseChanged(bool val);
void ResetForm();
void ClearLog();
private:
void ResetForm2(int);
QWidget *CreateQuickUploadTab();
QWidget *CreateUploadTab();
QWidget *CreateQueryTab();
......@@ -213,6 +208,8 @@ private:
QPushButton *resetFormButton, *clearLogButton, *quickDownloadButton, *submitButton;
QCheckBox *clearTabsOnClose;
void updateStatus(QString str);
QString apikeyFile;
......
......@@ -56,7 +56,7 @@ package llnl.visit;
public class SeedMeAttributes extends AttributeSubject
{
private static int SeedMeAttributes_numAdditionalAtts = 29;
private static int SeedMeAttributes_numAdditionalAtts = 30;
// Enum values
public final static int COLLECTIONMODE_COLLECTION_NEW = 0;
......@@ -121,6 +121,7 @@ public class SeedMeAttributes extends AttributeSubject
quickCollectionEmails = new String("");
quickFrameRate = 10;
quickDownloadType = DOWNLOADQUALITY_DOWNLOAD_Q_ALL;
clearAllTabsOnClose = true;
}
public SeedMeAttributes(int nMoreFields)
......@@ -156,6 +157,7 @@ public class SeedMeAttributes extends AttributeSubject
quickCollectionEmails = new String("");
quickFrameRate = 10;
quickDownloadType = DOWNLOADQUALITY_DOWNLOAD_Q_ALL;
clearAllTabsOnClose = true;
}
public SeedMeAttributes(SeedMeAttributes obj)
......@@ -191,6 +193,7 @@ public class SeedMeAttributes extends AttributeSubject
quickCollectionEmails = new String(obj.quickCollectionEmails);
quickFrameRate = obj.quickFrameRate;
quickDownloadType = obj.quickDownloadType;
clearAllTabsOnClose = obj.clearAllTabsOnClose;
SelectAll();
}
......@@ -236,7 +239,8 @@ public class SeedMeAttributes extends AttributeSubject
(quickCollectionTitle.equals(obj.quickCollectionTitle)) &&
(quickCollectionEmails.equals(obj.quickCollectionEmails)) &&
(quickFrameRate == obj.quickFrameRate) &&
(quickDownloadType == obj.quickDownloadType));
(quickDownloadType == obj.quickDownloadType) &&
(clearAllTabsOnClose == obj.clearAllTabsOnClose));
}
// Property setting methods
......@@ -414,6 +418,12 @@ public class SeedMeAttributes extends AttributeSubject
Select(28);
}
public void SetClearAllTabsOnClose(boolean clearAllTabsOnClose_)
{
clearAllTabsOnClose = clearAllTabsOnClose_;
Select(29);
}
// Property getting methods
public int GetCollectionMode() { return collectionMode; }
public int GetCollectionID() { return collectionID; }
......@@ -444,6 +454,7 @@ public class SeedMeAttributes extends AttributeSubject
public String GetQuickCollectionEmails() { return quickCollectionEmails; }
public int GetQuickFrameRate() { return quickFrameRate; }
public int GetQuickDownloadType() { return quickDownloadType; }
public boolean GetClearAllTabsOnClose() { return clearAllTabsOnClose; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
......@@ -506,6 +517,8 @@ public class SeedMeAttributes extends AttributeSubject
buf.WriteInt(quickFrameRate);
if(WriteSelect(28, buf))
buf.WriteInt(quickDownloadType);
if(WriteSelect(29, buf))
buf.WriteBool(clearAllTabsOnClose);
}
public void ReadAtts(int index, CommunicationBuffer buf)
......@@ -599,6 +612,9 @@ public class SeedMeAttributes extends AttributeSubject
case 28:
SetQuickDownloadType(buf.ReadInt());
break;
case 29:
SetClearAllTabsOnClose(buf.ReadBool());
break;
}
}
......@@ -691,6 +707,7 @@ public class SeedMeAttributes extends AttributeSubject
if(quickDownloadType == DOWNLOADQUALITY_DOWNLOAD_Q_LOWEST)
str = str + "DOWNLOADQUALITY_DOWNLOAD_Q_LOWEST";
str = str + "\n";
str = str + boolToString("clearAllTabsOnClose", clearAllTabsOnClose, indent) + "\n";
return str;
}
......@@ -725,5 +742,6 @@ public class SeedMeAttributes extends AttributeSubject
private String quickCollectionEmails;
private int quickFrameRate;
private int quickDownloadType;
private boolean clearAllTabsOnClose;
}
......@@ -33,7 +33,7 @@ enhancements and bug-fixes that were added to this release.</p>
<p><b><font size="4">General features added in version 2.13</font></b></p>
<ul>
<li>Database read/export options that contain enums will now be presented with the string form of the enum via the cli. Setting the option will accept an int or a valid string and print error messages if either is invalid for the option being set.</li>
<li>General Feature 2</li>
<li>The SeedMe window will now by default clear all forms when the window is closed. The Settings tab has a new checkbox <i>Clear all tabs on close</i> to control this option. If modified, the option will be saved in VisIt's config file when settings are saved.</li>
</ul>
<a name="Advanced_features"></a>
......
......@@ -73,6 +73,7 @@
#include <QueryOverTimeAttributes.h>
#include <RenderingAttributes.h>
#include <SaveWindowAttributes.h>
#include <SeedMeAttributes.h>
#include <ViewCurveAttributes.h>
#include <View2DAttributes.h>
#include <View3DAttributes.h>
......@@ -194,6 +195,8 @@ ViewerStateManager::CreateState()
// Creation: Tue Jun 17 14:57:28 PST 2003
//
// Modifications:
// Kathleen Biagas, Mon Aug 14 10:41:15 PDT 2017
// Added SeedMeAttributes.
//
// ****************************************************************************
......@@ -229,6 +232,7 @@ ViewerStateManager::ConnectDefaultState()
configMgr->Add(ViewerWindowManager::Instance()->GetInteractorDefaultAtts());
configMgr->Add(GetViewerState()->GetMovieAttributes());
configMgr->Add(GetViewerState()->GetFileOpenOptions());
configMgr->Add(GetViewerState()->GetSeedMeAttributes());
}
// ****************************************************************************
......
This diff is collapsed.
......@@ -45,7 +45,7 @@
//
// Functions exposed to the VisIt module.
//
#define SEEDMEATTRIBUTES_NMETH 50
#define SEEDMEATTRIBUTES_NMETH 62
void VISITPY_API PySeedMeAttributes_StartUp(SeedMeAttributes *subj, void *data);
void VISITPY_API PySeedMeAttributes_CloseDown();
VISITPY_API PyMethodDef * PySeedMeAttributes_GetMethodTable(int *nMethods);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment