Index: Vago/trunk/Vago/Vago.pro
===================================================================
--- Vago/trunk/Vago/Vago.pro	(revision 1054)
+++ Vago/trunk/Vago/Vago.pro	(revision 1058)
@@ -17,4 +17,5 @@
 INCLUDEPATH += ./soundWizard
 INCLUDEPATH += ./bgImageWizard
+INCLUDEPATH += ./xmlToolsInterface
 
 # Used this great tutorial to build zlib and quazip:
@@ -70,4 +71,8 @@
     bgImageWizard/bgimagepage3.cpp \
     bgImageWizard/bgimagepagefinal.cpp \
+    xmlToolsInterface/xmltoolsinterface.cpp \
+    libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.cpp \
+    xmlToolsInterface/xmltoolsinterfacecommandpreview.cpp \
+    libs/LineNumberDisplay/LineNumberDisplay.cpp
 
 HEADERS  += \
@@ -97,5 +102,9 @@
     bgImageWizard/bgimagewizard.h \
     bgImageWizard/bgimagepage3.h \
-    bgImageWizard/bgimagepagefinal.h
+    bgImageWizard/bgimagepagefinal.h \
+    xmlToolsInterface/xmltoolsinterface.h \
+    libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h \
+    xmlToolsInterface/xmltoolsinterfacecommandpreview.h \
+    libs/LineNumberDisplay/LineNumberDisplay.h
 
 FORMS    += \
@@ -116,4 +125,6 @@
     bgImageWizard/bgimagepage3.ui \
     bgImageWizard/bgimagepagefinal.ui \
+    xmlToolsInterface/xmltoolsinterface.ui \
+    xmlToolsInterface/xmltoolsinterfacecommandpreview.ui
 
 RESOURCES += \
Index: Vago/trunk/Vago/about.cpp
===================================================================
--- Vago/trunk/Vago/about.cpp	(revision 1054)
+++ Vago/trunk/Vago/about.cpp	(revision 1058)
@@ -33,4 +33,6 @@
                          "smashingmagazine for the folder icon :)<br />"
                          "Freepik and Flaticon by the background image wizard icon<br />"
+                         "qtiplot authors for line numbers in QTextEdit<br />"
+                         "d1vanov for basic-xml-syntax-highlighter class <br />"
                          "<center>"
                          "Visit us at:<br />"
Index: Vago/trunk/Vago/bgImageWizard/bgimagepage2.cpp
===================================================================
--- Vago/trunk/Vago/bgImageWizard/bgimagepage2.cpp	(revision 1054)
+++ Vago/trunk/Vago/bgImageWizard/bgimagepage2.cpp	(revision 1058)
@@ -106,5 +106,13 @@
 
     // Update image information
-    ui->lbImageName->setText(myImageFileInfo.baseName().replace("." + myImageFileInfo.suffix(), ""));
+    QString imageName = myImageFileInfo.baseName().replace("." + myImageFileInfo.suffix(), "");
+
+    ui->lbImageName->setToolTip(imageName);
+
+    if(imageName.length() > 30){
+        imageName = imageName.mid(0,27) + "...";
+    }
+
+    ui->lbImageName->setText(imageName);
     ui->lbImageWidth->setText(QString::number(image.width()));
     ui->lbImageHeight->setText(QString::number(image.height()));
Index: Vago/trunk/Vago/bgImageWizard/bgimagepage2.ui
===================================================================
--- Vago/trunk/Vago/bgImageWizard/bgimagepage2.ui	(revision 1054)
+++ Vago/trunk/Vago/bgImageWizard/bgimagepage2.ui	(revision 1058)
@@ -7,6 +7,6 @@
     <x>0</x>
     <y>0</y>
-    <width>404</width>
-    <height>286</height>
+    <width>558</width>
+    <height>323</height>
    </rect>
   </property>
@@ -50,5 +50,5 @@
      <property name="minimumSize">
       <size>
-       <width>380</width>
+       <width>500</width>
        <height>230</height>
       </size>
@@ -60,4 +60,16 @@
       <item>
        <widget class="QGroupBox" name="groupBox_2">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>250</width>
+          <height>128</height>
+         </size>
+        </property>
         <property name="title">
          <string>Preview</string>
@@ -76,4 +88,16 @@
       <item>
        <widget class="QGroupBox" name="groupBox_3">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>250</width>
+          <height>128</height>
+         </size>
+        </property>
         <property name="title">
          <string>Details</string>
Index: Vago/trunk/Vago/bgImageWizard/bgimagepage3.cpp
===================================================================
--- Vago/trunk/Vago/bgImageWizard/bgimagepage3.cpp	(revision 1054)
+++ Vago/trunk/Vago/bgImageWizard/bgimagepage3.cpp	(revision 1058)
@@ -85,28 +85,40 @@
         backgroundName = "TXMPother";
         txmbName = "TXMBother";
+        ui->leLevelId->clear();
+        ui->leLevelId->setEnabled(false);
     }
     else if(type == "Intro Screen"){
         backgroundName = "TXMPlevel" + levelNumber + "_intro_";
         txmbName = "TXMBintro_splash_screen";
+        ui->leLevelId->setEnabled(true);
     }
     else if(type == "Win Screen"){
         backgroundName = "TXMPlevel" + levelNumber + "_win_";
         txmbName = "TXMBwin_splash_screen";
+        ui->leLevelId->setEnabled(true);
     }
     else if(type == "Loose Screen"){
         backgroundName = "TXMPfail01_";
         txmbName = "TXMBfail_splash_screen";
+        ui->leLevelId->clear();
+        ui->leLevelId->setEnabled(false);
     }
     else if(type == "Main Menu Screen"){
         backgroundName = "TXMPOni_startup_";
         txmbName = "TXMBpict_mainmenu";
+        ui->leLevelId->clear();
+        ui->leLevelId->setEnabled(false);
     }
     else if(type == "Options Menu Screen"){
         backgroundName = "TXMPoptions_";
         txmbName = "TXMBpict_options_background";
+        ui->leLevelId->clear();
+        ui->leLevelId->setEnabled(false);
     }
     else if(type == "Load Level Screen"){
         backgroundName = "TXMPoni_kanji_";
         txmbName = "TXMBpict_loadgame_background";
+        ui->leLevelId->clear();
+        ui->leLevelId->setEnabled(false);
     }
 
Index: Vago/trunk/Vago/bgImageWizard/bgimagepagefinal.cpp
===================================================================
--- Vago/trunk/Vago/bgImageWizard/bgimagepagefinal.cpp	(revision 1054)
+++ Vago/trunk/Vago/bgImageWizard/bgimagepagefinal.cpp	(revision 1058)
@@ -164,31 +164,4 @@
 }
 
