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;
......
This diff is collapsed.
......@@ -51,7 +51,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 18 14:43:37 PST 2008
// Creation: omitted
//
// Modifications:
//
......@@ -85,15 +85,21 @@ public:
// Property selection methods
virtual void SelectAll();
void SelectText();
void SelectUnicode();
// Property setting methods
void SetText(const std::string &text_);
void SetUnicode(const unsignedCharVector &unicode_);
void SetHasUnicode(bool hasUnicode_);
void SetSeverity(Severity severity_);
// Property getting methods
const std::string &GetText() const;
std::string &GetText();
Severity GetSeverity() const;
const std::string &GetText() const;
std::string &GetText();
const unsignedCharVector &GetUnicode() const;
unsignedCharVector &GetUnicode();
bool GetHasUnicode() const;
Severity GetSeverity() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -116,12 +122,16 @@ public:
// IDs that can be used to identify fields in case statements
enum {
ID_text = 0,
ID_unicode,
ID_hasUnicode,
ID_severity
};
private:
std::string text;
int severity;
std::string text;
unsignedCharVector unicode;
bool hasUnicode;
int severity;
// Static class format string for type map.
static const char *TypeMapFormatString;
......
<?xml version="1.0"?>
<Attribute name="MessageAttributes" purpose="This class contains attributes for sending messages." exportAPI="STATE_API" exportInclude="state_exports.h">
<Attribute name="MessageAttributes" purpose="This class contains attributes for sending messages." persistent="true" keyframe="true" exportAPI="STATE_API" exportInclude="state_exports.h">
<Enum name="Severity">
Error
Warning
......@@ -7,6 +7,15 @@
ErrorClear
Information
</Enum>
<Field name="text" type="string">""</Field>
<Field name="severity" type="enum" subtype="Severity">Message</Field>
<Field name="text" label="text" type="string">
</Field>
<Field name="unicode" label="unicode" type="ucharVector">
</Field>
<Field name="hasUnicode" label="hasUnicode" type="bool">
false
</Field>
<Field name="severity" label="severity" type="enum" subtype="Severity">
Message
</Field>
</Attribute>
This diff is collapsed.
......@@ -51,7 +51,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:44 PDT 2007
// Creation: omitted
//
// Modifications:
//
......@@ -79,12 +79,15 @@ public:
virtual void SelectAll();
void SelectSender();
void SelectStatusMessage();
void SelectUnicode();
void SelectCurrentStageName();
// Property setting methods
void SetSender(const std::string &sender_);
void SetClearStatus(bool clearStatus_);
void SetStatusMessage(const std::string &statusMessage_);
void SetUnicode(const unsignedCharVector &unicode_);
void SetHasUnicode(bool hasUnicode_);
void SetPercent(int percent_);
void SetCurrentStage(int currentStage_);
void SetCurrentStageName(const std::string &currentStageName_);
......@@ -93,18 +96,21 @@ public:
void SetDuration(int duration_);
// Property getting methods
const std::string &GetSender() const;
std::string &GetSender();
bool GetClearStatus() const;
const std::string &GetStatusMessage() const;
std::string &GetStatusMessage();
int GetPercent() const;
int GetCurrentStage() const;
const std::string &GetCurrentStageName() const;
std::string &GetCurrentStageName();
int GetMaxStage() const;
int GetMessageType() const;
int GetDuration() const;
const std::string &GetSender() const;
std::string &GetSender();
bool GetClearStatus() const;
const std::string &GetStatusMessage() const;
std::string &GetStatusMessage();
const unsignedCharVector &GetUnicode() const;
unsignedCharVector &GetUnicode();
bool GetHasUnicode() const;
int GetPercent() const;
int GetCurrentStage() const;
const std::string &GetCurrentStageName() const;
std::string &GetCurrentStageName();
int GetMaxStage() const;
int GetMessageType() const;
int GetDuration() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -123,6 +129,8 @@ public:
ID_sender = 0,
ID_clearStatus,
ID_statusMessage,
ID_unicode,
ID_hasUnicode,
ID_percent,
ID_currentStage,
ID_currentStageName,
......@@ -132,15 +140,17 @@ public:
};
private:
std::string sender;
bool clearStatus;
std::string statusMessage;
int percent;
int currentStage;
std::string currentStageName;
int maxStage;
int messageType;
int duration;
std::string sender;
bool clearStatus;
std::string statusMessage;
unsignedCharVector unicode;
bool hasUnicode;
int percent;
int currentStage;
std::string currentStageName;
int maxStage;
int messageType;
int duration;
// Static class format string for type map.
static const char *TypeMapFormatString;
......
......@@ -8,6 +8,11 @@
</Field>
<Field name="statusMessage" label="statusMessage" type="string">
</Field>
<Field name="unicode" label="statusMessageUnicode" type="ucharVector">
</Field>
<Field name="hasUnicode" label="Has unicode" type="bool">
false
</Field>
<Field name="percent" label="percent" type="int">
0
......
......@@ -45,6 +45,7 @@
#include <ViewerProxy.h>
#include <FileServerList.h>
#include <GetMetaDataException.h>
#include <UnicodeHelper.h>
#include <WindowInformation.h>
#include <SimpleObserver.h>
......@@ -218,6 +219,9 @@ GUIBase::GetViewerMethods() const
// Brad Whitlock, Tue May 20 15:12:44 PST 2003
// Made it work with the regenerated MessageAttributes.
//
// Brad Whitlock, Tue Apr 29 10:17:36 PDT 2008
// Added support for sending the unicode string.
//
// ****************************************************************************
void
......@@ -232,7 +236,7 @@ GUIBase::Error(const QString &msg)
}
else
{
msgAttr->SetText(std::string(msg.latin1()));
MessageAttributes_SetText(*msgAttr, msg);
msgAttr->SetSeverity(MessageAttributes::Error);
msgAttr->Notify();
}
......@@ -261,6 +265,9 @@ GUIBase::Error(const QString &msg)
// Brad Whitlock, Tue May 20 15:12:44 PST 2003
// Made it work with the regenerated MessageAttributes.
//
// Brad Whitlock, Tue Apr 29 10:17:36 PDT 2008
// Added support for sending the unicode string.
//
// ****************************************************************************
void
......@@ -275,7 +282,7 @@ GUIBase::Warning(const QString &msg)
}
else
{
msgAttr->SetText(std::string(msg.latin1()));
MessageAttributes_SetText(*msgAttr, msg);
msgAttr->SetSeverity(MessageAttributes::Warning);
msgAttr->Notify();
}
......@@ -304,6 +311,9 @@ GUIBase::Warning(const QString &msg)
// Brad Whitlock, Tue May 20 15:12:44 PST 2003
// Made it work with the regenerated MessageAttributes.
//
// Brad Whitlock, Tue Apr 29 10:17:36 PDT 2008
// Added support for sending the unicode string.
//
// ****************************************************************************
void
......@@ -318,7 +328,7 @@ GUIBase::Message(const QString &msg)
}
else
{
msgAttr->SetText(std::string(msg.latin1()));
MessageAttributes_SetText(*msgAttr, msg);
msgAttr->SetSeverity(MessageAttributes::Message);
msgAttr->Notify();
}
......@@ -326,6 +336,7 @@ GUIBase::Message(const QString &msg)
// Write to the log as well.
debug3 << "Message: " << msg.latin1() << endl;
}
// ****************************************************************************
// Method: GUIBase::Information
//
......@@ -340,6 +351,8 @@ GUIBase::Message(const QString &msg)
// Creation: Fri Jan 18 14:40:00 PST 2008
//
// Modifications:
// Brad Whitlock, Tue Apr 29 10:17:36 PDT 2008
// Added support for sending the unicode string.
//
// ****************************************************************************
......@@ -355,7 +368,7 @@ GUIBase::Information(const QString &msg)
}
else
{
msgAttr->SetText(std::string(msg.latin1()));
MessageAttributes_SetText(*msgAttr, msg);
msgAttr->SetSeverity(MessageAttributes::Information);
msgAttr->Notify();
}
......@@ -619,10 +632,11 @@ GUIBase::SetOpenDataFile(const QualifiedFilename &qf, int timeState,
ClearStatus();
// Tell the user about the error.
QString msg(QObject::tr("VisIt could not open the file %1.\n\n"
"The metadata server returned the following message:\n\n%2", mName));
msg.replace("%1", QString(qf.FullName().c_str()));
msg.replace("%2",QString(gmde.Message().c_str()));
QString msg = QObject::tr("VisIt could not open the file %1.\n\n"
"The metadata server returned the "