#include <Common/Globals>
#include <Common/iLogger>
#include <Common/iApp>
+#include <Common/iRegistry>
+#include <SdiWindow/iSdiWindow>
-#include <QtGui>
+#include <QtWidgets>
+#include <QXmlStreamReader>
using namespace eVaf;
//-------------------------------------------------------------------
-Window::Window(QWidget * parent, Qt::WindowFlags flags)
- : QWidget(parent, flags)
+Window::Window(QString const & args, QWidget * parent, Qt::WindowFlags flags)
+ : Gui::Panel(parent, flags)
{
setObjectName(QString("%1-Window").arg(VER_MODULE_NAME_STR));
+ SdiWindow::iSdiWindow * win = evafQueryInterface<SdiWindow::iSdiWindow>("iSdiWindow");
+ win->addPanel(getPanelName(args), this);
+
setWindowTitle(tr("Messages"));
Common::iLogger * logger = Common::iLogger::instance();
EVAF_INFO("%s destroyed", qPrintable(objectName()));
}
+QString Window::getPanelName(QString const & args) const
+{
+ QString panelName = "LogView";
+
+ QXmlStreamReader xml(args);
+ while (!xml.atEnd()) {
+ xml.readNext();
+ if (xml.isStartElement() && xml.name() == "attributes") {
+ if (xml.attributes().hasAttribute("panelName")) {
+ QString s = xml.attributes().value("panelName").toString();
+ if (!s.isEmpty())
+ panelName = s;
+ }
+ }
+ }
+
+ return panelName;
+}
+
bool Window::event(QEvent * e)
{
if (e->type() == QEvent::StatusTip) {
bool Module::init(QString const & args)
{
- Q_UNUSED(args);
-
- wWindow = new Window();
+ wWindow = new Window(args);
EVAF_INFO("%s initialized", qPrintable(objectName()));