-/*
-QVector<int> BGImagePageFinal::getSplitSizes(int imageSideSize)
-{
-    int currNumber = 256;
-    int remainingSideSize = imageSideSize;
-
-    QVector<int> splitSizes;
-
-    while(currNumber > 8){
-        if(remainingSideSize-currNumber >= 0){
-            splitSizes.append(currNumber);
-            remainingSideSize -= currNumber;
-        }
-        else{
-            currNumber /= 2;
-        }
-    }
-
-    if(remainingSideSize != 0)
-    {
-        splitSizes.clear();
-    }
-
-    return splitSizes;
-}
-*/
-
 QVector<int> BGImagePageFinal::getSplitSizes(int imageSideSize)
 {
Index: Vago/trunk/Vago/libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.cpp
===================================================================
--- Vago/trunk/Vago/libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.cpp	(revision 1058)
+++ Vago/trunk/Vago/libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.cpp	(revision 1058)
@@ -0,0 +1,89 @@
+#include "BasicXMLSyntaxHighlighter.h"
+
+BasicXMLSyntaxHighlighter::BasicXMLSyntaxHighlighter(QObject * parent) :
+    QSyntaxHighlighter(parent)
+{
+    setRegexes();
+    setFormats();
+}
+
+BasicXMLSyntaxHighlighter::BasicXMLSyntaxHighlighter(QTextDocument * parent) :
+    QSyntaxHighlighter(parent)
+{
+    setRegexes();
+    setFormats();
+}
+
+BasicXMLSyntaxHighlighter::BasicXMLSyntaxHighlighter(QTextEdit * parent) :
+    QSyntaxHighlighter(parent)
+{
+    setRegexes();
+    setFormats();
+}
+
+void BasicXMLSyntaxHighlighter::highlightBlock(const QString & text)
+{
+    // Special treatment for xml element regex as we use captured text to emulate lookbehind
+    int xmlElementIndex = m_xmlElementRegex.indexIn(text);
+    while(xmlElementIndex >= 0)
+    {
+        int matchedPos = m_xmlElementRegex.pos(1);
+        int matchedLength = m_xmlElementRegex.cap(1).length();
+        setFormat(matchedPos, matchedLength, m_xmlElementFormat);
+
+        xmlElementIndex = m_xmlElementRegex.indexIn(text, matchedPos + matchedLength);
+    }
+
+    // Highlight xml keywords *after* xml elements to fix any occasional / captured into the enclosing element
+    typedef QList<QRegExp>::const_iterator Iter;
+    Iter xmlKeywordRegexesEnd = m_xmlKeywordRegexes.end();
+    for(Iter it = m_xmlKeywordRegexes.begin(); it != xmlKeywordRegexesEnd; ++it) {
+        const QRegExp & regex = *it;
+        highlightByRegex(m_xmlKeywordFormat, regex, text);
+    }
+
+    highlightByRegex(m_xmlAttributeFormat, m_xmlAttributeRegex, text);
+    highlightByRegex(m_xmlCommentFormat, m_xmlCommentRegex, text);
+    highlightByRegex(m_xmlValueFormat, m_xmlValueRegex, text);
+}
+
+void BasicXMLSyntaxHighlighter::highlightByRegex(const QTextCharFormat & format,
+                                                 const QRegExp & regex, const QString & text)
+{
+    int index = regex.indexIn(text);
+
+    while(index >= 0)
+    {
+        int matchedLength = regex.matchedLength();
+        setFormat(index, matchedLength, format);
+
+        index = regex.indexIn(text, index + matchedLength);
+    }
+}
+
+void BasicXMLSyntaxHighlighter::setRegexes()
+{
+    m_xmlElementRegex.setPattern("<[\\s]*[/]?[\\s]*([^\\n]\\w*)(?=[\\s/>])");
+    m_xmlAttributeRegex.setPattern("\\w+(?=\\=)");
+    m_xmlValueRegex.setPattern("\"[^\\n\"]+\"(?=[\\s/>])");
+    m_xmlCommentRegex.setPattern("<!--[^\\n]*-->");
+
+    m_xmlKeywordRegexes = QList<QRegExp>() << QRegExp("<\\?") << QRegExp("/>")
+                                           << QRegExp(">") << QRegExp("<") << QRegExp("</")
+                                           << QRegExp("\\?>");
+}
+
+void BasicXMLSyntaxHighlighter::setFormats()
+{
+    m_xmlKeywordFormat.setForeground(Qt::blue);
+
+    m_xmlElementFormat.setForeground(Qt::blue);
+
+    m_xmlAttributeFormat.setForeground(Qt::red);
+
+    m_xmlValueFormat.setForeground(QColor(0x8055FF));
+    m_xmlValueFormat.setFontWeight(QFont::Bold);
+
+    m_xmlCommentFormat.setForeground(Qt::gray);
+}
+
Index: Vago/trunk/Vago/libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h
===================================================================
--- Vago/trunk/Vago/libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h	(revision 1058)
+++ Vago/trunk/Vago/libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h	(revision 1058)
@@ -0,0 +1,39 @@
+#ifndef BASIC_XML_SYNTAX_HIGHLIGHTER_H
+#define BASIC_XML_SYNTAX_HIGHLIGHTER_H
+
+#include <QSyntaxHighlighter>
+#include <QTextEdit>
+
+class BasicXMLSyntaxHighlighter : public QSyntaxHighlighter
+{
+    Q_OBJECT
+public:
+    BasicXMLSyntaxHighlighter(QObject * parent);
+    BasicXMLSyntaxHighlighter(QTextDocument * parent);
+    BasicXMLSyntaxHighlighter(QTextEdit * parent);
+
+protected:
+    virtual void highlightBlock(const QString & text);
+
+private:
+    void highlightByRegex(const QTextCharFormat & format,
+                          const QRegExp & regex, const QString & text);
+
+    void setRegexes();
+    void setFormats();
+
+private:
+    QTextCharFormat     m_xmlKeywordFormat;
+    QTextCharFormat     m_xmlElementFormat;
+    QTextCharFormat     m_xmlAttributeFormat;
+    QTextCharFormat     m_xmlValueFormat;
+    QTextCharFormat     m_xmlCommentFormat;
+
+    QList<QRegExp>      m_xmlKeywordRegexes;
+    QRegExp             m_xmlElementRegex;
+    QRegExp             m_xmlAttributeRegex;
+    QRegExp             m_xmlValueRegex;
+    QRegExp             m_xmlCommentRegex;
+};
+
+#endif // BASIC_XML_SYNTAX_HIGHLIGHTER_H
Index: Vago/trunk/Vago/libs/LineNumberDisplay/LineNumberDisplay.cpp
===================================================================
--- Vago/trunk/Vago/libs/LineNumberDisplay/LineNumberDisplay.cpp	(revision 1058)
+++ Vago/trunk/Vago/libs/LineNumberDisplay/LineNumberDisplay.cpp	(revision 1058)
@@ -0,0 +1,127 @@
+/***************************************************************************
+    File                 : LineNumberDisplay.cpp
+    Project              : QtiPlot
+    --------------------------------------------------------------------
+    Copyright            : (C) 2008 by Ion Vasilief
+    Email (use @ for *)  : ion_vasilief*yahoo.fr
+    Description          : A widget displaying line numbers for a QTextEdit
+
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the Free Software           *
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
+ *   Boston, MA  02110-1301  USA                                           *
+ *                                                                         *
+ ***************************************************************************/
+#include "LineNumberDisplay.h"
+#include <QScrollBar>
+#include <QShowEvent>
+#include <QPainter>
+
+LineNumberDisplay::LineNumberDisplay(QTextEdit *te, QWidget *parent)
+		 : QTextEdit(parent), d_text_edit(te)
+{
+	setReadOnly(true);
+	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+	setFrameStyle(QFrame::Panel | QFrame::Raised);
+	setMaximumWidth(0);
+	setLineWidth(0);
+	setFocusPolicy(Qt::NoFocus);
+	setCurrentFont(te->currentFont());
+	viewport()->setCursor(Qt::ArrowCursor);
+
+	QPalette palette = this->palette();
+	palette.setColor(QPalette::Highlight, palette.color(QPalette::Base));
+	setPalette(palette);
+
+	if (te){
+		connect(this, SIGNAL(selectionChanged()), this, SLOT(updateDocumentSelection()));
+
+		connect(te->document(), SIGNAL(contentsChanged()), this, SLOT(updateLineNumbers()));
+		connect((QObject *)te->verticalScrollBar(), SIGNAL(valueChanged(int)),
+			(QObject *)verticalScrollBar(), SLOT(setValue(int)));
+        connect(te, SIGNAL(currentCharFormatChanged (const QTextCharFormat &)),
+                this, SLOT(changeCharFormat (const QTextCharFormat &)));
+	}
+
+    // Disable manual user scrolls
+    this->verticalScrollBar()->setEnabled(false);
+    this->horizontalScrollBar()->setEnabled(false);
+}
+
+void LineNumberDisplay::updateDocumentSelection()
+{
+	if (!isVisible() || !d_text_edit)
+		return;
+
+	QTextCursor c = textCursor();
+#if QT_VERSION >= 0x040500
+	int selectionStart = document()->findBlock(c.selectionStart()).firstLineNumber();
+	int selectionEnd = document()->findBlock(c.selectionEnd()).firstLineNumber();
+#else
+	int selectionStart = document()->findBlock(c.selectionStart()).blockNumber();
+	int selectionEnd = document()->findBlock(c.selectionEnd()).blockNumber();
+#endif
+	int selectedLines = abs(selectionEnd - selectionStart);
+
+	QTextCursor cursor(d_text_edit->textCursor());
+	cursor.movePosition(QTextCursor::Start);
+	for (int i = 0; i < selectionStart; i++)
+		cursor.movePosition(QTextCursor::Down);
+
+	for (int i = 0; i < selectedLines; i++)
+		cursor.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor);
+
+	cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
+
+	if (selectionEnd == d_text_edit->document()->blockCount() - 1)
+		cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
+
+	d_text_edit->setTextCursor(cursor);
+}
+
+void LineNumberDisplay::updateLineNumbers(bool force)
+{
+	if (!isVisible() || !d_text_edit)
+		return;
+
+	int lines = d_text_edit->document()->blockCount();
+	if (document()->blockCount() - 1 == lines && !force)
+		return;
+
+	QString aux;
+	for(int i = 0; i < lines; i++)
+		aux += QString::number(i + 1) + "\n";
+
+	setPlainText(aux);
+
+	QFontMetrics fm(d_text_edit->currentFont(), this);
+	setMaximumWidth(2*fm.boundingRect(QString::number(lines)).width());
+	verticalScrollBar()->setValue(d_text_edit->verticalScrollBar()->value());
+}
+
+void LineNumberDisplay::showEvent(QShowEvent *e)
+{
+	e->accept();
+	if (isVisible())
+		updateLineNumbers();
+}
+
+void LineNumberDisplay::changeCharFormat (const QTextCharFormat &f)
+{
+    setCurrentFont(f.font());
+}
Index: Vago/trunk/Vago/libs/LineNumberDisplay/LineNumberDisplay.h
===================================================================
--- Vago/trunk/Vago/libs/LineNumberDisplay/LineNumberDisplay.h	(revision 1058)
+++ Vago/trunk/Vago/libs/LineNumberDisplay/LineNumberDisplay.h	(revision 1058)
@@ -0,0 +1,62 @@
+/***************************************************************************
+    File                 : LineNumberDisplay.h
+    Project              : QtiPlot
+    --------------------------------------------------------------------
+    Copyright            : (C) 2008 by Ion Vasilief
+    Email (use @ for *)  : ion_vasilief*yahoo.fr
+    Description          : A widget displaying line numbers for a QTextEdit
+
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the Free Software           *
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
+ *   Boston, MA  02110-1301  USA                                           *
+ *                                                                         *
+ ***************************************************************************/
+#ifndef LineNumberDisplay_H
+#define LineNumberDisplay_H
+
+#include <QTextEdit>
+#include <QTextBlock>
+
+//! A QTextEdit displaying line numbers.
+/**
+ * It must be used in connection with another "source" QTextEdit.
+ */
+class LineNumberDisplay: public QTextEdit
+{
+    Q_OBJECT
+
+public:
+	//! Constructor
+	/**
+	* \param te the "source" QTextEdit for which we want to display the line numbers
+	* \param parent parent widget (only affects placement of the dialog)
+	*/
+	LineNumberDisplay(QTextEdit *te, QWidget *parent = 0);
+
+public slots:
+	void updateLineNumbers(bool force = false);
+	void updateDocumentSelection();
+
+private slots:
+	void changeCharFormat (const QTextCharFormat &);
+
+private:
+	void showEvent(QShowEvent *);
+	QTextEdit *d_text_edit;
+};
+#endif
Index: Vago/trunk/Vago/main.cpp
===================================================================
--- Vago/trunk/Vago/main.cpp	(revision 1054)
+++ Vago/trunk/Vago/main.cpp	(revision 1058)
@@ -11,4 +11,7 @@
     a.setStyleSheet("QStatusBar::item { border: 0px; }"); //hide QLabels border in status bar //http://qt-project.org/forums/viewthread/18743
 
