Commit 4c0c99e0 authored by whitlocb's avatar whitlocb

Internationalization for operators, viewer, gui fixes, xml tool plugin info enhancements.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@4153 18c085ea-50e0-402c-830e-de6fd14e8384
parent c1b9f0e9
This diff is collapsed.
......@@ -52,6 +52,7 @@ class QvisNotepadArea;
class QvisPostableWindowObserver;
class QvisWizard;
class QWidget;
class QString;
class avtPluginFilter;
class ViewerPlot;
class ExpressionList;
......@@ -110,15 +111,20 @@ class ExpressionList;
// definition is intended for intialization; the filter should override
// the actual values of the variable.
//
// Brad Whitlock, Fri Apr 25 10:11:20 PDT 2008
// Made GetMenuName in the GUI info return QString so we can
// internationalize plot names. Added const to strings returned from
// GeneralOperatorPluginInfo.
//
// ****************************************************************************
class PLUGIN_API GeneralOperatorPluginInfo
{
public:
virtual ~GeneralOperatorPluginInfo() {;};
virtual char *GetName() const = 0;
virtual char *GetVersion() const = 0;
virtual char *GetID() const = 0;
virtual const char *GetName() const = 0;
virtual const char *GetVersion() const = 0;
virtual const char *GetID() const = 0;
virtual bool EnabledByDefault() const { return true; }
};
......@@ -133,9 +139,10 @@ class PLUGIN_API CommonOperatorPluginInfo : public virtual GeneralOperatorPlugin
class PLUGIN_API GUIOperatorPluginInfo : public virtual CommonOperatorPluginInfo
{
public:
virtual const char *GetMenuName() const = 0;
virtual QString *GetMenuName() const = 0;
virtual QvisPostableWindowObserver *CreatePluginWindow(int type,
AttributeSubject *attr, QvisNotepadArea *notepad) = 0;
AttributeSubject *attr, const QString &caption, const QString &shortName,
QvisNotepadArea *notepad) = 0;
virtual QvisWizard *CreatePluginWizard(AttributeSubject *attr,
QWidget *parent, const char *name =0)
{
......@@ -158,7 +165,9 @@ class PLUGIN_API ViewerOperatorPluginInfo : public virtual CommonOperatorPluginI
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault) = 0;
virtual QString *GetMenuName() const = 0;
virtual const char **XPMIconData() const { return 0; }
virtual bool GetUserSelectable() const { return true; }
virtual bool Removeable() const { return true; }
virtual bool Moveable() const { return true; }
virtual bool AllowsSubsequentOperators() const { return true; }
......
......@@ -50,6 +50,7 @@
// Forward declarations.
class AttributeSubject;
class QString;
class QvisNotepadArea;
class QvisPostableWindowObserver;
class QvisWizard;
......@@ -134,15 +135,19 @@ class ViewerPlot;
// Brad Whitlock, Tue Mar 20 11:44:35 PDT 2007
// Added ProvidesLegend method on the viewer plugin info.
//
// Brad Whitlock, Fri Apr 25 10:09:24 PDT 2008
// Made the GUI plugin info return QString so we can internationalize
// plot names. Added const to strings returned from GeneralPlotPluginInfo.
//
// ****************************************************************************
class PLUGIN_API GeneralPlotPluginInfo
{
public:
virtual ~GeneralPlotPluginInfo() { ; };
virtual char *GetName() const = 0;
virtual char *GetVersion() const = 0;
virtual char *GetID() const = 0;
virtual const char *GetName() const = 0;
virtual const char *GetVersion() const = 0;
virtual const char *GetID() const = 0;
virtual bool EnabledByDefault() const { return true; }
};
......@@ -157,10 +162,11 @@ class PLUGIN_API CommonPlotPluginInfo : public virtual GeneralPlotPluginInfo
class PLUGIN_API GUIPlotPluginInfo : public virtual CommonPlotPluginInfo
{
public:
virtual const char *GetMenuName() const = 0;
virtual QString *GetMenuName() const = 0;
virtual int GetVariableTypes() const = 0;
virtual QvisPostableWindowObserver *CreatePluginWindow(int type,
AttributeSubject *attr, QvisNotepadArea *notepad) = 0;
AttributeSubject *attr, const QString &caption, const QString &shortName,
QvisNotepadArea *notepad) = 0;
virtual QvisWizard *CreatePluginWizard(AttributeSubject *attr, QWidget *parent,
const std::string &varName, const avtDatabaseMetaData *md,
const ExpressionList *expList, const char *name =0)
......@@ -189,6 +195,7 @@ class PLUGIN_API ViewerPlotPluginInfo : public virtual CommonPlotPluginInfo
virtual void ResetPlotAtts(AttributeSubject *atts,
ViewerPlot *) { ; }
virtual QString *GetMenuName() const = 0;
virtual const char **XPMIconData() const { return 0; }
virtual int GetVariableTypes() const = 0;
......
......@@ -78,7 +78,7 @@ MessageAttributes::Severity_FromString(const std::string &s, MessageAttributes::
}
// Type map format string
const char *MessageAttributes::TypeMapFormatString = "si";
const char *MessageAttributes::TypeMapFormatString = "su*bi";
// ****************************************************************************
// Method: MessageAttributes::MessageAttributes
......@@ -89,7 +89,7 @@ const char *MessageAttributes::TypeMapFormatString = "si";
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -98,7 +98,7 @@ const char *MessageAttributes::TypeMapFormatString = "si";
MessageAttributes::MessageAttributes() :
AttributeSubject(MessageAttributes::TypeMapFormatString)
{
text = "";
hasUnicode = false;
severity = Message;
}
......@@ -111,7 +111,7 @@ MessageAttributes::MessageAttributes() :
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -121,6 +121,8 @@ MessageAttributes::MessageAttributes(const MessageAttributes &obj) :
AttributeSubject(MessageAttributes::TypeMapFormatString)
{
text = obj.text;
unicode = obj.unicode;
hasUnicode = obj.hasUnicode;
severity = obj.severity;
SelectAll();
......@@ -135,7 +137,7 @@ MessageAttributes::MessageAttributes(const MessageAttributes &obj) :
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -155,7 +157,7 @@ MessageAttributes::~MessageAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -166,6 +168,8 @@ MessageAttributes::operator = (const MessageAttributes &obj)
{
if (this == &obj) return *this;
text = obj.text;
unicode = obj.unicode;
hasUnicode = obj.hasUnicode;
severity = obj.severity;
SelectAll();
......@@ -181,7 +185,7 @@ MessageAttributes::operator = (const MessageAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -192,6 +196,8 @@ MessageAttributes::operator == (const MessageAttributes &obj) const
{
// Create the return value
return ((text == obj.text) &&
(unicode == obj.unicode) &&
(hasUnicode == obj.hasUnicode) &&
(severity == obj.severity));
}
......@@ -204,7 +210,7 @@ MessageAttributes::operator == (const MessageAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -225,7 +231,7 @@ MessageAttributes::operator != (const MessageAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -246,7 +252,7 @@ MessageAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -274,7 +280,7 @@ MessageAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -300,7 +306,7 @@ MessageAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -327,7 +333,7 @@ MessageAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -336,8 +342,10 @@ MessageAttributes::NewInstance(bool copy) const
void
MessageAttributes::SelectAll()
{
Select(ID_text, (void *)&text);
Select(ID_severity, (void *)&severity);
Select(ID_text, (void *)&text);
Select(ID_unicode, (void *)&unicode);
Select(ID_hasUnicode, (void *)&hasUnicode);
Select(ID_severity, (void *)&severity);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -353,7 +361,7 @@ MessageAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -376,6 +384,18 @@ MessageAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forc
node->AddNode(new DataNode("text", text));
}
if(completeSave || !FieldsEqual(ID_unicode, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("unicode", unicode));
}
if(completeSave || !FieldsEqual(ID_hasUnicode, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("hasUnicode", hasUnicode));
}
if(completeSave || !FieldsEqual(ID_severity, &defaultObject))
{
addToParent = true;
......@@ -401,7 +421,7 @@ MessageAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forc
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -421,6 +441,10 @@ MessageAttributes::SetFromNode(DataNode *parentNode)
DataNode *node;
if((node = searchNode->GetNode("text")) != 0)
SetText(node->AsString());
if((node = searchNode->GetNode("unicode")) != 0)
SetUnicode(node->AsUnsignedCharVector());
if((node = searchNode->GetNode("hasUnicode")) != 0)
SetHasUnicode(node->AsBool());
if((node = searchNode->GetNode("severity")) != 0)
{
// Allow enums to be int or string in the config file
......@@ -450,6 +474,20 @@ MessageAttributes::SetText(const std::string &text_)
Select(ID_text, (void *)&text);
}
void
MessageAttributes::SetUnicode(const unsignedCharVector &unicode_)
{
unicode = unicode_;
Select(ID_unicode, (void *)&unicode);
}
void
MessageAttributes::SetHasUnicode(bool hasUnicode_)
{
hasUnicode = hasUnicode_;
Select(ID_hasUnicode, (void *)&hasUnicode);
}
void
MessageAttributes::SetSeverity(MessageAttributes::Severity severity_)
{
......@@ -473,6 +511,24 @@ MessageAttributes::GetText()
return text;
}
const unsignedCharVector &
MessageAttributes::GetUnicode() const
{
return unicode;
}
unsignedCharVector &
MessageAttributes::GetUnicode()
{
return unicode;
}
bool