+//    XmlToolsInterface *xmlToolsWindow = new XmlToolsInterface(new Logger(UtilVago::getAppPath(), GlobalVars::AppLogName));
+//    xmlToolsWindow->show(); //it destroys itself when finished.
+
     return a.exec();
 }
Index: Vago/trunk/Vago/mainwindow.cpp
===================================================================
--- Vago/trunk/Vago/mainwindow.cpp	(revision 1054)
+++ Vago/trunk/Vago/mainwindow.cpp	(revision 1058)
@@ -129,7 +129,4 @@
     ui->statusBar->addPermanentWidget(ui->tbAbortConversion);
 
-    //Initialize list pointers
-    this->listToProccess = new QStringList;
-
     // User interface
     ui->mainToolBar->addWidget(ui->tbAE); //add ae installer launch button
@@ -139,4 +136,6 @@
     ui->mainToolBar->addWidget(ui->tbCommand); //add option to manual onisplit commands
     ui->mainToolBar->addWidget(ui->emptySpacerLabel3); //same as before
+    ui->mainToolBar->addWidget(ui->tbXmlToolsInterface); //add option to manual onisplit commands
+    ui->mainToolBar->addWidget(ui->emptySpacerLabel4); //same as before
     ui->mainToolBar->addWidget(ui->tbOpenFolder); //add option to open folder with files converted etc
 
@@ -208,7 +207,7 @@
 
     //Create a thread for do the conversion in background
-    this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, this->listToProccess, this->win7TaskBarProgress);
+    this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, &this->listToProccess, this->win7TaskBarProgress);
 #else
-    this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, this->listToProccess);
+    this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, &this->listToProccess);
 #endif
 
@@ -291,4 +290,13 @@
 {
     QDesktopServices::openUrl(QUrl("file:///"+this->outputFolder));
+}
+
+
+void MainWindow::on_tbXmlToolsInterface_clicked()
+{
+    //We pass no parent because we want to have an independent window for XmlToolsInterface,
+    //so we can minimize it or maximize indepently from the MainWindow
+    XmlToolsInterface *xmlToolsWindow = new XmlToolsInterface(this->myLogger);
+    xmlToolsWindow->show(); //it destroys itself when finished.
 }
 
@@ -742,5 +750,5 @@
         //Only process enabled items
         if(currTable->item(i,2)->background()!=currTable->disabledBackStyle){
-            this->listToProccess->append(currTable->item(i,2)->text());
+            this->listToProccess.append(currTable->item(i,2)->text());
         }
     }
@@ -1187,6 +1195,10 @@
         if(result == QMessageBox::StandardButton::Cancel){
             event->ignore();
-        }
-    }
+            return;
+        }
+    }
+
+    // Exit application (this will also close all other windows which don't have parent, for instance ManualCommands)
+    QApplication::quit();
 }
 
@@ -1225,5 +1237,5 @@
     ui->cbGridsLevels->setEnabled(checked);
     ui->cbGridsLevels->setChecked(checked);
-    if(checked){
+    if(checked && !projectIsLoading){
         QString file=QFileDialog::getOpenFileName(this,"Choose the BNV.dae file...","./" , "All Files (*.*)");
         if(!file.isEmpty()){
@@ -1237,5 +1249,5 @@
     ui->leAdditSourcesLevels->setEnabled(checked);
 
-    if(checked){
+    if(checked && !projectIsLoading){
         QStringList filesSelected=QFileDialog::getOpenFileNames(this,"Choose the additional .dae files...","./" , "All Files (*.*)");
         QString filesJoined;
@@ -1306,6 +1318,7 @@
 void MainWindow::on_tbCommand_clicked()
 {
-    //Show preferences
-    ManualCommands *commandsWindow = new ManualCommands(this);
+    //We pass no parent because we want to have an independent window for ManualCommands,
+    //so we can minimize it or maximize indepently from the MainWindow
+    ManualCommands *commandsWindow = new ManualCommands();
     commandsWindow->show(); //it destroys itself when finished.
 }
@@ -2002,7 +2015,10 @@
 {
 
+    this->projectIsLoading = true;
+
     if(this->vagoSettings->value("AskSaveProject").toBool() && this->unsavedChangesExist){
         QMessageBox::StandardButton result = askToSaveCurrentProject();
         if(result == QMessageBox::StandardButton::Cancel){
+            this->projectIsLoading = false;
             return;
         }
@@ -2018,4 +2034,5 @@
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error ocurred while loading project file.\n" + QString(result.description()));
         showErrStatusMessage(statusError);
+        this->projectIsLoading = false;
         return;
     }
@@ -2025,4 +2042,5 @@
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, QString(doc.root().name()) + "The file opened is not a valid VagoProject file. Load aborted.");
         showErrStatusMessage(statusError);
+        this->projectIsLoading = false;
         return;
     }
@@ -2037,4 +2055,5 @@
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't find the vagoVersion of the current project. Load aborted.\n" + QString(e.what()));
         showErrStatusMessage(statusError);
+        this->projectIsLoading = false;
         return;
     }
@@ -2043,4 +2062,5 @@
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "The project that you are trying to load seems it is not compatible with your Vago Version. Please update Vago and try again.");
         showErrStatusMessage(statusError);
+        this->projectIsLoading = false;
         return;
     }
@@ -2058,4 +2078,5 @@
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't load the vago project. Error: " + QString(e.what()));
         showErrStatusMessage(statusError);
+        this->projectIsLoading = false;
         return;
     }
@@ -2069,4 +2090,6 @@
 
     setVagoWindowTitle();
+
+    this->projectIsLoading = false;
 
     showSuccessStatusMessage("Project loaded sucessfully.");
@@ -2132,5 +2155,5 @@
         ui->cbGridsLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@generateGrids")).attribute().as_bool());
         ui->cbAdditionalSourcesLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@additionalSources")).attribute().as_bool());
-        ui->leAdditSourcesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@bnvSource")).attribute().value()));
+        ui->leAdditSourcesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@additionalSourcesValue")).attribute().value()));
     }
     else{
Index: Vago/trunk/Vago/mainwindow.h
===================================================================
--- Vago/trunk/Vago/mainwindow.h	(revision 1054)
+++ Vago/trunk/Vago/mainwindow.h	(revision 1058)
@@ -11,4 +11,5 @@
 #include "converter.h"
 #include "droptablewidget.h"
+#include "xmltoolsinterface.h"
 
 #include <QMainWindow>
@@ -36,5 +37,4 @@
 
 #include "libs/pugixml/pugixml.hpp"
-//#include <QDebug>
 
 namespace Ui {
@@ -198,4 +198,6 @@
 
     void on_actionNew_Project_triggered();
+
+    void on_tbXmlToolsInterface_clicked();
 
 private:
@@ -215,5 +217,5 @@
     QProgressBar *myBar; //Progress Bar
     QHash<QString, QString> commandMap; //Map the commands for fast retreive
-    QStringList *listToProccess; //items to proccess
+    QStringList listToProccess; //items to proccess
     Converter *myConverter = nullptr;
     QSettings *vagoSettings;
@@ -229,4 +231,7 @@
     // Indicates that the application is fully loaded which includes painting the main window
     bool applicationIsFullyLoaded = false;
+    // This variable indicates that we have a project being loaded. It should only be set by MainWindow thread.
+    // It allow us to ignore certain gui slots like when checking checkbox that ask the user for input
+    bool projectIsLoading = false;
 
     // anonymous enum
Index: Vago/trunk/Vago/mainwindow.ui
===================================================================
--- Vago/trunk/Vago/mainwindow.ui	(revision 1054)
+++ Vago/trunk/Vago/mainwindow.ui	(revision 1058)
@@ -21,5 +21,5 @@
    <layout class="QVBoxLayout" name="verticalLayout">
     <item>
-     <layout class="QHBoxLayout" name="horizontalLayout_10">
+     <layout class="QHBoxLayout" name="horizontalLayout_5">
       <item>
        <widget class="QToolButton" name="tbAbortConversion">
@@ -50,4 +50,43 @@
          <iconset resource="resources.qrc">
           <normaloff>:/new/icons/folder_icon.png</normaloff>:/new/icons/folder_icon.png</iconset>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="emptySpacerLabel2">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>20</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="baseSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string/>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolButton" name="tbXmlToolsInterface">
+        <property name="toolTip">
+         <string>XmlTools Interface</string>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="icon">
+         <iconset resource="resources.qrc">
+          <normaloff>:/new/icons/xmltoolsinterface.png</normaloff>:/new/icons/xmltoolsinterface.png</iconset>
         </property>
        </widget>
@@ -75,5 +114,5 @@
        <widget class="QToolButton" name="tbCommand">
         <property name="toolTip">
-         <string>Manual OniSplit Commands</string>
+         <string>Manual Tools Commands</string>
         </property>
         <property name="text">
@@ -87,5 +126,5 @@
       </item>
       <item>
-       <widget class="QLabel" name="emptySpacerLabel2">
+       <widget class="QLabel" name="emptySpacerLabel4">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@@ -97,10 +136,4 @@
          <size>
           <width>20</width>
-          <height>0</height>
-         </size>
-        </property>
-        <property name="baseSize">
-         <size>
-          <width>0</width>
           <height>0</height>
          </size>
@@ -1431,4 +1464,5 @@
     <addaction name="actionSound_Wizard"/>
     <addaction name="actionBackground_Image_Wizard"/>
+    <addaction name="separator"/>
    </widget>
    <addaction name="menuFile"/>
@@ -1636,4 +1670,13 @@
    </property>
   </action>
+  <action name="actionXmlTools_Interface">
+   <property name="icon">
+    <iconset resource="resources.qrc">
+     <normaloff>:/new/icons/xmltoolsinterface.png</normaloff>:/new/icons/xmltoolsinterface.png</iconset>
+   </property>
+   <property name="text">
+    <string>XmlTools Interface</string>
+   </property>
+  </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
Index: Vago/trunk/Vago/manualcommands.cpp
===================================================================
--- Vago/trunk/Vago/manualcommands.cpp	(revision 1054)
+++ Vago/trunk/Vago/manualcommands.cpp	(revision 1058)
@@ -1,5 +1,4 @@
 #include "manualcommands.h"
 #include "ui_manualcommands.h"
-#include <QDebug>
 
 ManualCommands::ManualCommands(QWidget *parent) :
@@ -8,5 +7,5 @@
 {
     ui->setupUi(this);
-    this->setAttribute(Qt::WA_DeleteOnClose,true); //destroy itself once finished.
+    this->setAttribute(Qt::WA_DeleteOnClose, true); //destroy itself once finished.
     this->myProcess = new QProcess();
     this->myProcess->setProcessChannelMode(QProcess::MergedChannels);
@@ -33,4 +32,13 @@
 
 void ManualCommands::executeCommand(){
+
+    QString toolExecutable;
+
+    if(ui->cbTargetTool->currentText() == "OniSplit"){
+        toolExecutable = UtilVago::getOniSplitExecutable();
+    }
+    else{
+        toolExecutable = UtilVago::getXmlToolsExecutable();
+    }
 
     QString command=ui->leManualCommand->text().trimmed();
@@ -62,9 +70,7 @@
     }
 
-    QString var = UtilVago::getOniSplitExecutable() +" "+ui->leManualCommand->text();
-
-    this->myProcess->start(UtilVago::getOniSplitExecutable()+" "+ui->leManualCommand->text());
+    this->myProcess->start(toolExecutable+" "+ui->leManualCommand->text());
     this->myProcess->waitForFinished(120000); //wait 2 minutes at maximum
-    ui->ptOutput->appendPlainText("> "+command);
+    ui->ptOutput->appendPlainText("> " + ui->cbTargetTool->currentText() + " " + command);
     ui->ptOutput->appendPlainText(this->myProcess->readAll());
     ui->ptOutput->ensureCursorVisible();
Index: Vago/trunk/Vago/manualcommands.ui
===================================================================
--- Vago/trunk/Vago/manualcommands.ui	(revision 1054)
+++ Vago/trunk/Vago/manualcommands.ui	(revision 1058)
@@ -7,10 +7,14 @@
     <x>0</x>
     <y>0</y>
-    <width>460</width>
-    <height>300</height>
+    <width>640</width>
+    <height>480</height>
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Manual OniSplit Commands</string>
+   <string>Manual Tools Commands</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="resources.qrc">
+    <normaloff>:/new/icons/command_icon.png</normaloff>:/new/icons/command_icon.png</iconset>
   </property>
   <widget class="QWidget" name="centralwidget">
@@ -22,4 +26,25 @@
       </property>
       <layout class="QHBoxLayout" name="horizontalLayout_2">
+       <item>
+        <widget class="QLabel" name="label_2">
+         <property name="text">
+          <string>Target Tool:</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QComboBox" name="cbTargetTool">
+         <item>
+          <property name="text">
+           <string>OniSplit</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>XmlTools</string>
+          </property>
+         </item>
+        </widget>
+       </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout">
@@ -134,5 +159,7 @@
   </widget>
  </widget>
- <resources/>
+ <resources>
+  <include location="resources.qrc"/>
+ </resources>
  <connections>
   <connection>
Index: Vago/trunk/Vago/readme.txt
===================================================================
--- Vago/trunk/Vago/readme.txt	(revision 1054)
+++ Vago/trunk/Vago/readme.txt	(revision 1058)
@@ -1,5 +1,5 @@
 Readme.txt
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Vago GUI v1.1
+Vago GUI v1.2
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -37,4 +37,14 @@
 ----------------------------------
 Change Log:
+----------------------------------
+1.2, 30-10-2016
+- Upgraded to XmlTools 2.0c
+- Added a XmlTools interface. Click in the XML icon in the main window.
+- Now in manual commands you can choose if you want to call OniSplit or XmlTools
+- Now manual commands behaves likes an independent window
+- Fixed additional sources in levels tab when loading project
+- Interface was asking user for additional sources and bnv source files when this 
+options were checked in levels tab when a project was loading. This was fixed.
+- Fixed background image page 2 layout when the image name is large
 ----------------------------------
 1.1, 12-10-2016
Index: Vago/trunk/Vago/resources.qrc
===================================================================
--- Vago/trunk/Vago/resources.qrc	(revision 1054)
+++ Vago/trunk/Vago/resources.qrc	(revision 1058)
@@ -16,4 +16,5 @@
         <file>abort.png</file>
         <file>background_image.png</file>
+        <file>xmltoolsinterface.png</file>
     </qresource>
     <qresource prefix="/new/about">
Index: Vago/trunk/Vago/utilvago.h
===================================================================
--- Vago/trunk/Vago/utilvago.h	(revision 1054)
+++ Vago/trunk/Vago/utilvago.h	(revision 1058)
@@ -7,5 +7,5 @@
 namespace GlobalVars{
 
-const QString AppVersion="1.1";
+const QString AppVersion="1.2";
 const QString LastCompatibleVersion = "1.0";
 const QString ToolsFolder = "tools";
@@ -25,5 +25,5 @@
 const QString AppLogName="logVago.txt";
 const QString BuiltOniSplitVersion="0.9.96.0";
-const QString BuiltXmlToolsVersion="2.0b";
+const QString BuiltXmlToolsVersion="2.0c";
 const QString ModsDomain="mods.oni2.net";
 #ifdef Q_OS_WIN
Index: Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterface.cpp
===================================================================
--- Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterface.cpp	(revision 1058)
+++ Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterface.cpp	(revision 1058)
@@ -0,0 +1,411 @@
+#include "xmltoolsinterface.h"
+#include "ui_xmltoolsinterface.h"
+
+XmlToolsInterface::XmlToolsInterface(Logger *myLogger, QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::XmlToolsInterface),
+    xmlProcessor()
+{
+    ui->setupUi(this);
+    this->setAttribute(Qt::WA_DeleteOnClose, true); //destroy itself once finished.
+    this->myLogger = myLogger;
+    this->xmlProcessor = new XmlProcessor(UtilVago::getAppPath(), this->myLogger, &this->listToProccess);
+
+    // setup the correct input options for the current selection
+    on_rbFilterRelativeElements_clicked();
+    on_cbFilterParentElement_toggled(ui->cbFilterParentElement->isChecked());
+    on_cbFilterAttributeName_toggled(ui->cbFilterAttributeName->isChecked());
+    on_cbXmlToolsOperation_currentIndexChanged(ui->cbXmlToolsOperation->currentText());
+
+    connect(this->xmlProcessor, SIGNAL(resultConversion(QString,int)), this, SLOT(TXmlToolsResult(QString,int)));
+}
+
+XmlToolsInterface::~XmlToolsInterface()
+{
+    delete xmlProcessor;
+    delete ui;
+}
+
+void XmlToolsInterface::dropEvent(QDropEvent* event)
+{
+    const QMimeData* mimeData = event->mimeData();
+
+    event->acceptProposedAction();
+
+    // Set the input file. This file type was already validated by the dragEnterEvent at this point
+    ui->leInputInputFiles->setText(mimeData->urls().at(0).toLocalFile());
+}
+
+void XmlToolsInterface::dragEnterEvent(QDragEnterEvent *event){
+    const QMimeData* mimeData = event->mimeData();
+
+    if (mimeData->hasUrls())
+    {
+        if(mimeData->urls().size() == 1 && QFileInfo(mimeData->urls().at(0).toLocalFile()).suffix().toUpper() == "XML"){
+            event->accept();
+        }
+    }
+}
+
+void XmlToolsInterface::on_rbFilterRelativeElements_clicked()
+{
+    ui->leFilterXPathExpression->setEnabled(false);
+    ui->leFilterElement->setEnabled(true);
+    ui->leFilterParentElement->setEnabled(true);
+    ui->lbFilterElement->setEnabled(true);
+    ui->cbFilterParentElement->setEnabled(true);
+    ui->leFilterAttributeName->setEnabled(true);
+    ui->leFilterAttributeValue->setEnabled(true);
+    ui->lbFilterAttributeValue->setEnabled(true);
+    ui->cbFilterAttributeName->setEnabled(true);
+
+    on_cbFilterParentElement_toggled(ui->cbFilterParentElement->isChecked());
+    on_cbFilterAttributeName_toggled(ui->cbFilterAttributeName->isChecked());
+
+    setCommand();
+}
+
+void XmlToolsInterface::on_rbFilterXPathExpression_clicked()
+{
+    ui->leFilterElement->setEnabled(false);
+    ui->leFilterParentElement->setEnabled(false);
+    ui->lbFilterElement->setEnabled(false);
+    ui->cbFilterParentElement->setEnabled(false);
+    ui->leFilterAttributeName->setEnabled(false);
+    ui->leFilterAttributeValue->setEnabled(false);
+    ui->lbFilterAttributeValue->setEnabled(false);
+    ui->cbFilterAttributeName->setEnabled(false);
+    ui->leFilterXPathExpression->setEnabled(true);
+
+    setCommand();
+}
+
+void XmlToolsInterface::on_cbXmlToolsOperation_currentIndexChanged(const QString &arg1)
+{
+    ui->leInputCurrentValues->setEnabled(true);
+    ui->leInputNewValues->setEnabled(true);
+    ui->leInputDiffOldNewValue->setEnabled(true);
+    ui->leInputPositions->setEnabled(true);
+
+    if(arg1 == "Add Values"){
+        ui->leInputCurrentValues->setEnabled(false);
+        ui->leInputDiffOldNewValue->setEnabled(false);
+        ui->leInputPositions->setEnabled(false);
+    }
+    else if(arg1 == "Remove Values"){
+        ui->leInputNewValues->setEnabled(false);
+        ui->leInputDiffOldNewValue->setEnabled(false);
+        ui->leInputPositions->setEnabled(false);
+    }
+    else if(arg1 == "Replace Single Value"){
+        ui->leInputDiffOldNewValue->setEnabled(false);
+        ui->leInputPositions->setEnabled(false);
+    }
+    else if(arg1 == "Replace All Values"){
+        ui->leInputCurrentValues->setEnabled(false);
+        ui->leInputDiffOldNewValue->setEnabled(false);
+    }
+    else if(arg1 == "Update Elements"){
+        ui->leInputCurrentValues->setEnabled(false);
+        ui->leInputNewValues->setEnabled(false);
+        ui->leInputPositions->setEnabled(false);
+    }
+    else if(arg1 == "Invert Elements"){
+        ui->leInputCurrentValues->setEnabled(false);
+        ui->leInputNewValues->setEnabled(false);
+        ui->leInputDiffOldNewValue->setEnabled(false);
+        ui->leInputPositions->setEnabled(false);
+    }
+
+    setCommand();
+}
+
+void XmlToolsInterface::on_cbFilterParentElement_toggled(bool checked)
+{
+    ui->leFilterParentElement->setEnabled(checked);
+}
+
+void XmlToolsInterface::on_cbFilterAttributeName_toggled(bool checked)
+{
+    ui->leFilterAttributeName->setEnabled(checked);
+    ui->leFilterAttributeValue->setEnabled(checked);
+}
+
+void XmlToolsInterface::on_pbInputBrowse_clicked()
+{
+    QString result = QFileDialog::getOpenFileName(this,"Choose the XML file...","./" , "XML Files (*.xml)");
+
+    if(!result.isEmpty()){
+        ui->leInputInputFiles->setText(result);
+    }
+}
+
+void XmlToolsInterface::on_pbPreviewOperation_clicked()
+{
+    if(!validateInput()){
+        return;
+    }
+    this->listToProccess.clear();
+
+    // Copy the target file to temporary location and aply to it the command
+
+    QString currentFileLocation = ui->leInputInputFiles->text();
+    QString previewFileLocation=GlobalVars::VagoTemporaryDir+"/"+QFileInfo(currentFileLocation).fileName();
+
+    QFile oldFile(previewFileLocation);
+
+    if(oldFile.exists()){
+        if(!oldFile.remove()){
+            UtilVago::showAndLogErrorPopUpLogButton(this->myLogger,
+                                                    "Couldn't remove old temporary file to preview XML patch! Existing file:\n"
+                                                    + previewFileLocation
+                                                    );
+        }
+    }
+
+    if(!QFile::copy(currentFileLocation, previewFileLocation)){
+        UtilVago::showAndLogErrorPopUpLogButton(this->myLogger,
+                                                "Couldn't create temporary file to preview the XML patch!\nFrom: " +
+                                                currentFileLocation +
+                                                "\nTo: " + previewFileLocation
+                                                );
+        return;
+    }
+
+    this->listToProccess.append(buildCommand(previewFileLocation).remove(0,9)); // 0,9 removes XmlTools from the beginning
+    this->previewInProgress = true;
+
+    this->xmlProcessor->start();
+    this->xmlProcessor->wait(); // wait for the XML to be processed
+
+    XmlToolsInterfaceCommandPreview *previewWindow = new XmlToolsInterfaceCommandPreview(currentFileLocation, previewFileLocation, this);
+    previewWindow->show();
+}
+
+void XmlToolsInterface::on_pbApplyOperation_clicked()
+{
+    if(!validateInput()){
+        return;
+    }
+
+    this->listToProccess.clear();
+    this->listToProccess.append(ui->leOperationCommandGenCommand->text().remove(0,9)); // 0,9 removes XmlTools from the beginning
+    this->xmlProcessor->start();
+}
+
+// return true if valid, false otherwise
+bool XmlToolsInterface::validateInput()
+{
+
+    if(ui->leInputInputFiles->text().trimmed().isEmpty()){
+        Util::showErrorPopUp("You must provide an Input File!");
+        return false;
+    }
+
+    if(ui->rbFilterRelativeElements->isChecked() && ui->leFilterElement->text().trimmed().isEmpty()){
+        Util::showErrorPopUp("With Relative Elements checked you must provide a Element Name!");
+        return false;
+    }
+
+    if(ui->cbFilterParentElement->isChecked() && ui->leFilterParentElement->text().trimmed().isEmpty()){
+        Util::showErrorPopUp("Parent Element is checked but none was provided!");
+        return false;
+    }
+
+    if(ui->cbFilterAttributeName->isChecked()){
+        if(ui->leFilterAttributeName->text().trimmed().isEmpty())
+        {
+            Util::showErrorPopUp("Attribute Name is checked but none was provided!");
+            return false;
+        }
+
+        if(ui->leFilterAttributeValue->text().trimmed().isEmpty())
+        {
+            Util::showErrorPopUp("With Attribute Name checked you must provide a Attribute Value!");
+            return false;
+        }
+    }
+
+    if(ui->rbFilterXPathExpression->isChecked() && ui->leFilterXPathExpression->text().trimmed().isEmpty())
+    {
+        Util::showErrorPopUp("X-Path Expression is checked but none was provided!");
+        return false;
+    }
+
+    if(ui->cbXmlToolsOperation->currentText() == "Add Values" && ui->leInputNewValues->text().isEmpty()){
+        Util::showErrorPopUp(R"|(With "Add Values" operation selected you must provide the "New Value(s)" to be added.)|");
+        return false;
+    }
+
+    if(ui->cbXmlToolsOperation->currentText() == "Remove Values" && ui->leInputCurrentValues->text().isEmpty()){
+        Util::showErrorPopUp(R"|(With "Remove Value" operation selected you must provide the "Current Value(s)" to be removed.)|");
+        return false;
+    }
+
+    return true;
+}
+
+void XmlToolsInterface::TXmlToolsResult(QString result, int numErrors){
+
+    if(!this->previewInProgress){
+        QApplication::alert(this); //Show a notification if window is not active (only when not previewing)
+    }
+
+    if(numErrors!=0){
+        QString sNumErrors=QString::number(numErrors);
+        if(numErrors>1){
+            UtilVago::showErrorPopUpLogButton(result+"\n This is the last of "+sNumErrors+" errors.");
+        }
+        else{
+            UtilVago::showErrorPopUpLogButton(result);
+        }
+    }
+    else if(numErrors == 0){
+        // if there's a preview in progress don't display the message below
+        if(!this->previewInProgress){
+            Util::showPopUp("File(s) processed with sucess!");
+        }
+    }
+
+    this->previewInProgress = false;
+}
+
+void XmlToolsInterface::setCommand(){
+  ui->leOperationCommandGenCommand->setText(buildCommand());
+}
+
+QString XmlToolsInterface::buildCommand(const QString &alternativeFileLocation){
+    QString currCommand;
+
+    QString currOperation = ui->cbXmlToolsOperation->currentText();
+
+    if(currOperation == "Add Values"){
+        currCommand += "--add-values ";
+    }
+    else if(currOperation == "Remove Values"){
+        currCommand += "--remove-values ";
+    }
+    else if(currOperation == "Replace Single Value"){
+        currCommand += "--replace-value ";
+    }
+    else if(currOperation == "Replace All Values"){
+        currCommand += "--replace-all-values ";
+    }
+    else if(currOperation == "Update Elements"){
+        currCommand += "--update-elements ";
+    }
+    else if(currOperation == "Invert Elements"){
+        currCommand += "--invert-elements ";
+    }
+
+    if(ui->leInputNewValues->isEnabled()){
+        currCommand += "--new-val " + Util::insertQuotes(ui->leInputNewValues->text()) + " ";
+    }
+
+    if(ui->leInputCurrentValues->isEnabled()){
+        currCommand += "--current-val " + Util::insertQuotes(ui->leInputCurrentValues->text()) + " ";
+    }
+
+    if(ui->leInputPositions->isEnabled() && !ui->leInputPositions->text().trimmed().isEmpty()){
+        currCommand += "--positions " + Util::insertQuotes(ui->leInputPositions->text()) + " ";
+    }
+
+    if(ui->leInputDiffOldNewValue->isEnabled()){
+        currCommand += "--diff-old-new-val " + Util::insertQuotes(ui->leInputDiffOldNewValue->text()) + " ";
+    }
+
+    if(ui->rbFilterRelativeElements->isChecked()){
+        if(ui->leFilterElement->isEnabled()){
+            currCommand += "--element-name " + Util::insertQuotes(ui->leFilterElement->text()) + " ";
+        }
+        if(ui->leFilterParentElement->isEnabled()){
+            currCommand += "--parent-element-name " + Util::insertQuotes(ui->leFilterParentElement->text()) + " ";
+        }
+        if(ui->leFilterAttributeName->isEnabled()){
+            currCommand += "--attribute-name " + Util::insertQuotes(ui->leFilterAttributeName->text()) + " ";
+            currCommand += "--attribute-value " + Util::insertQuotes(ui->leFilterAttributeValue->text()) + " ";
+        }
+    }
+    else{
+        if(ui->leFilterXPathExpression->isEnabled()){
+            currCommand += "--xpath-expression " + Util::insertQuotes(ui->leFilterXPathExpression->text()) + " ";
+        }
+    }
+
+    if(alternativeFileLocation.isEmpty()){
+        currCommand += "--files " + Util::insertQuotes(ui->leInputInputFiles->text());
+    }
+    else{
+        currCommand += "--files " + Util::insertQuotes(alternativeFileLocation);
+    }
+
+
+    if(ui->cbOptionsNoBackups->isChecked()){
+        currCommand += " --no-backups";
+    }
+
+    return "XmlTools " + currCommand;
+}
+
+void XmlToolsInterface::on_pbOperationCommandCopyToClipboard_clicked()
+{
+    QApplication::clipboard()->setText(ui->leOperationCommandGenCommand->text());
+}
+
+void XmlToolsInterface::on_leInputInputFiles_textChanged(const QString &arg1)
+{
+    // If it contains a wildcard we are not able to guarantee that it is editing only one file, in this case we can't preview the result
+    if(arg1.contains("*") || arg1.contains("?")){
+        ui->pbPreviewOperation->setEnabled(false);
+    }
+    else{
+        ui->pbPreviewOperation->setEnabled(true);
+    }
+
+    setCommand();
+}
+
+void XmlToolsInterface::on_leFilterElement_textChanged(const QString &)
+{
+    setCommand();
+}
+
+void XmlToolsInterface::on_leFilterParentElement_textChanged(const QString &)
+{
+    setCommand();
+}
+
+void XmlToolsInterface::on_leFilterAttributeName_textChanged(const QString &)
+{
+    setCommand();
+}
+
+void XmlToolsInterface::on_leFilterAttributeValue_textChanged(const QString &)
+{
+    setCommand();
+}
+
+void XmlToolsInterface::on_leInputCurrentValues_textChanged(const QString &)
+{
+    setCommand();
+}
+
+void XmlToolsInterface::on_leInputNewValues_textChanged(const QString &)
+{
+    setCommand();
+}
+
+void XmlToolsInterface::on_leInputPositions_textChanged(const QString &)
+{
+    setCommand();
+}
+
+void XmlToolsInterface::on_leInputDiffOldNewValue_textChanged(const QString &)
+{
+    setCommand();
+}
+
+void XmlToolsInterface::on_cbOptionsNoBackups_toggled(bool)
+{
+    setCommand();
+}
Index: Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterface.h
===================================================================
--- Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterface.h	(revision 1058)
+++ Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterface.h	(revision 1058)
@@ -0,0 +1,87 @@
+#ifndef XMLTOOLSINTERFACE_H
+#define XMLTOOLSINTERFACE_H
+
+#include <QMainWindow>
+#include <QClipboard>
+#include <QProcess>
+#include <QScrollBar>
+#include <QDragEnterEvent>
+#include <QMimeData>
+#include <QHBoxLayout>
+
+#include "utilvago.h"
+#include "xmlprocessor.h"
+#include "xmltoolsinterfacecommandpreview.h"
+
+
+namespace Ui {
+class XmlToolsInterface;
+}
+
+class XmlToolsInterface : public QMainWindow
+{
+    Q_OBJECT
+    
+public:
+    explicit XmlToolsInterface(Logger *myLogger, QWidget *parent = 0);
+    ~XmlToolsInterface();
+
+protected:
+    
+private slots:
+
+    void TXmlToolsResult(QString result, int numErrors);
+
+    void on_rbFilterRelativeElements_clicked();
+
+    void on_rbFilterXPathExpression_clicked();
+
+    void on_cbXmlToolsOperation_currentIndexChanged(const QString &arg1);
+
+    void on_cbFilterParentElement_toggled(bool checked);
+
+    void on_cbFilterAttributeName_toggled(bool checked);
+
+    void on_pbInputBrowse_clicked();
+
+    void on_pbPreviewOperation_clicked();
+
+    void on_pbOperationCommandCopyToClipboard_clicked();
+
+    void on_leInputInputFiles_textChanged(const QString &arg1);
+
+    void on_leFilterElement_textChanged(const QString &arg1);
+
+    void on_leFilterParentElement_textChanged(const QString &arg1);
+
+    void on_leFilterAttributeName_textChanged(const QString &arg1);
+
+    void on_leFilterAttributeValue_textChanged(const QString &arg1);
+
+    void on_leInputCurrentValues_textChanged(const QString &arg1);
+
+    void on_leInputNewValues_textChanged(const QString &arg1);
+
+    void on_leInputPositions_textChanged(const QString &arg1);
+
+    void on_leInputDiffOldNewValue_textChanged(const QString &arg1);
+
+    void on_cbOptionsNoBackups_toggled(bool checked);
+
+    void on_pbApplyOperation_clicked();
+
+private:
+    Ui::XmlToolsInterface *ui;
+    Logger *myLogger = nullptr;
+    QStringList listToProccess; //commands to execute
+    XmlProcessor *xmlProcessor = nullptr;
+    bool previewInProgress = false;
+
+    bool validateInput();
+    QString buildCommand(const QString &alternativeFileLocation = "");
+    void setCommand();
+    void dropEvent(QDropEvent* event);
+    void dragEnterEvent(QDragEnterEvent *event);
+};
+
+#endif // XMLTOOLSINTERFACE_H
Index: Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterface.ui
===================================================================
--- Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterface.ui	(revision 1058)
+++ Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterface.ui	(revision 1058)
@@ -0,0 +1,550 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>XmlToolsInterface</class>
+ <widget class="QMainWindow" name="XmlToolsInterface">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>640</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>640</width>
+    <height>480</height>
+   </size>
+  </property>
+  <property name="acceptDrops">
+   <bool>true</bool>
+  </property>
+  <property name="windowTitle">
+   <string>XmlTools Interface</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="../resources.qrc">
+    <normaloff>:/new/icons/xmltoolsinterface.png</normaloff>:/new/icons/xmltoolsinterface.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QVBoxLayout" name="verticalLayout_5">
+    <item>
+     <layout class="QFormLayout" name="formLayout_5">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label">
+        <property name="text">
+         <string>XmlTools Operation:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QComboBox" name="cbXmlToolsOperation">
+        <item>
+         <property name="text">
+          <string>Add Values</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Remove Values</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Replace Single Value</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Replace All Values</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Update Elements</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Invert Elements</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <spacer name="verticalSpacer_6">
+      <property name="orientation">
+       <enum>Qt::Vertical</enum>
+      </property>
+      <property name="sizeHint" stdset="0">
+       <size>
+        <width>20</width>
+        <height>40</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+    <item>
+     <widget class="QGroupBox" name="groupBox">
+      <property name="title">
+       <string>Filter</string>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_6">
+         <item>
+          <widget class="QRadioButton" name="rbFilterRelativeElements">
+           <property name="minimumSize">
+            <size>
+             <width>110</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Relative Elements</string>
+           </property>
+           <property name="checked">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout">
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout">
+             <item>
+              <layout class="QFormLayout" name="formLayout_2">
+               <item row="0" column="0">
+                <widget class="QLabel" name="lbFilterElement">
+                 <property name="minimumSize">
+                  <size>
+                   <width>102</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Element:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QLineEdit" name="leFilterElement">
+                 <property name="minimumSize">
+                  <size>
+                   <width>120</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QFormLayout" name="formLayout_7">
+               <item row="0" column="0">
+                <widget class="QCheckBox" name="cbFilterParentElement">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Parent Element:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QLineEdit" name="leFilterParentElement"/>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_2">
+             <item>
+              <layout class="QFormLayout" name="formLayout_4">
+               <item row="0" column="0">
+                <widget class="QCheckBox" name="cbFilterAttributeName">
+                 <property name="minimumSize">
+                  <size>
+                   <width>102</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Attribute Name:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QLineEdit" name="leFilterAttributeName">
+                 <property name="minimumSize">
+                  <size>
+                   <width>120</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QFormLayout" name="formLayout_3">
+               <item row="0" column="0">
+                <widget class="QLabel" name="lbFilterAttributeValue">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Attribute Value:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QLineEdit" name="leFilterAttributeValue"/>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout">
+         <item row="0" column="0">
+          <widget class="QRadioButton" name="rbFilterXPathExpression">
+           <property name="minimumSize">
+            <size>
+             <width>110</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>X-Path Expression</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="leFilterXPathExpression"/>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+    </item>
+    <item>
+     <spacer name="verticalSpacer">
+      <property name="orientation">
+       <enum>Qt::Vertical</enum>
+      </property>
+      <property name="sizeHint" stdset="0">
+       <size>
+        <width>20</width>
+        <height>40</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+    <item>
+     <widget class="QGroupBox" name="groupBox_2">
+      <property name="title">
+       <string>Input</string>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_4">
+       <item>
+        <layout class="QFormLayout" name="formLayout_6">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_2">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>156</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Input File(s):</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <layout class="QHBoxLayout" name="horizontalLayout_3">
+           <item>
+            <widget class="QLineEdit" name="leInputInputFiles"/>
+           </item>
+           <item>
+            <widget class="QPushButton" name="pbInputBrowse">
+             <property name="text">
+              <string>Browse...</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout_8">
+         <item row="0" column="0">
+          <widget class="QLabel" name="lbInputCurrentValues">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>156</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Current Value(s):</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="leInputCurrentValues">
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout_9">
+         <item row="0" column="0">
+          <widget class="QLabel" name="lbInputNewValues">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>156</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>New Value(s):</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="leInputNewValues"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout_10">
+         <item row="0" column="0">
+          <widget class="QLabel" name="lbInputPositions">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>156</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Position(s):</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="leInputPositions">
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout_12">
+         <item row="0" column="0">
+          <widget class="QLabel" name="lbInputDiffOldNewValue">
+           <property name="text">
+            <string>Diff between old and new value:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="leInputDiffOldNewValue"/>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+    </item>
+    <item>
+     <spacer name="verticalSpacer_3">
+      <property name="orientation">
+       <enum>Qt::Vertical</enum>
+      </property>
+      <property name="sizeHint" stdset="0">
+       <size>
+        <width>20</width>
+        <height>40</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+    <item>
+     <widget class="QGroupBox" name="groupBox_3">
+      <property name="title">
+       <string>Options</string>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <item>
+        <widget class="QCheckBox" name="cbOptionsNoBackups">
+         <property name="text">
+          <string>No Backups</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </item>
+    <item>
+     <spacer name="verticalSpacer_4">
+      <property name="orientation">
+       <enum>Qt::Vertical</enum>
+      </property>
+      <property name="sizeHint" stdset="0">
+       <size>
+        <width>20</width>
+        <height>40</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+    <item>
+     <widget class="QGroupBox" name="groupBox_4">
+      <property name="title">
+       <string>XmlTools Operation Command</string>
+      </property>
+      <layout class="QHBoxLayout" name="horizontalLayout_5">
+       <item>
+        <widget class="QLineEdit" name="leOperationCommandGenCommand">
+         <property name="enabled">
+          <bool>true</bool>
+         </property>
+         <property name="readOnly">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pbOperationCommandCopyToClipboard">
+         <property name="text">
+          <string>Copy to clipboard</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </item>
+    <item>
+     <spacer name="verticalSpacer_5">
+      <property name="orientation">
+       <enum>Qt::Vertical</enum>
+      </property>
+      <property name="sizeHint" stdset="0">
+       <size>
+        <width>20</width>
+        <height>40</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_4">
+      <item>
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="pbPreviewOperation">
+        <property name="minimumSize">
+         <size>
+          <width>150</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>Preview Operation</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::Fixed</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="pbApplyOperation">
+        <property name="minimumSize">
+         <size>
+          <width>100</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>Apply Operation</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <resources>
+  <include location="../resources.qrc"/>
+ </resources>
+ <connections/>
+</ui>
Index: Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.cpp
===================================================================
--- Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.cpp	(revision 1058)
+++ Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.cpp	(revision 1058)
@@ -0,0 +1,206 @@
+#include "xmltoolsinterfacecommandpreview.h"
+#include "ui_xmltoolsinterfacecommandpreview.h"
+
+XmlToolsInterfaceCommandPreview::XmlToolsInterfaceCommandPreview(const QString &currentFileLocation, const QString &previewFileLocation, QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::XmlToolsInterfaceCommandPreview)
+{
+    ui->setupUi(this);
+    this->setAttribute(Qt::WA_DeleteOnClose, true); //destroy itself once finished.
+
+    QFile currentFile(currentFileLocation);
+    currentFile.open(QIODevice::ReadOnly);
+
+    this->currentText = currentFile.readAll();
+
+    ui->teCurrentFileText->setText(this->currentText);
+
+    QFile previewFile(previewFileLocation);
+    previewFile.open(QIODevice::ReadOnly);
+
+    this->previewText = previewFile.readAll();
+
+    ui->tePreviewFileText->setText(this->previewText);
+
+    highlighterCurrentFile = new BasicXMLSyntaxHighlighter(ui->teCurrentFileText);
+    highlighterPreviewFile = new BasicXMLSyntaxHighlighter(ui->tePreviewFileText);
+
+    previewFile.close();
+    currentFile.close();
+
+    // Split and trim text of current and preview file
+    this->currentTextRows = this->currentText.split("\n");
+    this->previewTextRows = this->previewText.split("\n");
+
+    for(QString &currentTextRow : this->currentTextRows){
+        currentTextRow = currentTextRow.trimmed();
+    }
+    for(QString &previewTextRow : this->previewTextRows){
+        previewTextRow = previewTextRow.trimmed();
+    }
+
+
+    QString currentTextRowNumbers;
+    QString previewTextRowNumbers;
+
+    for(int i=0; i<this->currentTextRows.size(); i++){
+        currentTextRowNumbers += QString::number(i);
+        if(i < this->currentTextRows.size()-1){
+            currentTextRowNumbers += "\n";
+        }
+    }
+
+    for(int i=0; i<this->previewTextRows.size(); i++){
+        previewTextRowNumbers += QString::number(i);
+        if(i < this->previewTextRows.size()-1){
+            previewTextRowNumbers += "\n";
+        }
+    }
+
+    // Create line numbers QTextEdits
+    this->lineNumberDisplayCurrentFile = new LineNumberDisplay(ui->teCurrentFileText,this);
+    this->lineNumberDisplayPreviewFile = new LineNumberDisplay(ui->tePreviewFileText,this);
+
+    // Make line numbers background transparent (http://www.qtcentre.org/threads/12148-how-QTextEdit-transparent-to-his-parent-window)
+    this->lineNumberDisplayCurrentFile->viewport()->setAutoFillBackground(false);
+    this->lineNumberDisplayPreviewFile->viewport()->setAutoFillBackground(false);
+
+    // Add line numbers (at beginning of the horizontal layout)
+    this->ui->hlCurrentFileText->insertWidget(0,lineNumberDisplayCurrentFile);
+    this->ui->hlPreviewFileText->insertWidget(0,lineNumberDisplayPreviewFile);
+
+    // Save the default background color (OS dependent)
+    this->textEditDefaultBackgroundColor = QTextCursor(this->lineNumberDisplayCurrentFile->document()).charFormat().background();
+
+    highlightDifferences();
+
+    // Vertical scrollbars
+    connect(ui->teCurrentFileText->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(verticalScrollbarMoved(int)));
+    connect(ui->tePreviewFileText->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(verticalScrollbarMoved(int)));
+
+    // Horizontal scrollbars
+    connect(ui->teCurrentFileText->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(horizontalScrollbarMoved(int)));
+    connect(ui->tePreviewFileText->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(horizontalScrollbarMoved(int)));
+}
+
+void XmlToolsInterfaceCommandPreview::verticalScrollbarMoved(int value)
+{
+    if(ui->cbVerticalScrollbarsSynchronized->isChecked()){
+        if(ui->teCurrentFileText->verticalScrollBar()->sliderPosition() != value){
+            ui->teCurrentFileText->verticalScrollBar()->setSliderPosition(value);
+        }
+        else{
+            ui->tePreviewFileText->verticalScrollBar()->setSliderPosition(value);
+        }
+    }
+}
+
+void XmlToolsInterfaceCommandPreview::horizontalScrollbarMoved(int value)
+{
+    if(ui->cbHorizontalScrollbarsSynchronized->isChecked()){
+        if(ui->teCurrentFileText->horizontalScrollBar()->sliderPosition() != value){
+            ui->teCurrentFileText->horizontalScrollBar()->setSliderPosition(value);
+        }
+        else{
+            ui->tePreviewFileText->horizontalScrollBar()->setSliderPosition(value);
+        }
+    }
+}
+
+void XmlToolsInterfaceCommandPreview::on_cbWrapText_toggled(bool checked)
+{
+    QTextEdit::LineWrapMode wrappingMode;
+
+    if(checked){
+        wrappingMode = QTextEdit::WidgetWidth;
+        this->lineNumberDisplayCurrentFile->hide();
+        this->lineNumberDisplayPreviewFile->hide();
+    }
+    else{
+        wrappingMode = QTextEdit::NoWrap;
+        this->lineNumberDisplayCurrentFile->show();
+        this->lineNumberDisplayPreviewFile->show();
+    }
+
+    ui->teCurrentFileText->setLineWrapMode(wrappingMode);
+    ui->tePreviewFileText->setLineWrapMode(wrappingMode);
+}
+
+void XmlToolsInterfaceCommandPreview::highlightDifferences(){
+
+    QTextCharFormat fmt;
+    QTextCursor cursor;
+
+    for(int i=0; i<currentTextRows.size(); i++){
+        if(i < this->previewTextRows.size()){
+            if(this->currentTextRows.at(i) != this->previewTextRows.at(i)){
+                fmt.setBackground(QColor(0xFFC864)); // orange color
+
+                cursor = QTextCursor(ui->teCurrentFileText->document());
+                cursor.setPosition(ui->teCurrentFileText->document()->findBlockByLineNumber(i).position());
+                cursor.select(QTextCursor::LineUnderCursor);
+                cursor.setCharFormat(fmt);
+
+                fmt.setBackground(Qt::yellow);
+
+                cursor = QTextCursor(ui->tePreviewFileText->document());
+                cursor.setPosition(ui->tePreviewFileText->document()->findBlockByLineNumber(i).position());
+                cursor.select(QTextCursor::LineUnderCursor);
+                cursor.setCharFormat(fmt);
+            }
+        }
+        else{ // if we have more rows in the current file than in the preview file we highlight the the extra rows in the current file
+            fmt.setBackground(QColor(0xFFC864)); // orange color
+
+            QTextCursor cursor(ui->teCurrentFileText->document());
+            cursor.setPosition(ui->teCurrentFileText->document()->findBlockByLineNumber(i).position());
+            cursor.select(QTextCursor::LineUnderCursor);
+            cursor.setCharFormat(fmt);
+        }
+    }
+
+    // if we have less rows in the current file than in the preview file we highlight the the extra rows in the preview file
+    if(this->currentTextRows.size() < this->previewTextRows.size()){
+        for(int i=this->currentTextRows.size(); i<this->previewTextRows.size(); i++){
+            fmt.setBackground(Qt::yellow);
+
+            cursor = QTextCursor(ui->tePreviewFileText->document());
+            cursor.setPosition(ui->tePreviewFileText->document()->findBlockByLineNumber(i).position());
+            cursor.select(QTextCursor::LineUnderCursor);
+            cursor.setCharFormat(fmt);
+        }
+    }
+
+    highlighterPreviewFile->rehighlight();
+    highlighterCurrentFile->rehighlight();
+}
+
+XmlToolsInterfaceCommandPreview::~XmlToolsInterfaceCommandPreview()
+{
+    delete this->highlighterCurrentFile;
+    delete this->highlighterPreviewFile;
+    delete this->lineNumberDisplayCurrentFile;
+    delete this->lineNumberDisplayPreviewFile;
+    delete this->ui;
+}
+
+
+
+void XmlToolsInterfaceCommandPreview::on_checkBox_toggled(bool checked)
+{
+    if(checked){
+        highlightDifferences();
+    }
+    else{
+        QTextCursor cursor(ui->teCurrentFileText->document());
+        QTextCharFormat fmt;
+        fmt.setBackground(this->textEditDefaultBackgroundColor);
+
+        cursor.select(QTextCursor::Document);
+        cursor.setCharFormat(fmt);
+
+        cursor = QTextCursor(ui->tePreviewFileText->document());
+        cursor.select(QTextCursor::Document);
+        cursor.setCharFormat(fmt);
+    }
+}
Index: Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.h
===================================================================
--- Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.h	(revision 1058)
+++ Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.h	(revision 1058)
@@ -0,0 +1,44 @@
+#ifndef XMLTOOLSINTERFACECOMMANDPREVIEW_H
+#define XMLTOOLSINTERFACECOMMANDPREVIEW_H
+
+#include <QMainWindow>
+#include <QFile>
+#include <QScrollBar>
+
+#include "../libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h"
+#include "../libs/LineNumberDisplay/LineNumberDisplay.h"
+#include "util.h"
+
+namespace Ui {
+class XmlToolsInterfaceCommandPreview;
+}
+
+class XmlToolsInterfaceCommandPreview : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit XmlToolsInterfaceCommandPreview(const QString &currentFileLocation, const QString &previewFileLocation, QWidget *parent = 0);
+    ~XmlToolsInterfaceCommandPreview();
+
+private:
+    Ui::XmlToolsInterfaceCommandPreview *ui;
+    BasicXMLSyntaxHighlighter *highlighterCurrentFile;
+    BasicXMLSyntaxHighlighter *highlighterPreviewFile;
+    LineNumberDisplay *lineNumberDisplayCurrentFile;
+    LineNumberDisplay *lineNumberDisplayPreviewFile;
+    QString currentText;
+    QString previewText;
+    QStringList currentTextRows;
+    QStringList previewTextRows;
+    QBrush textEditDefaultBackgroundColor;
+
+private slots:
+    void verticalScrollbarMoved(int value);
+    void horizontalScrollbarMoved(int value);
+    void on_cbWrapText_toggled(bool checked);
+    void highlightDifferences();
+    void on_checkBox_toggled(bool checked);
+};
+
+#endif // XMLTOOLSINTERFACECOMMANDPREVIEW_H
Index: Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.ui
===================================================================
--- Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.ui	(revision 1058)
+++ Vago/trunk/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.ui	(revision 1058)
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>XmlToolsInterfaceCommandPreview</class>
+ <widget class="QMainWindow" name="XmlToolsInterfaceCommandPreview">
+  <property name="windowModality">
+   <enum>Qt::WindowModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>560</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>XmlTools command preview</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="../resources.qrc">
+    <normaloff>:/new/icons/xmltoolsinterface.png</normaloff>:/new/icons/xmltoolsinterface.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <layout class="QVBoxLayout" name="verticalLayout_3">
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_5">
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout">
+        <item>
+         <widget class="QLabel" name="label">
+          <property name="text">
+           <string>Original File:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="hlCurrentFileText">
+          <property name="spacing">
+           <number>0</number>
+          </property>
+          <item>
+           <widget class="QTextEdit" name="teCurrentFileText">
+            <property name="lineWrapMode">
+             <enum>QTextEdit::NoWrap</enum>
+            </property>
+            <property name="readOnly">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_2">
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>Changed File:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="hlPreviewFileText">
+          <property name="spacing">
+           <number>0</number>
+          </property>
+          <item>
+           <widget class="QTextEdit" name="tePreviewFileText">
+            <property name="lineWrapMode">
+             <enum>QTextEdit::NoWrap</enum>
+            </property>
+            <property name="readOnly">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <widget class="QGroupBox" name="groupBox">
+      <property name="title">
+       <string>Options</string>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_4">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <widget class="QCheckBox" name="checkBox">
+           <property name="text">
+            <string>Highlight differences</string>
+           </property>
+           <property name="checked">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="cbWrapText">
+           <property name="text">
+            <string>Wrap Text (hides line numbers)</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_3">
+         <item>
+          <widget class="QCheckBox" name="cbVerticalScrollbarsSynchronized">
+           <property name="text">
+            <string>Vertical scrollbars synchronized</string>
+           </property>
+           <property name="checked">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="cbHorizontalScrollbarsSynchronized">
+           <property name="text">
+            <string>Horizontal scrollbars synchronized</string>
+           </property>
+           <property name="checked">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <resources>
+  <include location="../resources.qrc"/>
+ </resources>
+ <connections/>
+</ui>
